syro 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -0
  3. data/lib/syro.rb +8 -0
  4. data/syro.gemspec +1 -1
  5. data/test/all.rb +10 -2
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4690d7f8db8b3a60d8023876ce3f91ae394d0118
4
- data.tar.gz: ea7381f9d29c75d8f7e9026775d09fd94b7e2306
3
+ metadata.gz: cb3f4305da6d5ee66e017bd8edd112ae30f98891
4
+ data.tar.gz: d7befe3d26ed52507decd6b340cabcac3a921e8f
5
5
  SHA512:
6
- metadata.gz: d3c0b0a23a6254f781018644bd0b6ff4b766538843e336ec19e2bea3b9965f452fcfdce7f5ddad98e8a75f5e7bd2230d42e2db469f98214ba8781c82d71e96fd
7
- data.tar.gz: cceb8fe051ee1b4a12988547e6c38bd63f10b60a477e8232592586111552b495ab4e92cacf0dbbb37bd83597501b7c8cfc32599c8816cfb675c714ca88830865
6
+ metadata.gz: 8f9fcc63c2f77c4090c9f1252d7ddff0a0b05f27fc3440e135b077f47729dcc38196907e04b3b8d53275824e19023e6212711c0186aea50aaac0f30868ba6dd0
7
+ data.tar.gz: 20d7b8cbd9b6ea83465151988d80793ea67880e33417de8ad706be4badbc33740de33aa1cc93a17eb2ccf69f52fa48158309198d8bdf54166ed14116e14ade9b
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.0.6
2
+
3
+ * Add put request method
4
+
1
5
  0.0.5
2
6
 
3
7
  * Add explicit Rack version dependency (@luislavena)
@@ -170,6 +170,14 @@ class Syro
170
170
  end
171
171
  end
172
172
 
173
+ def put
174
+ if root? && req.put?
175
+ yield
176
+
177
+ halt(res.finish)
178
+ end
179
+ end
180
+
173
181
  def post
174
182
  if root? && req.post?
175
183
  yield
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "syro"
3
- s.version = "0.0.5"
3
+ s.version = "0.0.6"
4
4
  s.summary = "Simple router"
5
5
  s.description = "Simple router for web applications"
6
6
  s.authors = ["Michel Martens"]
@@ -58,6 +58,10 @@ app = Syro.new {
58
58
  res.write("GET /foo/bar")
59
59
  }
60
60
 
61
+ put {
62
+ res.write("PUT /foo/bar")
63
+ }
64
+
61
65
  post {
62
66
  res.write("POST /foo/bar")
63
67
  }
@@ -134,14 +138,18 @@ test "path + verb" do |f|
134
138
  assert_equal 200, f.last_response.status
135
139
  assert_equal "GET /foo/bar", f.last_response.body
136
140
 
137
- f.patch("/foo/bar")
141
+ f.put("/foo/bar")
138
142
  assert_equal 200, f.last_response.status
139
- assert_equal "PATCH /foo/bar", f.last_response.body
143
+ assert_equal "PUT /foo/bar", f.last_response.body
140
144
 
141
145
  f.post("/foo/bar")
142
146
  assert_equal 200, f.last_response.status
143
147
  assert_equal "POST /foo/bar", f.last_response.body
144
148
 
149
+ f.patch("/foo/bar")
150
+ assert_equal 200, f.last_response.status
151
+ assert_equal "PATCH /foo/bar", f.last_response.body
152
+
145
153
  f.delete("/foo/bar")
146
154
  assert_equal 200, f.last_response.status
147
155
  assert_equal "DELETE /foo/bar", f.last_response.body
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
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-05-01 00:00:00.000000000 Z
11
+ date: 2015-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: seg