diff --git a/.travis.yml b/.travis.yml index 2e6b728..5724910 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,15 @@ language: node_js -sudo: false -node_js: - - 5 +dist: trusty +sudo: required +node_js: 6 install: - npm install -g bower - npm install + - bower install script: - - npm run build + - npm run -s build after_success: - >- test $TRAVIS_TAG && - psc-publish > .pursuit.json && - curl -X POST http://pursuit.purescript.org/packages \ - -d @.pursuit.json \ - -H 'Accept: application/json' \ - -H "Authorization: token ${GITHUB_TOKEN}" + echo $GITHUB_TOKEN | pulp login && + echo y | pulp publish --no-push diff --git a/README.md b/README.md index 4706acc..624224d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Latest release](http://img.shields.io/bower/v/purescript-http-methods.svg)](https://github.com/purescript-contrib/purescript-http-methods/releases) [![Build Status](https://travis-ci.org/purescript-contrib/purescript-http-methods.svg?branch=master)](https://travis-ci.org/purescript-contrib/purescript-http-methods) +[![Dependency Status](https://www.versioneye.com/user/projects/57558c637757a00041b3a750/badge.svg?style=flat)](https://www.versioneye.com/user/projects/57558c637757a00041b3a750) [![Maintainer: garyb](https://img.shields.io/badge/maintainer-garyb-lightgrey.svg)](http://github.com/garyb) HTTP method type. diff --git a/bower.json b/bower.json index 129d12d..ef4d3b6 100644 --- a/bower.json +++ b/bower.json @@ -17,9 +17,8 @@ "package.json" ], "dependencies": { - "purescript-either": "^0.2.3", - "purescript-generics": "^0.7.2", - "purescript-prelude": "^0.1.4", - "purescript-strings": "^0.7.1" + "purescript-either": "^1.0.0", + "purescript-generics": "^1.0.0", + "purescript-strings": "^1.0.0" } } diff --git a/package.json b/package.json index 7d26bdd..1e0f657 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { "private": true, "scripts": { - "postinstall": "pulp dep install", "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build" + "build": "pulp build --censor-lib --strict", + "test": "pulp test" }, "devDependencies": { - "pulp": "^8.0.0", - "purescript": "^0.7.6", + "pulp": "^9.0.0", + "purescript-psa": "^0.3.9", + "purescript": "^0.9.1", "rimraf": "^2.5.0" } } diff --git a/src/Data/HTTP/Method.purs b/src/Data/HTTP/Method.purs index c812dbe..5a61723 100644 --- a/src/Data/HTTP/Method.purs +++ b/src/Data/HTTP/Method.purs @@ -1,7 +1,7 @@ module Data.HTTP.Method ( Method(..) - , CustomMethod() - , runCustomMethod + , CustomMethod + , unCustomMethod , fromString , print ) where @@ -9,7 +9,7 @@ module Data.HTTP.Method import Prelude import Data.Either (Either(..), either) -import Data.Generic (Generic, gCompare) +import Data.Generic (class Generic) import Data.String as Str data Method @@ -35,30 +35,10 @@ data Method -- RFC5789 | PATCH +derive instance eqMethod :: Eq Method +derive instance ordMethod :: Ord Method derive instance genericMethod :: Generic Method -instance eqMethod :: Eq Method where - eq OPTIONS OPTIONS = true - eq GET GET = true - eq HEAD HEAD = true - eq POST POST = true - eq PUT PUT = true - eq DELETE DELETE = true - eq TRACE TRACE = true - eq CONNECT CONNECT = true - eq PROPFIND PROPFIND = true - eq PROPPATCH PROPPATCH = true - eq MKCOL MKCOL = true - eq COPY COPY = true - eq MOVE MOVE = true - eq LOCK LOCK = true - eq UNLOCK UNLOCK = true - eq PATCH PATCH = true - eq _ _ = false - -instance ordMethod :: Ord Method where - compare = gCompare - instance showMethod :: Show Method where show OPTIONS = "OPTIONS" show GET = "GET" @@ -79,17 +59,13 @@ instance showMethod :: Show Method where newtype CustomMethod = CustomMethod String -runCustomMethod :: CustomMethod -> String -runCustomMethod (CustomMethod m) = m +unCustomMethod :: CustomMethod -> String +unCustomMethod (CustomMethod m) = m +derive instance eqCustomMethod :: Eq CustomMethod +derive instance ordCustomMethod :: Ord CustomMethod derive instance genericCustomMethod :: Generic CustomMethod -instance eqCustomMethod :: Eq CustomMethod where - eq (CustomMethod m1) (CustomMethod m2) = m1 == m2 - -instance ordCustomMethod :: Ord CustomMethod where - compare = gCompare - instance showCustomMethod :: Show CustomMethod where show (CustomMethod m) = "(CustomMethod " <> show m <> ")" @@ -114,4 +90,4 @@ fromString s = m -> Right (CustomMethod m) print :: Either Method CustomMethod -> String -print = either show runCustomMethod +print = either show unCustomMethod