roda 3.50.0 → 3.51.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG +8 -0
- data/README.rdoc +2 -1
- data/doc/release_notes/3.51.0.txt +20 -0
- data/lib/roda/plugins/error_handler.rb +1 -0
- data/lib/roda/plugins/multi_run.rb +9 -2
- data/lib/roda/plugins/named_routes.rb +10 -2
- data/lib/roda/plugins/path.rb +2 -2
- data/lib/roda/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f935481900b15707f29c41122e9ba1101e4a1bb7b6e53ef6c7819f8e0113fb23
|
|
4
|
+
data.tar.gz: 3f4938ea16d81085a0b9ee365f1cc8d317fbafd06674f1cf0e8dda37b70f3b05
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 00b35a151be77f3ed93ee0b664ce2b77162b1f14c02194e0228ec99969194c54c4ca0ddd538e0eb8bfcb4109ea6712428b554da06d69e572aaffa4d854e76559
|
|
7
|
+
data.tar.gz: ceb138da62c24fa2a3be1a57eda9187190f96b974483719894e0368ad47402258123d651403b373c09ff801d816cae2d0f9c88dcf154e2226fba4a864b9ed64d
|
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
= 3.51.0 (2021-12-15)
|
|
2
|
+
|
|
3
|
+
* Avoid method redefinition warning in error_handler plugin in verbose warning mode (jeremyevans)
|
|
4
|
+
|
|
5
|
+
* Allow run in multi_run plugin to be called without an app to remove existing handler (jeremyevans)
|
|
6
|
+
|
|
7
|
+
* Allow route in named_routes plugin to be called without a block to remove existing handler (jeremyevans)
|
|
8
|
+
|
|
1
9
|
= 3.50.0 (2021-11-12)
|
|
2
10
|
|
|
3
11
|
* Add capture_erb plugin for capturing ERB template blocks, instead of injecting them into the template output (jeremyevans)
|
data/README.rdoc
CHANGED
|
@@ -12,7 +12,8 @@ maintainable web applications in ruby.
|
|
|
12
12
|
Website :: http://roda.jeremyevans.net
|
|
13
13
|
Source :: http://github.com/jeremyevans/roda
|
|
14
14
|
Bugs :: http://github.com/jeremyevans/roda/issues
|
|
15
|
-
|
|
15
|
+
Discussion Forum (GitHub Discussions) :: https://github.com/jeremyevans/roda/discussions
|
|
16
|
+
Alternate Discussion Forum (Google Group) :: http://groups.google.com/group/ruby-roda
|
|
16
17
|
|
|
17
18
|
== Goals
|
|
18
19
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
= New Features
|
|
2
|
+
|
|
3
|
+
* The named_routes plugin now allows calling route without a block
|
|
4
|
+
to remove the existing route handler. The multi_run plugin
|
|
5
|
+
now allows calling run without an app to remove an existing handler.
|
|
6
|
+
These changes are designed to better support code reloading
|
|
7
|
+
libraries, so that if the related file is deleted, the related
|
|
8
|
+
handlers are also removed, without having to reload the entire
|
|
9
|
+
application.
|
|
10
|
+
|
|
11
|
+
= Other Improvements
|
|
12
|
+
|
|
13
|
+
* The error_handler plugin now avoids a method redefinition warning
|
|
14
|
+
in verbose warning mode.
|
|
15
|
+
|
|
16
|
+
= Other
|
|
17
|
+
|
|
18
|
+
* Roda's primary discussion forum is now GitHub Discussions. The
|
|
19
|
+
ruby-roda Google Group is still available for users who would
|
|
20
|
+
prefer to use that instead.
|
|
@@ -45,6 +45,9 @@ class Roda
|
|
|
45
45
|
# subtrees, multi_run is a better approach, but it does not let you set instance
|
|
46
46
|
# variables in the main Roda app and have those instance variables usable in
|
|
47
47
|
# the routing subtrees.
|
|
48
|
+
#
|
|
49
|
+
# To handle development environments that reload code, you can call the
|
|
50
|
+
# +run+ class method without an app to remove dispatching for the prefix.
|
|
48
51
|
module MultiRun
|
|
49
52
|
# Initialize the storage for the dispatched applications
|
|
50
53
|
def self.configure(app)
|
|
@@ -67,8 +70,12 @@ class Roda
|
|
|
67
70
|
|
|
68
71
|
# Add a rack application to dispatch to for the given prefix when
|
|
69
72
|
# r.multi_run is called.
|
|
70
|
-
def run(prefix, app)
|
|
71
|
-
|
|
73
|
+
def run(prefix, app=nil)
|
|
74
|
+
if app
|
|
75
|
+
multi_run_apps[prefix.to_s] = app
|
|
76
|
+
else
|
|
77
|
+
multi_run_apps.delete(prefix.to_s)
|
|
78
|
+
end
|
|
72
79
|
self::RodaRequest.refresh_multi_run_regexp!
|
|
73
80
|
end
|
|
74
81
|
end
|
|
@@ -38,6 +38,9 @@ class Roda
|
|
|
38
38
|
# Note that in multi-threaded code, you should not attempt to add a
|
|
39
39
|
# named route after accepting requests.
|
|
40
40
|
#
|
|
41
|
+
# To handle development environments that reload code, you can call the
|
|
42
|
+
# +route+ class method without a block to remove an existing named route.
|
|
43
|
+
#
|
|
41
44
|
# == Routing Files
|
|
42
45
|
#
|
|
43
46
|
# The convention when using the named_routes plugin is to have a single
|
|
@@ -124,7 +127,7 @@ class Roda
|
|
|
124
127
|
# The names for the currently stored named routes
|
|
125
128
|
def named_routes(namespace=nil)
|
|
126
129
|
unless routes = opts[:namespaced_routes][namespace]
|
|
127
|
-
raise RodaError, "unsupported
|
|
130
|
+
raise RodaError, "unsupported named_routes namespace used: #{namespace.inspect}"
|
|
128
131
|
end
|
|
129
132
|
routes.keys
|
|
130
133
|
end
|
|
@@ -140,7 +143,12 @@ class Roda
|
|
|
140
143
|
def route(name=nil, namespace=nil, &block)
|
|
141
144
|
if name
|
|
142
145
|
routes = opts[:namespaced_routes][namespace] ||= {}
|
|
143
|
-
|
|
146
|
+
if block
|
|
147
|
+
routes[name] = define_roda_method(routes[name] || "named_routes_#{namespace}_#{name}", 1, &convert_route_block(block))
|
|
148
|
+
elsif meth = routes[name]
|
|
149
|
+
routes.delete(name)
|
|
150
|
+
remove_method(meth)
|
|
151
|
+
end
|
|
144
152
|
else
|
|
145
153
|
super(&block)
|
|
146
154
|
end
|
data/lib/roda/plugins/path.rb
CHANGED
|
@@ -41,12 +41,12 @@ class Roda
|
|
|
41
41
|
# end
|
|
42
42
|
#
|
|
43
43
|
# r.post 'baz' do
|
|
44
|
-
#
|
|
44
|
+
# baz = Baz[1]
|
|
45
45
|
# r.redirect path(baz, 'c', 'd') # /baz/1/c/d
|
|
46
46
|
# end
|
|
47
47
|
#
|
|
48
48
|
# r.post 'quux' do
|
|
49
|
-
#
|
|
49
|
+
# quux = Quux[1]
|
|
50
50
|
# r.redirect url(quux, '/bar') # http://example.com/quux/1/bar
|
|
51
51
|
# end
|
|
52
52
|
# end
|
data/lib/roda/version.rb
CHANGED
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: 3.
|
|
4
|
+
version: 3.51.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeremy Evans
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-12-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|
|
@@ -222,6 +222,7 @@ extra_rdoc_files:
|
|
|
222
222
|
- doc/release_notes/3.49.0.txt
|
|
223
223
|
- doc/release_notes/3.5.0.txt
|
|
224
224
|
- doc/release_notes/3.50.0.txt
|
|
225
|
+
- doc/release_notes/3.51.0.txt
|
|
225
226
|
- doc/release_notes/3.6.0.txt
|
|
226
227
|
- doc/release_notes/3.7.0.txt
|
|
227
228
|
- doc/release_notes/3.8.0.txt
|
|
@@ -279,6 +280,7 @@ files:
|
|
|
279
280
|
- doc/release_notes/3.49.0.txt
|
|
280
281
|
- doc/release_notes/3.5.0.txt
|
|
281
282
|
- doc/release_notes/3.50.0.txt
|
|
283
|
+
- doc/release_notes/3.51.0.txt
|
|
282
284
|
- doc/release_notes/3.6.0.txt
|
|
283
285
|
- doc/release_notes/3.7.0.txt
|
|
284
286
|
- doc/release_notes/3.8.0.txt
|
|
@@ -406,7 +408,7 @@ metadata:
|
|
|
406
408
|
bug_tracker_uri: https://github.com/jeremyevans/roda/issues
|
|
407
409
|
changelog_uri: http://roda.jeremyevans.net/rdoc/files/CHANGELOG.html
|
|
408
410
|
documentation_uri: http://roda.jeremyevans.net/documentation.html
|
|
409
|
-
mailing_list_uri: https://
|
|
411
|
+
mailing_list_uri: https://github.com/jeremyevans/roda/discussions
|
|
410
412
|
source_code_uri: https://github.com/jeremyevans/roda
|
|
411
413
|
post_install_message:
|
|
412
414
|
rdoc_options: []
|
|
@@ -423,7 +425,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
423
425
|
- !ruby/object:Gem::Version
|
|
424
426
|
version: '0'
|
|
425
427
|
requirements: []
|
|
426
|
-
rubygems_version: 3.2.
|
|
428
|
+
rubygems_version: 3.2.32
|
|
427
429
|
signing_key:
|
|
428
430
|
specification_version: 4
|
|
429
431
|
summary: Routing tree web toolkit
|