Skip to content

Commit c3cd019

Browse files
committed
reorganize
1 parent 258a098 commit c3cd019

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+529
-1656
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
language: objective-c
21
os: osx
3-
osx_image: xcode8
2+
osx_image: xcode10.1
3+
language: swift
44

55
env:
66
global:
@@ -14,7 +14,7 @@ before_install:
1414
- bundle install
1515

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

1919
after_success:
2020
- bash <(curl -s https://codecov.io/bash)

Demo.playground/Contents.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ let router = Router(defaultUnmatchHandler: defaultUnmatchHandler)
2929
//: Register patterns, the closure is the handle when matched the pattern.
3030

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

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

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

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

7171
// It can provide a custome unmatch handler to override the default, also can pass the context
72-
router.matchURLPathAndDoHandler(path2, context: "bar" as AnyObject?, unmatchHandler: customUnmatchHandler)
72+
router.match(urlPath: path2, context: "bar" as AnyObject?, unmatchHandler: customUnmatchHandler)

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
22

3-
gem 'fastlane'
4-
gem 'xcpretty'
5-
gem 'cocoapods'
3+
gem "xcpretty"
4+
gem "xcpretty-travis-formatter"
5+
gem "cocoapods", "~> 1.6.0.beta.2"

Gemfile.lock

Lines changed: 50 additions & 248 deletions
Original file line numberDiff line numberDiff line change
@@ -1,281 +1,83 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (4.2.7.1)
4+
CFPropertyList (3.0.0)
5+
activesupport (4.2.10)
56
i18n (~> 0.7)
6-
json (~> 1.7, >= 1.7.7)
77
minitest (~> 5.1)
88
thread_safe (~> 0.3, >= 0.3.4)
99
tzinfo (~> 1.1)
10-
addressable (2.4.0)
11-
babosa (1.0.2)
12-
cert (1.4.2)
13-
fastlane_core (>= 0.50.3, < 1.0.0)
14-
spaceship (>= 0.32.0, < 1.0.0)
15-
claide (1.0.0)
16-
cocoapods (1.0.1)
17-
activesupport (>= 4.0.2)
18-
claide (>= 1.0.0, < 2.0)
19-
cocoapods-core (= 1.0.1)
20-
cocoapods-deintegrate (>= 1.0.0, < 2.0)
21-
cocoapods-downloader (>= 1.0.0, < 2.0)
10+
atomos (0.1.3)
11+
claide (1.0.2)
12+
cocoapods (1.6.0.beta.2)
13+
activesupport (>= 4.0.2, < 5)
14+
claide (>= 1.0.2, < 2.0)
15+
cocoapods-core (= 1.6.0.beta.2)
16+
cocoapods-deintegrate (>= 1.0.2, < 2.0)
17+
cocoapods-downloader (>= 1.2.2, < 2.0)
2218
cocoapods-plugins (>= 1.0.0, < 2.0)
2319
cocoapods-search (>= 1.0.0, < 2.0)
2420
cocoapods-stats (>= 1.0.0, < 2.0)
25-
cocoapods-trunk (>= 1.0.0, < 2.0)
26-
cocoapods-try (>= 1.0.0, < 2.0)
27-
colored (~> 1.2)
21+
cocoapods-trunk (>= 1.3.1, < 2.0)
22+
cocoapods-try (>= 1.1.0, < 2.0)
23+
colored2 (~> 3.1)
2824
escape (~> 0.0.4)
29-
fourflusher (~> 0.3.0)
30-
molinillo (~> 0.4.5)
25+
fourflusher (~> 2.0.1)
26+
gh_inspector (~> 1.0)
27+
molinillo (~> 0.6.6)
3128
nap (~> 1.0)
32-
xcodeproj (>= 1.1.0, < 2.0)
33-
cocoapods-core (1.0.1)
34-
activesupport (>= 4.0.2)
29+
ruby-macho (~> 1.3, >= 1.3.1)
30+
xcodeproj (>= 1.7.0, < 2.0)
31+
cocoapods-core (1.6.0.beta.2)
32+
activesupport (>= 4.0.2, < 6)
3533
fuzzy_match (~> 2.0.4)
3634
nap (~> 1.0)
37-
cocoapods-deintegrate (1.0.1)
38-
cocoapods-downloader (1.1.1)
35+
cocoapods-deintegrate (1.0.2)
36+
cocoapods-downloader (1.2.2)
3937
cocoapods-plugins (1.0.0)
4038
nap
4139
cocoapods-search (1.0.0)
4240
cocoapods-stats (1.0.0)
43-
cocoapods-trunk (1.0.0)
41+
cocoapods-trunk (1.3.1)
4442
nap (>= 0.8, < 2.0)
45-
netrc (= 0.7.8)
43+
netrc (~> 0.11)
4644
cocoapods-try (1.1.0)
47-
colored (1.2)
48-
commander (4.4.0)
49-
highline (~> 1.7.2)
50-
credentials_manager (0.16.0)
51-
colored
52-
commander (>= 4.3.5)
53-
highline (>= 1.7.1)
54-
security
55-
deliver (1.13.3)
56-
credentials_manager (>= 0.16.0, < 1.0.0)
57-
fastimage (~> 1.6)
58-
fastlane_core (>= 0.50.3, < 1.0.0)
59-
plist (~> 3.1.0)
60-
spaceship (>= 0.31.6, < 1.0.0)
61-
domain_name (0.5.20160826)
62-
unf (>= 0.0.5, < 1.0.0)
63-
dotenv (2.1.1)
45+
colored2 (3.1.2)
46+
concurrent-ruby (1.1.3)
6447
escape (0.0.4)
65-
excon (0.45.4)
66-
faraday (0.9.2)
67-
multipart-post (>= 1.2, < 3)
68-
faraday-cookie_jar (0.0.6)
69-
faraday (>= 0.7.4)
70-
http-cookie (~> 1.0.0)
71-
faraday_middleware (0.10.0)
72-
faraday (>= 0.7.4, < 0.10)
73-
fastimage (1.6.8)
74-
addressable (~> 2.3, >= 2.3.5)
75-
fastlane (1.103.0)
76-
activesupport (< 5)
77-
addressable (~> 2.3)
78-
bundler (~> 1.12)
79-
cert (>= 1.4.1, < 2.0.0)
80-
credentials_manager (>= 0.16.0, < 1.0.0)
81-
deliver (>= 1.13.3, < 2.0.0)
82-
fastlane_core (>= 0.52.0, < 1.0.0)
83-
frameit (>= 2.7.0, < 3.0.0)
84-
gym (>= 1.7.0, < 2.0.0)
85-
krausefx-shenzhen (>= 0.14.10)
86-
match (>= 0.6.3, < 1.0.0)
87-
multipart-post (~> 2.0.0)
88-
pem (>= 1.3.2, < 2.0.0)
89-
pilot (>= 1.10.0, < 2.0.0)
90-
plist (~> 3.1.0)
91-
produce (>= 1.2.0, < 2.0.0)
92-
scan (>= 0.11.3, < 2.0.0)
93-
screengrab (>= 0.5.0, < 1.0.0)
94-
sigh (>= 1.10.2, < 2.0.0)
95-
slack-notifier (~> 1.3)
96-
snapshot (>= 1.14.0, < 2.0.0)
97-
spaceship (>= 0.32.1, < 1.0.0)
98-
supply (>= 0.7.0, < 1.0.0)
99-
terminal-notifier (~> 1.6.2)
100-
terminal-table (~> 1.4.5)
101-
word_wrap (~> 1.0.0)
102-
xcode-install (~> 2.0.0)
103-
xcodeproj (>= 0.20, < 2.0.0)
104-
xcpretty (>= 0.2.1)
105-
fastlane_core (0.52.0)
106-
babosa
107-
colored
108-
commander (>= 4.4.0, <= 5.0.0)
109-
credentials_manager (>= 0.16.0, < 1.0.0)
110-
excon (~> 0.45.0)
111-
gh_inspector (>= 1.0.1, < 2.0.0)
112-
highline (>= 1.7.2)
113-
json
114-
multi_json
115-
plist (~> 3.1)
116-
rubyzip (~> 1.1.6)
117-
terminal-table (~> 1.4.5)
118-
fourflusher (0.3.2)
119-
frameit (2.7.0)
120-
deliver (> 0.3)
121-
fastimage (~> 1.6.3)
122-
fastlane_core (>= 0.36.1, < 1.0.0)
123-
mini_magick (~> 4.5.1)
48+
fourflusher (2.0.1)
12449
fuzzy_match (2.0.4)
125-
gh_inspector (1.0.2)
126-
google-api-client (0.9.15)
127-
addressable (~> 2.3)
128-
googleauth (~> 0.5)
129-
httpclient (~> 2.7)
130-
hurley (~> 0.1)
131-
memoist (~> 0.11)
132-
mime-types (>= 1.6)
133-
representable (~> 2.3.0)
134-
retriable (~> 2.0)
135-
googleauth (0.5.1)
136-
faraday (~> 0.9)
137-
jwt (~> 1.4)
138-
logging (~> 2.0)
139-
memoist (~> 0.12)
140-
multi_json (~> 1.11)
141-
os (~> 0.9)
142-
signet (~> 0.7)
143-
gym (1.9.0)
144-
fastlane_core (>= 0.51.0, < 1.0.0)
145-
plist
146-
rubyzip (>= 1.1.7)
147-
terminal-table
148-
xcpretty (>= 0.2.1)
149-
highline (1.7.8)
150-
http-cookie (1.0.2)
151-
domain_name (~> 0.5)
152-
httpclient (2.8.2.4)
153-
hurley (0.2)
154-
i18n (0.7.0)
155-
json (1.8.3)
156-
jwt (1.5.6)
157-
krausefx-shenzhen (0.14.10)
158-
commander (>= 4.3, < 5.0)
159-
dotenv (>= 0.7)
160-
faraday (~> 0.9)
161-
faraday_middleware (~> 0.9)
162-
highline (>= 1.7.2)
163-
json (~> 1.8)
164-
net-sftp (~> 2.1.2)
165-
plist (~> 3.1.0)
166-
rubyzip (~> 1.1)
167-
security (~> 0.1.3)
168-
terminal-table (~> 1.4.5)
169-
little-plugger (1.1.4)
170-
logging (2.1.0)
171-
little-plugger (~> 1.1)
172-
multi_json (~> 1.10)
173-
match (0.8.0)
174-
cert (>= 1.4.2, < 2.0.0)
175-
credentials_manager (>= 0.16.0, < 1.0.0)
176-
fastlane_core (>= 0.52.0, < 1.0.0)
177-
security
178-
sigh (>= 1.11.0, < 2.0.0)
179-
spaceship (>= 0.33.0, < 1.0.0)
180-
memoist (0.15.0)
181-
mime-types (3.1)
182-
mime-types-data (~> 3.2015)
183-
mime-types-data (3.2016.0521)
184-
mini_magick (4.5.1)
185-
minitest (5.9.0)
186-
molinillo (0.4.5)
187-
multi_json (1.12.1)
188-
multi_xml (0.5.5)
189-
multipart-post (2.0.0)
50+
gh_inspector (1.1.3)
51+
i18n (0.9.5)
52+
concurrent-ruby (~> 1.0)
53+
minitest (5.11.3)
54+
molinillo (0.6.6)
55+
nanaimo (0.2.6)
19056
nap (1.1.0)
191-
net-sftp (2.1.2)
192-
net-ssh (>= 2.6.5)
193-
net-ssh (3.2.0)
194-
netrc (0.7.8)
195-
os (0.9.6)
196-
pem (1.3.2)
197-
fastlane_core (>= 0.43.1, < 1.0.0)
198-
spaceship (>= 0.26.2, < 1.0.0)
199-
pilot (1.10.0)
200-
credentials_manager (>= 0.3.0)
201-
fastlane_core (>= 0.46.2, < 1.0.0)
202-
spaceship (>= 0.29.0, < 1.0.0)
203-
terminal-table (~> 1.4.5)
204-
plist (3.1.0)
205-
produce (1.2.0)
206-
fastlane_core (>= 0.30.0, < 1.0.0)
207-
spaceship (>= 0.31.1, < 1.0.0)
208-
representable (2.3.0)
209-
uber (~> 0.0.7)
210-
retriable (2.1.0)
211-
rouge (1.11.1)
212-
rubyzip (1.1.7)
213-
scan (0.13.0)
214-
fastlane_core (>= 0.52.0, < 1.0.0)
215-
slack-notifier (~> 1.3)
216-
terminal-table
217-
xcpretty (>= 0.2.1)
218-
xcpretty-travis-formatter (>= 0.0.3)
219-
screengrab (0.5.2)
220-
fastlane_core (>= 0.50.3, < 1.0.0)
221-
security (0.1.3)
222-
sigh (1.11.1)
223-
fastlane_core (>= 0.52.0, < 1.0.0)
224-
plist (~> 3.1)
225-
spaceship (>= 0.33.0, < 1.0.0)
226-
signet (0.7.3)
227-
addressable (~> 2.3)
228-
faraday (~> 0.9)
229-
jwt (~> 1.5)
230-
multi_json (~> 1.10)
231-
slack-notifier (1.5.1)
232-
snapshot (1.16.0)
233-
fastimage (~> 1.6.3)
234-
fastlane_core (>= 0.52.0, < 1.0.0)
235-
plist (~> 3.1.0)
236-
xcpretty (>= 0.2.1)
237-
spaceship (0.33.0)
238-
colored
239-
credentials_manager (>= 0.16.0)
240-
faraday (~> 0.9)
241-
faraday-cookie_jar (~> 0.0.6)
242-
faraday_middleware (~> 0.9)
243-
fastimage (~> 1.6)
244-
multi_xml (~> 0.5)
245-
plist (~> 3.1)
246-
supply (0.7.1)
247-
credentials_manager (>= 0.15.0)
248-
fastlane_core (>= 0.43.4)
249-
google-api-client (~> 0.9.1)
250-
terminal-notifier (1.6.3)
251-
terminal-table (1.4.5)
252-
thread_safe (0.3.5)
253-
tzinfo (1.2.2)
57+
netrc (0.11.0)
58+
rouge (2.0.7)
59+
ruby-macho (1.3.1)
60+
thread_safe (0.3.6)
61+
tzinfo (1.2.5)
25462
thread_safe (~> 0.1)
255-
uber (0.0.15)
256-
unf (0.1.4)
257-
unf_ext
258-
unf_ext (0.0.7.2)
259-
word_wrap (1.0.0)
260-
xcode-install (2.0.6)
261-
claide (>= 0.9.1, < 1.1.0)
262-
spaceship (>= 0.25.1, < 1.0.0)
263-
xcodeproj (1.3.1)
264-
activesupport (>= 3)
265-
claide (>= 1.0.0, < 2.0)
266-
colored (~> 1.2)
267-
xcpretty (0.2.2)
268-
rouge (~> 1.8)
269-
xcpretty-travis-formatter (0.0.4)
63+
xcodeproj (1.7.0)
64+
CFPropertyList (>= 2.3.3, < 4.0)
65+
atomos (~> 0.1.3)
66+
claide (>= 1.0.2, < 2.0)
67+
colored2 (~> 3.1)
68+
nanaimo (~> 0.2.6)
69+
xcpretty (0.3.0)
70+
rouge (~> 2.0.7)
71+
xcpretty-travis-formatter (1.0.0)
27072
xcpretty (~> 0.2, >= 0.0.7)
27173

27274
PLATFORMS
27375
ruby
27476

27577
DEPENDENCIES
276-
cocoapods
277-
fastlane
78+
cocoapods (~> 1.6.0.beta.2)
27879
xcpretty
80+
xcpretty-travis-formatter
27981

28082
BUNDLED WITH
281-
1.12.5
83+
1.16.6

0 commit comments

Comments
 (0)