Skip to content

Commit

Permalink
reorganize
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Nov 20, 2018
1 parent 258a098 commit c3cd019
Show file tree
Hide file tree
Showing 44 changed files with 529 additions and 1,656 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: objective-c
os: osx
osx_image: xcode8
osx_image: xcode10.1
language: swift

env:
global:
Expand All @@ -14,7 +14,7 @@ before_install:
- bundle install

script:
- bin/fastlane test
- xcodebuild test -project ./RouterX.xcodeproj -scheme RouterX-Package | bundle exec xcpretty -f `xcpretty-travis-formatter`

after_success:
- bash <(curl -s https://codecov.io/bash)
12 changes: 6 additions & 6 deletions Demo.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let router = Router(defaultUnmatchHandler: defaultUnmatchHandler)
//: Register patterns, the closure is the handle when matched the pattern.

// Set a route pattern, the closure is a handler that would be performed after match the pattern
router.registerRoutingPattern(pattern1) { (url, parameters, context) in
router.register(pattern: pattern1) { (url, parameters, context) in
// Do something here, e.g: show a UI
var string = "URL is \(url), parameter is \(parameters)"
if let context = context as? String {
Expand All @@ -38,7 +38,7 @@ router.registerRoutingPattern(pattern1) { (url, parameters, context) in
print(string)
}

router.registerRoutingPattern(pattern2) { _, _, _ in
router.register(pattern: pattern2) { _, _, _ in
// Do something here, e.g: show a UI
print("call new article")
}
Expand All @@ -49,9 +49,9 @@ router.registerRoutingPattern(pattern2) { _, _, _ in
let path1 = "/articles/page/2/sort/recent.json?foo=bar&baz"

// It's will be matched, and perform the handler that we have set up.
router.matchURLPathAndDoHandler(path1)
router.match(urlPath: path1)
// It can pass the context for handler
router.matchURLPathAndDoHandler(path1, context: "fooo" as AnyObject?)
router.match(urlPath: path1, context: "fooo" as AnyObject?)

// A case that shouldn't be matched
let path2 = "/articles/2/edit"
Expand All @@ -66,7 +66,7 @@ let customUnmatchHandler: UnmatchRouteHandler = { (url, context) in
print(string)
}
// It's will not be matched, and perform the default unmatch handler that we have set up
router.matchURLPathAndDoHandler(path2)
router.match(urlPath: path2)

// It can provide a custome unmatch handler to override the default, also can pass the context
router.matchURLPathAndDoHandler(path2, context: "bar" as AnyObject?, unmatchHandler: customUnmatchHandler)
router.match(urlPath: path2, context: "bar" as AnyObject?, unmatchHandler: customUnmatchHandler)
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://rubygems.org'
source "https://rubygems.org"

gem 'fastlane'
gem 'xcpretty'
gem 'cocoapods'
gem "xcpretty"
gem "xcpretty-travis-formatter"
gem "cocoapods", "~> 1.6.0.beta.2"
298 changes: 50 additions & 248 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,281 +1,83 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.7.1)
CFPropertyList (3.0.0)
activesupport (4.2.10)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
babosa (1.0.2)
cert (1.4.2)
fastlane_core (>= 0.50.3, < 1.0.0)
spaceship (>= 0.32.0, < 1.0.0)
claide (1.0.0)
cocoapods (1.0.1)
activesupport (>= 4.0.2)
claide (>= 1.0.0, < 2.0)
cocoapods-core (= 1.0.1)
cocoapods-deintegrate (>= 1.0.0, < 2.0)
cocoapods-downloader (>= 1.0.0, < 2.0)
atomos (0.1.3)
claide (1.0.2)
cocoapods (1.6.0.beta.2)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.6.0.beta.2)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.0.0, < 2.0)
cocoapods-try (>= 1.0.0, < 2.0)
colored (~> 1.2)
cocoapods-trunk (>= 1.3.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (~> 0.3.0)
molinillo (~> 0.4.5)
fourflusher (~> 2.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
xcodeproj (>= 1.1.0, < 2.0)
cocoapods-core (1.0.1)
activesupport (>= 4.0.2)
ruby-macho (~> 1.3, >= 1.3.1)
xcodeproj (>= 1.7.0, < 2.0)
cocoapods-core (1.6.0.beta.2)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.1)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.0.0)
cocoapods-trunk (1.3.1)
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored (1.2)
commander (4.4.0)
highline (~> 1.7.2)
credentials_manager (0.16.0)
colored
commander (>= 4.3.5)
highline (>= 1.7.1)
security
deliver (1.13.3)
credentials_manager (>= 0.16.0, < 1.0.0)
fastimage (~> 1.6)
fastlane_core (>= 0.50.3, < 1.0.0)
plist (~> 3.1.0)
spaceship (>= 0.31.6, < 1.0.0)
domain_name (0.5.20160826)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.1.1)
colored2 (3.1.2)
concurrent-ruby (1.1.3)
escape (0.0.4)
excon (0.45.4)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.10.0)
faraday (>= 0.7.4, < 0.10)
fastimage (1.6.8)
addressable (~> 2.3, >= 2.3.5)
fastlane (1.103.0)
activesupport (< 5)
addressable (~> 2.3)
bundler (~> 1.12)
cert (>= 1.4.1, < 2.0.0)
credentials_manager (>= 0.16.0, < 1.0.0)
deliver (>= 1.13.3, < 2.0.0)
fastlane_core (>= 0.52.0, < 1.0.0)
frameit (>= 2.7.0, < 3.0.0)
gym (>= 1.7.0, < 2.0.0)
krausefx-shenzhen (>= 0.14.10)
match (>= 0.6.3, < 1.0.0)
multipart-post (~> 2.0.0)
pem (>= 1.3.2, < 2.0.0)
pilot (>= 1.10.0, < 2.0.0)
plist (~> 3.1.0)
produce (>= 1.2.0, < 2.0.0)
scan (>= 0.11.3, < 2.0.0)
screengrab (>= 0.5.0, < 1.0.0)
sigh (>= 1.10.2, < 2.0.0)
slack-notifier (~> 1.3)
snapshot (>= 1.14.0, < 2.0.0)
spaceship (>= 0.32.1, < 1.0.0)
supply (>= 0.7.0, < 1.0.0)
terminal-notifier (~> 1.6.2)
terminal-table (~> 1.4.5)
word_wrap (~> 1.0.0)
xcode-install (~> 2.0.0)
xcodeproj (>= 0.20, < 2.0.0)
xcpretty (>= 0.2.1)
fastlane_core (0.52.0)
babosa
colored
commander (>= 4.4.0, <= 5.0.0)
credentials_manager (>= 0.16.0, < 1.0.0)
excon (~> 0.45.0)
gh_inspector (>= 1.0.1, < 2.0.0)
highline (>= 1.7.2)
json
multi_json
plist (~> 3.1)
rubyzip (~> 1.1.6)
terminal-table (~> 1.4.5)
fourflusher (0.3.2)
frameit (2.7.0)
deliver (> 0.3)
fastimage (~> 1.6.3)
fastlane_core (>= 0.36.1, < 1.0.0)
mini_magick (~> 4.5.1)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.0.2)
google-api-client (0.9.15)
addressable (~> 2.3)
googleauth (~> 0.5)
httpclient (~> 2.7)
hurley (~> 0.1)
memoist (~> 0.11)
mime-types (>= 1.6)
representable (~> 2.3.0)
retriable (~> 2.0)
googleauth (0.5.1)
faraday (~> 0.9)
jwt (~> 1.4)
logging (~> 2.0)
memoist (~> 0.12)
multi_json (~> 1.11)
os (~> 0.9)
signet (~> 0.7)
gym (1.9.0)
fastlane_core (>= 0.51.0, < 1.0.0)
plist
rubyzip (>= 1.1.7)
terminal-table
xcpretty (>= 0.2.1)
highline (1.7.8)
http-cookie (1.0.2)
domain_name (~> 0.5)
httpclient (2.8.2.4)
hurley (0.2)
i18n (0.7.0)
json (1.8.3)
jwt (1.5.6)
krausefx-shenzhen (0.14.10)
commander (>= 4.3, < 5.0)
dotenv (>= 0.7)
faraday (~> 0.9)
faraday_middleware (~> 0.9)
highline (>= 1.7.2)
json (~> 1.8)
net-sftp (~> 2.1.2)
plist (~> 3.1.0)
rubyzip (~> 1.1)
security (~> 0.1.3)
terminal-table (~> 1.4.5)
little-plugger (1.1.4)
logging (2.1.0)
little-plugger (~> 1.1)
multi_json (~> 1.10)
match (0.8.0)
cert (>= 1.4.2, < 2.0.0)
credentials_manager (>= 0.16.0, < 1.0.0)
fastlane_core (>= 0.52.0, < 1.0.0)
security
sigh (>= 1.11.0, < 2.0.0)
spaceship (>= 0.33.0, < 1.0.0)
memoist (0.15.0)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.5.1)
minitest (5.9.0)
molinillo (0.4.5)
multi_json (1.12.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
gh_inspector (1.1.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
minitest (5.11.3)
molinillo (0.6.6)
nanaimo (0.2.6)
nap (1.1.0)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (3.2.0)
netrc (0.7.8)
os (0.9.6)
pem (1.3.2)
fastlane_core (>= 0.43.1, < 1.0.0)
spaceship (>= 0.26.2, < 1.0.0)
pilot (1.10.0)
credentials_manager (>= 0.3.0)
fastlane_core (>= 0.46.2, < 1.0.0)
spaceship (>= 0.29.0, < 1.0.0)
terminal-table (~> 1.4.5)
plist (3.1.0)
produce (1.2.0)
fastlane_core (>= 0.30.0, < 1.0.0)
spaceship (>= 0.31.1, < 1.0.0)
representable (2.3.0)
uber (~> 0.0.7)
retriable (2.1.0)
rouge (1.11.1)
rubyzip (1.1.7)
scan (0.13.0)
fastlane_core (>= 0.52.0, < 1.0.0)
slack-notifier (~> 1.3)
terminal-table
xcpretty (>= 0.2.1)
xcpretty-travis-formatter (>= 0.0.3)
screengrab (0.5.2)
fastlane_core (>= 0.50.3, < 1.0.0)
security (0.1.3)
sigh (1.11.1)
fastlane_core (>= 0.52.0, < 1.0.0)
plist (~> 3.1)
spaceship (>= 0.33.0, < 1.0.0)
signet (0.7.3)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (~> 1.5)
multi_json (~> 1.10)
slack-notifier (1.5.1)
snapshot (1.16.0)
fastimage (~> 1.6.3)
fastlane_core (>= 0.52.0, < 1.0.0)
plist (~> 3.1.0)
xcpretty (>= 0.2.1)
spaceship (0.33.0)
colored
credentials_manager (>= 0.16.0)
faraday (~> 0.9)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.9)
fastimage (~> 1.6)
multi_xml (~> 0.5)
plist (~> 3.1)
supply (0.7.1)
credentials_manager (>= 0.15.0)
fastlane_core (>= 0.43.4)
google-api-client (~> 0.9.1)
terminal-notifier (1.6.3)
terminal-table (1.4.5)
thread_safe (0.3.5)
tzinfo (1.2.2)
netrc (0.11.0)
rouge (2.0.7)
ruby-macho (1.3.1)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uber (0.0.15)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
word_wrap (1.0.0)
xcode-install (2.0.6)
claide (>= 0.9.1, < 1.1.0)
spaceship (>= 0.25.1, < 1.0.0)
xcodeproj (1.3.1)
activesupport (>= 3)
claide (>= 1.0.0, < 2.0)
colored (~> 1.2)
xcpretty (0.2.2)
rouge (~> 1.8)
xcpretty-travis-formatter (0.0.4)
xcodeproj (1.7.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.6)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)

PLATFORMS
ruby

DEPENDENCIES
cocoapods
fastlane
cocoapods (~> 1.6.0.beta.2)
xcpretty
xcpretty-travis-formatter

BUNDLED WITH
1.12.5
1.16.6
Loading

0 comments on commit c3cd019

Please sign in to comment.