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 +4 -4
- data/CHANGELOG +4 -0
- data/doc/release_notes/2.5.1.txt +4 -0
- data/lib/roda.rb +1 -1
- data/lib/roda/plugins/middleware.rb +1 -1
- data/lib/roda/plugins/path.rb +1 -1
- data/lib/roda/version.rb +1 -1
- data/spec/plugin/middleware_spec.rb +19 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a139a3dab3d487524df22c5c49bb8a197bfa007
|
4
|
+
data.tar.gz: cc37453529b96bceb43bae2228175cfcd5249195
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 465573ac1586a9f64028c73d922593c5e631818e3b82ec6e0e916290ed52d4a90de69418d57ab536e3714882dacfb7a6a66499649744b3c752cfdb44caa05a82
|
7
|
+
data.tar.gz: 32e20c99866c50db2010091e785569e3aa68bb303ce6471be3e2057d37b80d6114bb3d5f889859554f96d3a18b53e24c77e83297301c529083acee2093dec581
|
data/CHANGELOG
CHANGED
data/lib/roda.rb
CHANGED
@@ -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
|
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
|
data/lib/roda/plugins/path.rb
CHANGED
data/lib/roda/version.rb
CHANGED
@@ -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 =
|
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.
|
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-
|
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
|