roda 3.98.0 → 3.99.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9be24f058ca3ba9ce75b21d49af505eb2bd1dbfc40b2bfc1841bcce1c02e100
4
- data.tar.gz: 1ee920f5d61b7fee7d049e0849a3fee48b3d926a141d16c4fe7ce58171b60fe3
3
+ metadata.gz: 26619fe3a0b256c2615c6be17f215919c73a804609f536a3ff9f8329f14e7f9b
4
+ data.tar.gz: 550f978b06bf82356bcbefedc9d00929073549c02cb118362212527f52a6336d
5
5
  SHA512:
6
- metadata.gz: 3a1d64641747146ee096ecc99cb2407b75d0f1182cb732a174721354248a762a4bb362a4fb19337725430941da079c87944b16d7cc1f72f8a5aa072eae3abdad
7
- data.tar.gz: d5e8e3f3b720c33c41cd17d953b96851abe6032974e665856aa5896e2b1c6d436eb67372464ce4f44e30eb471e512bfa7c692d7cfaac31944d8bfed60eb72bbd
6
+ metadata.gz: 244665571cdb2b400ced6494ab8210fbf12ab46b2fd799f35fd7373f675606c975b8fc7cc6a279532c8b76d9a981a339528b41567d022d353f763ee8028b4225
7
+ data.tar.gz: a30c5c61b21ff9c65c0cfdad17a1011039d44b57c498e7e833fec859a7ec6876d593eb53b950c56d6b7a8858f11e6e2edf6d3798db2288ccfa5b965be019bbe5
@@ -9,7 +9,7 @@ class Roda
9
9
  # dispatching to the application with an environment that would violate the
10
10
  # Rack SPEC.
11
11
  #
12
- # You are unlikely to want to use this plugin unless are consuming partial
12
+ # You are unlikely to want to use this plugin unless you are consuming partial
13
13
  # segments of the request path, or using the match_affix plugin to change
14
14
  # how routing is done:
15
15
  #
@@ -23,10 +23,10 @@ class Roda
23
23
  # end
24
24
  #
25
25
  # # with run_require_slash:
26
- # # GET /a/b/e => App not dispatched to
26
+ # # GET /a/b/e => Not dispatched to application
27
27
  # # GET /a/b => App gets "" as PATH_INFO
28
28
  #
29
- # # with run_require_slash:
29
+ # # without run_require_slash:
30
30
  # # GET /a/b/e => App gets "e" as PATH_INFO, violating rack SPEC
31
31
  # # GET /a/b => App gets "" as PATH_INFO
32
32
  module RunRequireSlash
data/lib/roda/request.rb CHANGED
@@ -12,6 +12,7 @@ else
12
12
  end
13
13
  end
14
14
 
15
+ require 'set'
15
16
  require_relative "cache"
16
17
 
17
18
  class Roda
@@ -489,6 +490,21 @@ class Roda
489
490
  end
490
491
  end
491
492
 
493
+ # Match only if the next segment in the path is one of the
494
+ # set's elements, and yield the next segment.
495
+ def _match_set(set)
496
+ rp = @remaining_path
497
+ if key = _match_class_String
498
+ if set.include?(@captures[-1])
499
+ true
500
+ else
501
+ @remaining_path = rp
502
+ @captures.pop
503
+ false
504
+ end
505
+ end
506
+ end
507
+
492
508
  # Match the given symbol if any segment matches.
493
509
  def _match_symbol(sym=nil)
494
510
  rp = @remaining_path
@@ -629,6 +645,8 @@ class Roda
629
645
  _match_array(matcher)
630
646
  when Hash
631
647
  _match_hash(matcher)
648
+ when Set
649
+ _match_set(matcher)
632
650
  when Symbol
633
651
  _match_symbol(matcher)
634
652
  when false, nil
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 = 98
7
+ RodaMinorVersion = 99
8
8
 
9
9
  # The patch version of Roda, updated only for bug fixes from the last
10
10
  # feature release.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.98.0
4
+ version: 3.99.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans