roda 3.82.0 → 3.83.0

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
  SHA256:
3
- metadata.gz: bdf5797c96af1d28dc4d13f0c95ac0468d60eb30b6a128b2cee2c26a08eb0a7f
4
- data.tar.gz: d687b3cd03657bdcfda6f87a7a7a2a3b55e9a0c4f856cabd3d080865cc7d9ad2
3
+ metadata.gz: 8f3ad50e6de6bdfa7e2019cbcbe4a07b920a23adb30645616340b8bc007951a1
4
+ data.tar.gz: b5bd2835bb0f5286fb92555c602949482c4730b3497de4506a841a6ab3e80718
5
5
  SHA512:
6
- metadata.gz: e518b9638e98713ed54fd4c609069edf81a81987adf53ce2b7a09fa7110244f67b109cbe91c9c03d713f824900649d1c4b2ad435823852dcdfd01094f506afae
7
- data.tar.gz: '00877a1338b70a5b96dab7fb946e21c7c916c776666286f80251b362e29ca6e040ffeb9b7a7258cf3af4c9246de5a6c35c5332385bd3cb926505776102c9112c'
6
+ metadata.gz: 8e6937b542ae838a0b4e79171936fc3cd937faf127900b34265ff9e0923144bf5cf25879fe0103b43b51fb9c940e1dfc6c058f91eb02bab23177369e3b0424f7
7
+ data.tar.gz: d7515ac6becbb47900713e5349b52eb41e284391c5a75743b4e3adcb3609a8ad09a20b8e38e7d85ddb59c52681396a9ec2b1b82b3264752731837b873907835d
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ = 3.83.0 (2024-08-12)
2
+
3
+ * Add assume_ssl plugin for making request ssl? method always return true (jeremyevans)
4
+
1
5
  = 3.82.0 (2024-07-12)
2
6
 
3
7
  * Add :encodings option to public plugin to support configurable encoding order (jeremyevans)
@@ -0,0 +1,6 @@
1
+ = New Features
2
+
3
+ * An assume_ssl plugin has been added. This plugin is designed for
4
+ cases where the application is being fronted by an SSL-terminating
5
+ reverse proxy that does not set the X-Forwarded-Proto or similar
6
+ header to indicate it is forwarding an SSL request.
@@ -0,0 +1,28 @@
1
+ # frozen-string-literal: true
2
+
3
+ #
4
+ class Roda
5
+ module RodaPlugins
6
+ # The assume_ssl plugin makes the request ssl? method always return
7
+ # true. This is useful when using an SSL-terminating reverse proxy
8
+ # that doesn't set the X-Forwarded-Proto or similar header to notify
9
+ # Rack that it is forwarding an SSL request.
10
+ #
11
+ # The sessions and sinatra_helpers plugins that ship with Roda both
12
+ # use the ssl? method internally and can be affected by use of the
13
+ # plugin. It's recommended that you use this plugin if you are
14
+ # using either plugin and an SSL-terminating proxy as described above.
15
+ #
16
+ # plugin :assume_ssl
17
+ module AssumeSSL
18
+ module RequestMethods
19
+ # Assume all requests are protected by SSL.
20
+ def ssl?
21
+ true
22
+ end
23
+ end
24
+ end
25
+
26
+ register_plugin(:assume_ssl, AssumeSSL)
27
+ end
28
+ end
@@ -21,7 +21,7 @@ class Roda
21
21
  # font: 'assets/fonts',
22
22
  # form: 'static/forms/pdfs'
23
23
  #
24
- # r.route do
24
+ # route do
25
25
  # r.on "images" do
26
26
  # r.multi_public(:img)
27
27
  # end
@@ -43,7 +43,7 @@ class Roda
43
43
  # 'fonts' => 'assets/fonts',
44
44
  # 'forms' => 'static/forms/pdfs'
45
45
  #
46
- # r.route do
46
+ # route do
47
47
  # r.on %w"images fonts forms" do |dir|
48
48
  # r.multi_public(dir)
49
49
  # end
@@ -58,7 +58,7 @@ class Roda
58
58
  # 'fonts' => ['assets/fonts', {'Cache-Control'=>'max-age=31536000'}, 'font/ttf'],
59
59
  # 'forms' => ['static/forms/pdfs', nil, 'application/pdf']
60
60
  #
61
- # r.route do
61
+ # route do
62
62
  # r.on %w"images fonts forms" do |dir|
63
63
  # r.multi_public(dir)
64
64
  # end
@@ -31,7 +31,7 @@ class Roda
31
31
  # plugin :public, root: 'static'
32
32
  #
33
33
  # # Assuming public is the location of files
34
- # r.route do
34
+ # route do
35
35
  # # Make GET /images/foo.png look for public/images/foo.png
36
36
  # r.public
37
37
  #
@@ -25,7 +25,7 @@ class Roda
25
25
  # plugin :public, root: 'static', prefix: 'public'
26
26
  #
27
27
  # # Assuming public is the location of files, and static is the path prefix
28
- # r.route do
28
+ # route do
29
29
  # # Make GET /static/1238099123/images/foo.png look for public/images/foo.png
30
30
  # r.timestamp_public
31
31
  #
@@ -735,7 +735,7 @@ class Roda
735
735
  # You can use +dig+ to get access to nested arrays by using <tt>:array</tt> or <tt>:array!</tt> as
736
736
  # the first argument and providing the type in the second argument:
737
737
  #
738
- # tp.dig(:array, :pos_int, 'foo', 'bar', 'baz') # tp['foo']['bar'].array(:int, 'baz')
738
+ # tp.dig(:array, :pos_int, 'foo', 'bar', 'baz') # tp['foo']['bar'].array(:pos_int, 'baz')
739
739
  def dig(type, *nest, key)
740
740
  _dig(false, type, nest, key)
741
741
  end
data/lib/roda/version.rb CHANGED
@@ -4,7 +4,7 @@ class Roda
4
4
  RodaMajorVersion = 3
5
5
 
6
6
  # The minor version of Roda, updated for new feature releases of Roda.
7
- RodaMinorVersion = 82
7
+ RodaMinorVersion = 83
8
8
 
9
9
  # The patch version of Roda, updated only for bug fixes from the last
10
10
  # feature release.
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.82.0
4
+ version: 3.83.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: 2024-07-12 00:00:00.000000000 Z
11
+ date: 2024-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -243,6 +243,7 @@ extra_rdoc_files:
243
243
  - doc/release_notes/3.80.0.txt
244
244
  - doc/release_notes/3.81.0.txt
245
245
  - doc/release_notes/3.82.0.txt
246
+ - doc/release_notes/3.83.0.txt
246
247
  - doc/release_notes/3.9.0.txt
247
248
  files:
248
249
  - CHANGELOG
@@ -332,6 +333,7 @@ files:
332
333
  - doc/release_notes/3.80.0.txt
333
334
  - doc/release_notes/3.81.0.txt
334
335
  - doc/release_notes/3.82.0.txt
336
+ - doc/release_notes/3.83.0.txt
335
337
  - doc/release_notes/3.9.0.txt
336
338
  - lib/roda.rb
337
339
  - lib/roda/cache.rb
@@ -347,6 +349,7 @@ files:
347
349
  - lib/roda/plugins/all_verbs.rb
348
350
  - lib/roda/plugins/assets.rb
349
351
  - lib/roda/plugins/assets_preloading.rb
352
+ - lib/roda/plugins/assume_ssl.rb
350
353
  - lib/roda/plugins/autoload_hash_branches.rb
351
354
  - lib/roda/plugins/autoload_named_routes.rb
352
355
  - lib/roda/plugins/backtracking_array.rb