roda 3.29.0 → 3.30.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 +1 -1
- data/doc/release_notes/3.30.0.txt +14 -0
- data/lib/roda/plugins/assets.rb +14 -1
- data/lib/roda/plugins/exception_page.rb +2 -4
- data/lib/roda/plugins/header_matchers.rb +5 -1
- data/lib/roda/plugins/run_append_slash.rb +1 -1
- data/lib/roda/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40d384d8a60174df9dcfdb645c5bf607232c44012827659d06691561666d2a74
|
4
|
+
data.tar.gz: 7f8cfedfb18a5125be0cbc7bb77cd60b45f2f869717ae163c9779be3bc054264
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5619d3e9ac99a426662057ba932ae8477d251e8252710f9fce7b33ffb5ccaec45673c3b933906d71e45ec1b4be6444467d5d7ad3be04df6123b66e19432ea4f
|
7
|
+
data.tar.gz: 0da11db1409e19bf6a11b5c2f9e88da573b9e00175de4bf753da1fab2d4877a1ef84013a5194d349237fbc362205efccbc03fd0b56ba800fc6e903583baf9cf1
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
= 3.30.0 (2020-03-13)
|
2
|
+
|
3
|
+
* Support :relative_paths assets plugin option to use relative paths for the assets (jeremyevans)
|
4
|
+
|
5
|
+
* Make run_append_slash and run_handler plugins work when used together (janko) (#185)
|
6
|
+
|
7
|
+
* Make :header matcher in header_matchers plugin work for Content-Type and Content-Length (jeremyevans) (#184)
|
8
|
+
|
1
9
|
= 3.29.0 (2020-02-14)
|
2
10
|
|
3
11
|
* Remove specs and old release notes from the gem to reduce gem size by over 35% (jeremyevans)
|
data/README.rdoc
CHANGED
@@ -1107,7 +1107,7 @@ Roda's plugin system is based on the plugin system used by
|
|
1107
1107
|
|
1108
1108
|
Roda fully supports the currently supported versions of Ruby (MRI) and JRuby. It may
|
1109
1109
|
support unsupported versions of Ruby or JRuby, but such support may be dropped in any
|
1110
|
-
minor version
|
1110
|
+
minor version if keeping it becomes a support issue. The minimum Ruby version
|
1111
1111
|
required to run the current version of Roda is 1.9.2.
|
1112
1112
|
|
1113
1113
|
== License
|
@@ -0,0 +1,14 @@
|
|
1
|
+
= New Features
|
2
|
+
|
3
|
+
* A :relative_paths plugin option has been added to the assets
|
4
|
+
plugin. This option makes the paths to the asset files in the
|
5
|
+
link and script tags relative paths instead of absolute paths.
|
6
|
+
|
7
|
+
= Other Improvements
|
8
|
+
|
9
|
+
* The :header matcher in the header_matchers plugin now works
|
10
|
+
correctly for the Content-Type and Content-Length headers, which
|
11
|
+
are not prefixed with HTTP_ in the rack environment.
|
12
|
+
|
13
|
+
* The run_append_slash and run_handler plugins now work correctly
|
14
|
+
when used together.
|
data/lib/roda/plugins/assets.rb
CHANGED
@@ -291,6 +291,8 @@ class Roda
|
|
291
291
|
# non-compiled mode, but will write the metadata to the file if compile_assets is called.
|
292
292
|
# :public :: Path to your public folder, in which compiled files are placed (default: 'public'). Relative
|
293
293
|
# paths will be considered relative to the application's :root option.
|
294
|
+
# :relative_paths :: Use relative paths instead of absolute paths when setting up link and script tags for
|
295
|
+
# assets.
|
294
296
|
# :sri :: Enables subresource integrity when setting up references to compiled assets. The value should be
|
295
297
|
# :sha256, :sha384, or :sha512 depending on which hash algorithm you want to use. This changes the
|
296
298
|
# hash algorithm that Roda will use when naming compiled asset files. The default is :sha256, you
|
@@ -621,8 +623,10 @@ class Roda
|
|
621
623
|
stype = ltype.to_s
|
622
624
|
|
623
625
|
url_prefix = request.script_name if self.class.opts[:add_script_name]
|
626
|
+
relative_paths = o[:relative_paths]
|
624
627
|
|
625
|
-
if o[:compiled]
|
628
|
+
paths = if o[:compiled]
|
629
|
+
relative_paths = false if o[:compiled_asset_host]
|
626
630
|
if ukey = _compiled_assets_hash(type, true)
|
627
631
|
["#{o[:compiled_asset_host]}#{url_prefix}/#{o[:"compiled_#{stype}_prefix"]}.#{ukey}.#{stype}"]
|
628
632
|
else
|
@@ -642,6 +646,15 @@ class Roda
|
|
642
646
|
"#{url_prefix}/#{o[:"#{stype}_prefix"]}#{mtime}#{prefix}#{f}#{o[:"#{stype}_suffix"]}"
|
643
647
|
end
|
644
648
|
end
|
649
|
+
|
650
|
+
if relative_paths && (slash_count = request.path.count('/')) >= 1
|
651
|
+
relative_prefix = "../" * (slash_count - 1)
|
652
|
+
paths.map! do |path|
|
653
|
+
"#{relative_prefix}#{path.slice(1,100000000)}"
|
654
|
+
end
|
655
|
+
end
|
656
|
+
|
657
|
+
paths
|
645
658
|
end
|
646
659
|
|
647
660
|
# Return a string containing html tags for the given asset type.
|
@@ -244,10 +244,10 @@ END
|
|
244
244
|
|
245
245
|
frames = exception.backtrace.map.with_index do |line, i|
|
246
246
|
frame = {:id=>i}
|
247
|
-
if line =~
|
247
|
+
if line =~ /\A(.*?):(\d+)(?::in `(.*)')?\Z/
|
248
248
|
filename = frame[:filename] = $1
|
249
249
|
lineno = frame[:lineno] = $2.to_i
|
250
|
-
frame[:function] = $
|
250
|
+
frame[:function] = $3
|
251
251
|
|
252
252
|
begin
|
253
253
|
lineno -= 1
|
@@ -261,8 +261,6 @@ END
|
|
261
261
|
end
|
262
262
|
|
263
263
|
frame
|
264
|
-
else
|
265
|
-
nil
|
266
264
|
end
|
267
265
|
end.compact
|
268
266
|
|
@@ -51,7 +51,11 @@ class Roda
|
|
51
51
|
|
52
52
|
# Match if the given uppercase key is present inside the environment.
|
53
53
|
def match_header(key)
|
54
|
-
|
54
|
+
key = key.upcase.tr("-","_")
|
55
|
+
unless key == "CONTENT_TYPE" || key == "CONTENT_LENGTH"
|
56
|
+
key = "HTTP_#{key}"
|
57
|
+
end
|
58
|
+
if v = @env[key]
|
55
59
|
@captures << v
|
56
60
|
end
|
57
61
|
end
|
@@ -33,7 +33,7 @@ class Roda
|
|
33
33
|
# does not contain a trailing slash, a trailing slash is appended to the
|
34
34
|
# path internally, or a redirect is issued when configured with
|
35
35
|
# <tt>use_redirects: true</tt>.
|
36
|
-
def run(
|
36
|
+
def run(*)
|
37
37
|
if remaining_path.empty?
|
38
38
|
if scope.opts[:run_append_slash_redirect]
|
39
39
|
redirect("#{path}/")
|
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.30.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: 2020-
|
11
|
+
date: 2020-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -205,6 +205,7 @@ extra_rdoc_files:
|
|
205
205
|
- doc/release_notes/3.27.0.txt
|
206
206
|
- doc/release_notes/3.28.0.txt
|
207
207
|
- doc/release_notes/3.29.0.txt
|
208
|
+
- doc/release_notes/3.30.0.txt
|
208
209
|
files:
|
209
210
|
- CHANGELOG
|
210
211
|
- MIT-LICENSE
|
@@ -235,6 +236,7 @@ files:
|
|
235
236
|
- doc/release_notes/3.28.0.txt
|
236
237
|
- doc/release_notes/3.29.0.txt
|
237
238
|
- doc/release_notes/3.3.0.txt
|
239
|
+
- doc/release_notes/3.30.0.txt
|
238
240
|
- doc/release_notes/3.4.0.txt
|
239
241
|
- doc/release_notes/3.5.0.txt
|
240
242
|
- doc/release_notes/3.6.0.txt
|