roda 3.109.0 → 3.110.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/lib/roda/cache.rb +0 -2
- data/lib/roda/opts.rb +1 -1
- data/lib/roda/plugins/_symbol_class_matchers.rb +2 -4
- data/lib/roda/plugins/additional_view_directories.rb +2 -2
- data/lib/roda/plugins/assets.rb +173 -142
- data/lib/roda/plugins/assets_preloading.rb +26 -10
- data/lib/roda/plugins/backtracking_array.rb +2 -2
- data/lib/roda/plugins/branch_locals.rb +4 -4
- data/lib/roda/plugins/break.rb +2 -2
- data/lib/roda/plugins/caching.rb +27 -17
- data/lib/roda/plugins/capture_erb.rb +15 -12
- data/lib/roda/plugins/chunked.rb +32 -30
- data/lib/roda/plugins/class_level_routing.rb +5 -2
- data/lib/roda/plugins/class_matchers.rb +11 -6
- data/lib/roda/plugins/common_logger.rb +21 -3
- data/lib/roda/plugins/conditional_sessions.rb +3 -3
- data/lib/roda/plugins/content_for.rb +7 -6
- data/lib/roda/plugins/content_security_policy.rb +11 -12
- data/lib/roda/plugins/cookie_flags.rb +12 -6
- data/lib/roda/plugins/cookies.rb +7 -5
- data/lib/roda/plugins/csrf.rb +2 -1
- data/lib/roda/plugins/custom_block_results.rb +6 -7
- data/lib/roda/plugins/default_headers.rb +2 -2
- data/lib/roda/plugins/delay_build.rb +1 -1
- data/lib/roda/plugins/delegate.rb +7 -6
- data/lib/roda/plugins/direct_call.rb +5 -1
- data/lib/roda/plugins/disallow_file_uploads.rb +2 -3
- data/lib/roda/plugins/drop_body.rb +3 -6
- data/lib/roda/plugins/each_part.rb +4 -6
- data/lib/roda/plugins/early_hints.rb +4 -4
- data/lib/roda/plugins/empty_root.rb +5 -5
- data/lib/roda/plugins/environments.rb +8 -8
- data/lib/roda/plugins/erb_h.rb +4 -4
- data/lib/roda/plugins/error_email.rb +16 -17
- data/lib/roda/plugins/error_handler.rb +24 -32
- data/lib/roda/plugins/error_mail.rb +26 -15
- data/lib/roda/plugins/exception_page.rb +41 -35
- data/lib/roda/plugins/filter_common_logger.rb +6 -4
- data/lib/roda/plugins/flash.rb +16 -13
- data/lib/roda/plugins/freeze_request_response.rb +24 -0
- data/lib/roda/plugins/hash_routes.rb +1 -1
- data/lib/roda/plugins/permissions_policy.rb +14 -16
- data/lib/roda/plugins/public.rb +11 -0
- data/lib/roda/plugins/recheck_precompiled_assets.rb +30 -8
- data/lib/roda/plugins/render.rb +3 -0
- data/lib/roda/plugins/render_locals.rb +1 -1
- data/lib/roda/plugins/sessions.rb +158 -137
- data/lib/roda/plugins/symbol_matchers.rb +8 -5
- data/lib/roda/plugins/unescape_path.rb +22 -4
- data/lib/roda/plugins.rb +24 -0
- data/lib/roda/request.rb +8 -7
- data/lib/roda/response.rb +9 -7
- data/lib/roda/version.rb +1 -1
- data/lib/roda.rb +12 -9
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8c250a96cd296885c7195c790048bd57e1c679cc73b412a7b360a50dd45082d
|
|
4
|
+
data.tar.gz: a07ad795f01660d62a1853da0151f845f0c12c2d5593437d936cba913226c745
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c5fa7733dd8b99d5652520911af3fb8987751bb353761b6f8635a7fcc2a5e5ce8af40532778cb065ffd31b116a2f86c0cf3a281d1a7b90169480a3ab64ad199
|
|
7
|
+
data.tar.gz: b5f2686179b495755d3b6caa9e2da384e5709421b7e99cb9c1172e4726f6ced14def40ed498cdaa044c957b206c7be72ba6d42f3705807dea32716bed702964f
|
data/lib/roda/cache.rb
CHANGED
data/lib/roda/opts.rb
CHANGED
|
@@ -12,7 +12,7 @@ class Roda
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
# Set an <tt>@opt_*</tt> instance variable in the Roda class if it is tied
|
|
15
|
-
# to a Roda class.
|
|
15
|
+
# to a Roda class and the key is a symbol.
|
|
16
16
|
def []=(k, v)
|
|
17
17
|
super
|
|
18
18
|
@roda_class.instance_variable_set(:"@opt_#{k}", v) if @roda_class && Symbol === k
|
|
@@ -8,7 +8,7 @@ class Roda
|
|
|
8
8
|
private
|
|
9
9
|
|
|
10
10
|
# Backend of symbol_matcher and class_matcher.
|
|
11
|
-
def _symbol_class_matcher(expected_class, obj, matcher, block,
|
|
11
|
+
def _symbol_class_matcher(expected_class, obj, matcher, block, segment: nil, &request_class_block)
|
|
12
12
|
unless obj.is_a?(expected_class)
|
|
13
13
|
raise RodaError, "Invalid type passed to class_matcher or symbol_matcher: #{matcher.inspect}"
|
|
14
14
|
end
|
|
@@ -31,11 +31,9 @@ class Roda
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
regexp, consume_regexp, convert_meth, consume_meth = symbol_matchers[matcher]
|
|
34
|
-
|
|
35
34
|
unless regexp
|
|
36
35
|
raise RodaError, "unregistered symbol matcher given to #{type}_matcher: #{matcher.inspect}"
|
|
37
36
|
end
|
|
38
|
-
|
|
39
37
|
block = _merge_matcher_blocks(type, obj, block, convert_meth)
|
|
40
38
|
when Class
|
|
41
39
|
unless respond_to?(:class_matchers)
|
|
@@ -59,7 +57,7 @@ class Roda
|
|
|
59
57
|
private convert_meth
|
|
60
58
|
end
|
|
61
59
|
|
|
62
|
-
consume_meth ||=
|
|
60
|
+
consume_meth ||= segment ? :_consume_single_segment : :consume
|
|
63
61
|
array = (obj.is_a?(Symbol) ? symbol_matchers : class_matchers)[obj] = [regexp, consume_regexp, convert_meth, consume_meth].freeze
|
|
64
62
|
|
|
65
63
|
self::RodaRequest.class_exec do
|
|
@@ -13,7 +13,7 @@ class Roda
|
|
|
13
13
|
#
|
|
14
14
|
# Example:
|
|
15
15
|
#
|
|
16
|
-
# plugin :render, :
|
|
16
|
+
# plugin :render, views: 'dir'
|
|
17
17
|
# plugin :additional_view_directories, ['dir1', 'dir2', 'dir3']
|
|
18
18
|
#
|
|
19
19
|
# route do |r|
|
|
@@ -36,7 +36,7 @@ class Roda
|
|
|
36
36
|
# is also added as an allowed path.
|
|
37
37
|
def self.configure(app, view_dirs)
|
|
38
38
|
view_dirs = app.opts[:additional_view_directories] = view_dirs.map{|f| app.expand_path(f, nil)}.freeze
|
|
39
|
-
app.plugin :render, :allowed_paths=>(app.
|
|
39
|
+
app.plugin :render, :allowed_paths=>(app.render_opts[:allowed_paths] + view_dirs).uniq.freeze
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
module ClassMethods
|