waiter 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/waiter/menu/item.rb +1 -1
- data/lib/waiter/version.rb +1 -1
- data/spec/waiter/menu/item_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWFkZmNkZmY4ZmMyYmE1OThkNGFkYmMxY2FlM2ZhMWM2OWEyZmU2Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2Q0M2M3YTYwNGJkYWZlYTk2MmVjMTY3YmE1ZDAzYzVlNGRkMjJjNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTk5YWIyMGVlOTUzZTE1OGRkMDRlN2ZhYjQxZTAxMWFiMjRkOWVhMTQzMjZk
|
10
|
+
MzMzNzkzODBmNDg5Y2ZhZmY1NGNhMWFiYTBiN2M1ZDM5ZTc2ZDE4NTgxNzJj
|
11
|
+
ZGFiOTM5ODExZjQxNDc4MTAxMThkNTBlMjQ3MmY4ODVlNDAzZDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGFjNWEwMWUxMmE4YTBmOWUxNmFlYzQ3YmI5ZGEwNGZmNmU2MWY2YzI0ZDc0
|
14
|
+
NDgzZjU3YTZmZjg1ZWYzZmJjNGQ5ZDViYjUzZWQ4ZmVhYmIxZmZlYWI2NWNm
|
15
|
+
ZjgwZGYyMTRmMGI4MzYyNWM3ZjA4ZTBjOTEzNzE0NjU5ZmNhNjI=
|
data/lib/waiter/menu/item.rb
CHANGED
@@ -67,7 +67,7 @@ module Waiter
|
|
67
67
|
|
68
68
|
if wildcard_controllers.any?
|
69
69
|
return true if wildcard_controllers.any? do |c|
|
70
|
-
r = Regexp.new(c.sub(%r{
|
70
|
+
r = Regexp.new('\A' + c.sub(%r{/\*\Z}, '(/*)?').gsub('*', '.*'))
|
71
71
|
r =~ current_controller
|
72
72
|
end
|
73
73
|
end
|
data/lib/waiter/version.rb
CHANGED
@@ -89,6 +89,12 @@ RSpec.describe Waiter::Menu::Item do
|
|
89
89
|
expect(subject).to_not be_selected
|
90
90
|
end
|
91
91
|
|
92
|
+
it "should return false if the controller doesn't match a wildcard from the start" do
|
93
|
+
@controller = 'foo/bar'
|
94
|
+
@controllers = %w(bar/*)
|
95
|
+
expect(subject).to_not be_selected
|
96
|
+
end
|
97
|
+
|
92
98
|
context 'when a selected item is specified' do
|
93
99
|
subject { described_class.new(parent, :item1, nil, selected: :foo) }
|
94
100
|
|