syro 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -0
  3. data/README.md +16 -3
  4. data/lib/syro.rb +6 -30
  5. data/syro.gemspec +1 -1
  6. metadata +14 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42c57c65ec35da48059c8844925b6baa1a3a3897
4
- data.tar.gz: cee94b2f71a5eeea0a07fee70d9d923d5720df7c
3
+ metadata.gz: 68e7e12639d6b627c7968f0b3490f5a910d43e5a
4
+ data.tar.gz: 8c81dc6869e463804f9162ee1e5bb2fb27596734
5
5
  SHA512:
6
- metadata.gz: 79191f17a6cb4b4bdf8c2b4a8456e59ec15f5cc1ac33911502117103ad122f3a492fb80b359e6990754b8a1cd049b50da0a2b813355fd869d8e88052922e7a4f
7
- data.tar.gz: 97ab83421c8cb0b3772404d91494f6e08389cc96d85542e4c1f355ac0bd2a9222654e530a7180902f184f4241b7085eaeee8ba6e05420d9420fe18b6b7103c54
6
+ metadata.gz: 0f971c4823ead5c999a91c29f473513dd03dcaafb6b31f090830c16f392fc86d4727cdca61400c0e82f81e4478877d841554a7cb567f209a6d139c9bfbcfe5c4
7
+ data.tar.gz: 444459d6f617d91775b880d2db7b1b0abfffc3b6da4646a3d5b8b129c8c2f6b5b447ba9c8180af35f2b506f49c4e83748fec47fe0c63a22d269caa539b436068
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 1.1.1
2
+
3
+ * Small internal refactoring
4
+
1
5
  1.1.0
2
6
 
3
7
  * Move Deck methods to the Deck::API module
data/README.md CHANGED
@@ -3,6 +3,12 @@ Syro
3
3
 
4
4
  Simple router for web applications.
5
5
 
6
+ Community
7
+ ---------
8
+
9
+ Meet us on IRC: [#syro](irc://chat.freenode.net/#syro) on
10
+ [freenode.net](http://freenode.net/).
11
+
6
12
  Description
7
13
  -----------
8
14
 
@@ -13,8 +19,13 @@ by the way some Cuba applications are architected: modularity is
13
19
  encouraged and sub-applications can be dispatched without any
14
20
  significant performance overhead.
15
21
 
22
+ Check the [website][syro] for more information, and follow the
23
+ [tutorial][tutorial] for a step by step introduction.
24
+
16
25
  [rum]: http://github.com/chneukirchen/rum
17
26
  [cuba]: http://cuba.is
27
+ [syro]: http://soveran.github.io/syro/
28
+ [tutorial]: http://files.soveran.com/syro/
18
29
 
19
30
  Usage
20
31
  -----
@@ -36,9 +47,9 @@ app = Syro.new {
36
47
  ```
37
48
 
38
49
  The block is evaluated in a sandbox where the following methods are
39
- available: `env`, `req`, `res`, `inbox`, `call`, `run`, `halt`,
40
- `match`, `on`, `root?`, `root`,`get`, `put`, `post`, `patch` and
41
- `delete`.
50
+ available: `env`, `req`, `res`, `path`, `inbox`, `call`, `run`,
51
+ `halt`, `match`, `on`, `root?`, `root`,`get`, `put`, `post`, `patch`
52
+ and `delete`.
42
53
 
43
54
  As a recommendation, user created variables should be instance
44
55
  variables. That way they won't mix with the API methods defined in
@@ -56,6 +67,8 @@ instance of `Rack::Request`.
56
67
  `res`: Helper object for creating the response. It's an instance
57
68
  of `Syro::Response`.
58
69
 
70
+ `path`: Helper object that tracks the previous and current path.
71
+
59
72
  `inbox`: Hash with captures and potentially other variables local
60
73
  to the request.
61
74
 
@@ -280,51 +280,27 @@ class Syro
280
280
  end
281
281
 
282
282
  def root
283
- if root?
284
- yield
285
-
286
- halt(res.finish)
287
- end
283
+ on(root?) { yield }
288
284
  end
289
285
 
290
286
  def get
291
- if root? && req.get?
292
- yield
293
-
294
- halt(res.finish)
295
- end
287
+ root { yield } if req.get?
296
288
  end
297
289
 
298
290
  def put
299
- if root? && req.put?
300
- yield
301
-
302
- halt(res.finish)
303
- end
291
+ root { yield } if req.put?
304
292
  end
305
293
 
306
294
  def post
307
- if root? && req.post?
308
- yield
309
-
310
- halt(res.finish)
311
- end
295
+ root { yield } if req.post?
312
296
  end
313
297
 
314
298
  def patch
315
- if root? && req.patch?
316
- yield
317
-
318
- halt(res.finish)
319
- end
299
+ root { yield } if req.patch?
320
300
  end
321
301
 
322
302
  def delete
323
- if root? && req.delete?
324
- yield
325
-
326
- halt(res.finish)
327
- end
303
+ root { yield } if req.delete?
328
304
  end
329
305
  end
330
306
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "syro"
3
- s.version = "1.1.0"
3
+ s.version = "1.1.1"
4
4
  s.summary = "Simple router"
5
5
  s.description = "Simple router for web applications"
6
6
  s.authors = ["Michel Martens"]
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Martens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-13 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: seg
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.6.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cutest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rack-test
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Simple router for web applications
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gems
76
+ - ".gems"
77
77
  - CHANGELOG
78
78
  - CONTRIBUTING
79
79
  - LICENSE
@@ -93,17 +93,17 @@ require_paths:
93
93
  - lib
94
94
  required_ruby_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.0.14
106
+ rubygems_version: 2.4.5.1
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Simple router