roda 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 325e660f0581837d20d346159eea1be6a7363c9c
4
- data.tar.gz: eb99e9f1843f9959ae80a7b44900476b749f734f
3
+ metadata.gz: 7a139a3dab3d487524df22c5c49bb8a197bfa007
4
+ data.tar.gz: cc37453529b96bceb43bae2228175cfcd5249195
5
5
  SHA512:
6
- metadata.gz: 5bb3a46ed33cf4086c2d911be08817d60ba7ae522c23ad773824d6938fb6b2ab5bca7c15ce3dfa47a14d6364b37a65b96e29e23fc24b312b8c17d070e39241ac
7
- data.tar.gz: 705cbd16aeae28277012f7597f926156b8c825988d167c1cfaf36f2f8c263f6f81c2fe644587dede273cf5e4b9197897eb58a12b6027fadf832198f46b18d083
6
+ metadata.gz: 465573ac1586a9f64028c73d922593c5e631818e3b82ec6e0e916290ed52d4a90de69418d57ab536e3714882dacfb7a6a66499649744b3c752cfdb44caa05a82
7
+ data.tar.gz: 32e20c99866c50db2010091e785569e3aa68bb303ce6471be3e2057d37b80d6114bb3d5f889859554f96d3a18b53e24c77e83297301c529083acee2093dec581
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ = 2.5.1 (2015-08-13)
2
+
3
+ * Allow multi_route and middleware plugins to work together (janko-m) (#36)
4
+
1
5
  = 2.5.0 (2015-07-14)
2
6
 
3
7
  * Make :by_name option to path plugin default to true in development (jeremyevans)
@@ -0,0 +1,4 @@
1
+ = Improvements
2
+
3
+ * The multi_route plugin now works correctly if the middleware plugin
4
+ is loaded after it.
@@ -166,7 +166,7 @@ class Roda
166
166
  # Roda.plugin PluginModule
167
167
  # Roda.plugin :csrf
168
168
  def plugin(plugin, *args, &block)
169
- raise RodaError, "Cannot subclass a frozen Roda class" if frozen?
169
+ raise RodaError, "Cannot add a plugin to a frozen Roda class" if frozen?
170
170
  plugin = RodaPlugins.load_plugin(plugin) if plugin.is_a?(Symbol)
171
171
  plugin.load_dependencies(self, *args, &block) if plugin.respond_to?(:load_dependencies)
172
172
  include(plugin::InstanceMethods) if defined?(plugin::InstanceMethods)
@@ -74,7 +74,7 @@ class Roda
74
74
 
75
75
  # Override the route block so that if no route matches, we throw so
76
76
  # that the next middleware is called.
77
- def route(&block)
77
+ def route(*args, &block)
78
78
  super do |r|
79
79
  res = instance_exec(r, &block)
80
80
  throw :next, true if r.forward_next
@@ -19,7 +19,7 @@ class Roda
19
19
  # path Baz do |baz, *paths|
20
20
  # "/baz/#{baz.id}/#{paths.join('/')}"
21
21
  # end
22
- # path Quux |quux, path|
22
+ # path Quux do |quux, path|
23
23
  # "/quux/#{quux.id}/#{path}"
24
24
  # end
25
25
  #
@@ -8,7 +8,7 @@ class Roda
8
8
 
9
9
  # The patch version of Roda, updated only for bug fixes from the last
10
10
  # feature release.
11
- RodaPatchVersion = 0
11
+ RodaPatchVersion = 1
12
12
 
13
13
  # The full version of Roda as a string.
14
14
  RodaVersion = "#{RodaMajorVersion}.#{RodaMinorVersion}.#{RodaPatchVersion}".freeze
@@ -56,4 +56,23 @@ describe "middleware plugin" do
56
56
  end
57
57
  body.must_equal 'a'
58
58
  end
59
+
60
+ it "is compatible with the multi_route plugin" do
61
+ app(:bare) do
62
+ plugin :multi_route
63
+ plugin :middleware
64
+
65
+ route("a") do |r|
66
+ r.is "b" do
67
+ "ab"
68
+ end
69
+ end
70
+
71
+ route do |r|
72
+ r.multi_route
73
+ end
74
+ end
75
+
76
+ body('/a/b').must_equal 'ab'
77
+ end
59
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -142,6 +142,7 @@ extra_rdoc_files:
142
142
  - doc/release_notes/2.3.0.txt
143
143
  - doc/release_notes/2.4.0.txt
144
144
  - doc/release_notes/2.5.0.txt
145
+ - doc/release_notes/2.5.1.txt
145
146
  files:
146
147
  - CHANGELOG
147
148
  - MIT-LICENSE
@@ -158,6 +159,7 @@ files:
158
159
  - doc/release_notes/2.3.0.txt
159
160
  - doc/release_notes/2.4.0.txt
160
161
  - doc/release_notes/2.5.0.txt
162
+ - doc/release_notes/2.5.1.txt
161
163
  - lib/roda.rb
162
164
  - lib/roda/plugins/_erubis_escaping.rb
163
165
  - lib/roda/plugins/all_verbs.rb