Skip to content

Commit

Permalink
Merge pull request #8 from NoRedInk/luke--upgrade-0.19
Browse files Browse the repository at this point in the history
Upgrade to 0.19
  • Loading branch information
lukewestby authored Aug 28, 2018
2 parents e96c314 + 47d4430 commit af0ff01
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 52 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ node_js:
- node # latest stable

env:
- ELM_VERSION=0.18.0 ELM_TEST_VERSION=0.18.7 ELM_VERIFY_EXAMPLES_VERSION=1.0.2
- ELM_VERSION=0.19.0 ELM_TEST_VERSION=0.19.0-beta4 ELM_VERIFY_EXAMPLES_VERSION=3.0.0

cache:
directories:
Expand All @@ -28,8 +28,6 @@ install:
fi
- npm install -g elm@${ELM_VERSION} elm-test@${ELM_TEST_VERSION} elm-verify-examples@${ELM_VERIFY_EXAMPLES_VERSION}
- $TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 make elm-stuff
- $TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 make tests/elm-stuff

script:
- $TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 make documentation.json
Expand Down
18 changes: 6 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,14 @@ all: test documentation.json

.PHONY: clean
clean:
rm -rf elm-stuff tests/elm-stuff tests/Doc documentation.json
rm -rf elm-stuff tests/Doc documentation.json

elm-stuff:
elm package install --yes

documentation.json: elm-stuff ${ELM_FILES}
elm make --yes --warn --docs=$@
documentation.json: ${ELM_FILES}
elm make --docs=$@

.PHONY: test
test: tests/Doc tests/elm-stuff
elm test
test: tests/Doc
rm -rf elm-stuff/generated-code/elm-explorations/test/ && elm-test

tests/Doc: ${ELM_FILES}
elm-verify-examples

tests/elm-stuff: tests/elm-package.json
cd tests && elm package install --yes
rm -rf elm-stuff/generated-code/elm-explorations/test/ && elm-verify-examples
16 changes: 0 additions & 16 deletions elm-package.json

This file was deleted.

17 changes: 17 additions & 0 deletions elm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "package",
"name": "NoRedInk/elm-simple-fuzzy",
"summary": "Fuzzy matching and filtering for strings.",
"license": "BSD-3-Clause",
"version": "1.0.3",
"exposed-modules": [
"Simple.Fuzzy"
],
"elm-version": "0.19.0 <= v < 0.20.0",
"dependencies": {
"elm/core": "1.0.0 <= v < 2.0.0"
},
"test-dependencies": {
"elm-explorations/test": "1.0.0 <= v < 2.0.0"
}
}
12 changes: 7 additions & 5 deletions src/Simple/Fuzzy.elm
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
module Simple.Fuzzy exposing (match, root, filter)
module Simple.Fuzzy exposing (filter, match, root)

{-| Fuzzy match through a list of strings
# Matching and Filtering
@docs match, filter
# Helpers
@docs root
-}

import String
import Char
import String


{-| `match` allows you to see if the letters of your query
Expand Down Expand Up @@ -55,11 +57,11 @@ converts the object to value you want to match on
-}
filter : (a -> String) -> String -> List a -> List a
filter map needle records =
List.filter ((match needle) << map) records
List.filter (match needle << map) records


{-| `root` strips a word down to just the lower case version of itself
without any punctuation or spacing. Digits are retained.
without any punctuation or spacing. Digits are retained.
root "Wow, I'm excited!!!!" --> "wowimexcited"
Expand All @@ -70,7 +72,7 @@ root : String -> String
root string =
string
|> String.toLower
|> String.filter (\c -> (Char.isLower c) || (Char.isDigit c))
|> String.filter (\c -> Char.isLower c || Char.isDigit c)


searchHelper : Char -> Maybe String -> Maybe String
Expand Down
16 changes: 0 additions & 16 deletions tests/elm-package.json

This file was deleted.

0 comments on commit af0ff01

Please sign in to comment.