passages 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/.travis.yml +1 -2
- data/Gemfile.lock +100 -88
- data/app/controllers/passages/routes_controller.rb +4 -1
- data/lib/passages/engine.rb +3 -2
- data/lib/passages/route.rb +1 -1
- data/passages.gemspec +2 -2
- data/spec/controllers/passages/routes_controller_spec.rb +18 -3
- data/spec/lib/passages/mount_route_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -2
- data/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1545e7207653537cd21e3fc22e717fb51c15154f
|
4
|
+
data.tar.gz: fde415b8f6d56d9bc882c13f56c0bb00e2bce321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 736a61de7b2f02de0b15333e6214df8bd1526114b045118eeb82928dfa0c32f5aed9ea7254f4e9910b8cc26c7cfe9b27c5fb54b1b762463e083a0ce55b7ff4b9
|
7
|
+
data.tar.gz: 5194dd0128d2e860c38ec48ec81c56e661e65b87b206a06e1301aa631279fb7a966a06c4c08a74ec698595142ebb3e1b3611c18216b15bed2d992efa417e8e83
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -7,131 +7,143 @@ PATH
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (5.
|
11
|
-
actionpack (= 5.
|
10
|
+
actioncable (5.2.0)
|
11
|
+
actionpack (= 5.2.0)
|
12
12
|
nio4r (~> 2.0)
|
13
|
-
websocket-driver (
|
14
|
-
actionmailer (5.
|
15
|
-
actionpack (= 5.
|
16
|
-
actionview (= 5.
|
17
|
-
activejob (= 5.
|
13
|
+
websocket-driver (>= 0.6.1)
|
14
|
+
actionmailer (5.2.0)
|
15
|
+
actionpack (= 5.2.0)
|
16
|
+
actionview (= 5.2.0)
|
17
|
+
activejob (= 5.2.0)
|
18
18
|
mail (~> 2.5, >= 2.5.4)
|
19
19
|
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.
|
21
|
-
actionview (= 5.
|
22
|
-
activesupport (= 5.
|
20
|
+
actionpack (5.2.0)
|
21
|
+
actionview (= 5.2.0)
|
22
|
+
activesupport (= 5.2.0)
|
23
23
|
rack (~> 2.0)
|
24
|
-
rack-test (
|
24
|
+
rack-test (>= 0.6.3)
|
25
25
|
rails-dom-testing (~> 2.0)
|
26
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.
|
28
|
-
activesupport (= 5.
|
27
|
+
actionview (5.2.0)
|
28
|
+
activesupport (= 5.2.0)
|
29
29
|
builder (~> 3.1)
|
30
30
|
erubi (~> 1.4)
|
31
31
|
rails-dom-testing (~> 2.0)
|
32
32
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
-
activejob (5.
|
34
|
-
activesupport (= 5.
|
33
|
+
activejob (5.2.0)
|
34
|
+
activesupport (= 5.2.0)
|
35
35
|
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.
|
37
|
-
activesupport (= 5.
|
38
|
-
activerecord (5.
|
39
|
-
activemodel (= 5.
|
40
|
-
activesupport (= 5.
|
41
|
-
arel (
|
42
|
-
|
36
|
+
activemodel (5.2.0)
|
37
|
+
activesupport (= 5.2.0)
|
38
|
+
activerecord (5.2.0)
|
39
|
+
activemodel (= 5.2.0)
|
40
|
+
activesupport (= 5.2.0)
|
41
|
+
arel (>= 9.0)
|
42
|
+
activestorage (5.2.0)
|
43
|
+
actionpack (= 5.2.0)
|
44
|
+
activerecord (= 5.2.0)
|
45
|
+
marcel (~> 0.3.1)
|
46
|
+
activesupport (5.2.0)
|
43
47
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
44
|
-
i18n (
|
48
|
+
i18n (>= 0.7, < 2)
|
45
49
|
minitest (~> 5.1)
|
46
50
|
tzinfo (~> 1.1)
|
47
|
-
arel (
|
48
|
-
ast (2.
|
51
|
+
arel (9.0.0)
|
52
|
+
ast (2.4.0)
|
49
53
|
builder (3.2.3)
|
50
54
|
concurrent-ruby (1.0.5)
|
51
|
-
|
52
|
-
|
53
|
-
|
55
|
+
crass (1.0.4)
|
56
|
+
diff-lcs (1.3)
|
57
|
+
erubi (1.7.1)
|
58
|
+
globalid (0.4.1)
|
54
59
|
activesupport (>= 4.2.0)
|
55
|
-
i18n (0.
|
56
|
-
|
60
|
+
i18n (1.0.1)
|
61
|
+
concurrent-ruby (~> 1.0)
|
62
|
+
loofah (2.2.2)
|
63
|
+
crass (~> 1.0.2)
|
57
64
|
nokogiri (>= 1.5.9)
|
58
|
-
mail (2.
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
65
|
+
mail (2.7.0)
|
66
|
+
mini_mime (>= 0.1.1)
|
67
|
+
marcel (0.3.2)
|
68
|
+
mimemagic (~> 0.3.2)
|
69
|
+
method_source (0.9.0)
|
70
|
+
mimemagic (0.3.2)
|
71
|
+
mini_mime (1.0.0)
|
72
|
+
mini_portile2 (2.3.0)
|
73
|
+
minitest (5.11.3)
|
74
|
+
nio4r (2.3.1)
|
75
|
+
nokogiri (1.8.3)
|
76
|
+
mini_portile2 (~> 2.3.0)
|
77
|
+
parallel (1.12.1)
|
78
|
+
parser (2.5.1.0)
|
79
|
+
ast (~> 2.4.0)
|
80
|
+
powerpack (0.1.2)
|
81
|
+
rack (2.0.5)
|
82
|
+
rack-test (1.0.0)
|
83
|
+
rack (>= 1.0, < 3)
|
84
|
+
rails (5.2.0)
|
85
|
+
actioncable (= 5.2.0)
|
86
|
+
actionmailer (= 5.2.0)
|
87
|
+
actionpack (= 5.2.0)
|
88
|
+
actionview (= 5.2.0)
|
89
|
+
activejob (= 5.2.0)
|
90
|
+
activemodel (= 5.2.0)
|
91
|
+
activerecord (= 5.2.0)
|
92
|
+
activestorage (= 5.2.0)
|
93
|
+
activesupport (= 5.2.0)
|
94
|
+
bundler (>= 1.3.0)
|
95
|
+
railties (= 5.2.0)
|
86
96
|
sprockets-rails (>= 2.0.0)
|
87
97
|
rails-dom-testing (2.0.3)
|
88
98
|
activesupport (>= 4.2.0)
|
89
99
|
nokogiri (>= 1.6)
|
90
|
-
rails-html-sanitizer (1.0.
|
91
|
-
loofah (~> 2.
|
92
|
-
railties (5.
|
93
|
-
actionpack (= 5.
|
94
|
-
activesupport (= 5.
|
100
|
+
rails-html-sanitizer (1.0.4)
|
101
|
+
loofah (~> 2.2, >= 2.2.2)
|
102
|
+
railties (5.2.0)
|
103
|
+
actionpack (= 5.2.0)
|
104
|
+
activesupport (= 5.2.0)
|
95
105
|
method_source
|
96
106
|
rake (>= 0.8.7)
|
97
107
|
thor (>= 0.18.1, < 2.0)
|
98
|
-
rainbow (2.
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
rspec-
|
103
|
-
rspec-
|
104
|
-
|
105
|
-
|
106
|
-
|
108
|
+
rainbow (2.2.2)
|
109
|
+
rake
|
110
|
+
rake (12.3.1)
|
111
|
+
rspec (3.7.0)
|
112
|
+
rspec-core (~> 3.7.0)
|
113
|
+
rspec-expectations (~> 3.7.0)
|
114
|
+
rspec-mocks (~> 3.7.0)
|
115
|
+
rspec-core (3.7.1)
|
116
|
+
rspec-support (~> 3.7.0)
|
117
|
+
rspec-expectations (3.7.0)
|
107
118
|
diff-lcs (>= 1.2.0, < 2.0)
|
108
|
-
rspec-support (~> 3.
|
109
|
-
rspec-mocks (3.
|
119
|
+
rspec-support (~> 3.7.0)
|
120
|
+
rspec-mocks (3.7.0)
|
110
121
|
diff-lcs (>= 1.2.0, < 2.0)
|
111
|
-
rspec-support (~> 3.
|
112
|
-
rspec-support (3.
|
113
|
-
rubocop (0.
|
114
|
-
|
122
|
+
rspec-support (~> 3.7.0)
|
123
|
+
rspec-support (3.7.1)
|
124
|
+
rubocop (0.49.0)
|
125
|
+
parallel (~> 1.10)
|
126
|
+
parser (>= 2.3.3.1, < 3.0)
|
115
127
|
powerpack (~> 0.1)
|
116
128
|
rainbow (>= 1.99.1, < 3.0)
|
117
129
|
ruby-progressbar (~> 1.7)
|
118
130
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
119
|
-
ruby-progressbar (1.
|
120
|
-
sprockets (3.7.
|
131
|
+
ruby-progressbar (1.9.0)
|
132
|
+
sprockets (3.7.2)
|
121
133
|
concurrent-ruby (~> 1.0)
|
122
134
|
rack (> 1, < 3)
|
123
|
-
sprockets-rails (3.2.
|
135
|
+
sprockets-rails (3.2.1)
|
124
136
|
actionpack (>= 4.0)
|
125
137
|
activesupport (>= 4.0)
|
126
138
|
sprockets (>= 3.0.0)
|
127
|
-
thor (0.
|
139
|
+
thor (0.20.0)
|
128
140
|
thread_safe (0.3.6)
|
129
|
-
tzinfo (1.2.
|
141
|
+
tzinfo (1.2.5)
|
130
142
|
thread_safe (~> 0.1)
|
131
|
-
unicode-display_width (1.0
|
132
|
-
websocket-driver (0.
|
143
|
+
unicode-display_width (1.4.0)
|
144
|
+
websocket-driver (0.7.0)
|
133
145
|
websocket-extensions (>= 0.1.0)
|
134
|
-
websocket-extensions (0.1.
|
146
|
+
websocket-extensions (0.1.3)
|
135
147
|
|
136
148
|
PLATFORMS
|
137
149
|
ruby
|
@@ -139,7 +151,7 @@ PLATFORMS
|
|
139
151
|
DEPENDENCIES
|
140
152
|
passages!
|
141
153
|
rspec (~> 3.2)
|
142
|
-
rubocop (= 0.
|
154
|
+
rubocop (= 0.49.0)
|
143
155
|
|
144
156
|
BUNDLED WITH
|
145
|
-
1.
|
157
|
+
1.16.0
|
@@ -12,8 +12,11 @@ module Passages
|
|
12
12
|
|
13
13
|
def routes
|
14
14
|
@routes = application_routes
|
15
|
-
@engine_routes = engine_routes
|
16
15
|
@mount_routes = mount_routes
|
16
|
+
mounted_engines = @mount_routes.keys
|
17
|
+
@engine_routes = engine_routes.select do |r|
|
18
|
+
mounted_engines.include?(r[:engine])
|
19
|
+
end
|
17
20
|
end
|
18
21
|
|
19
22
|
private
|
data/lib/passages/engine.rb
CHANGED
@@ -8,7 +8,7 @@ module Passages
|
|
8
8
|
# Necessary for rake assets:precompile in a main application
|
9
9
|
# to compile this Engine's assets as well
|
10
10
|
initializer 'passages.assets.precompile' do |app|
|
11
|
-
app.config.assets.precompile += %w
|
11
|
+
app.config.assets.precompile += %w[application.css application.js]
|
12
12
|
end
|
13
13
|
|
14
14
|
# Optionally mount the /passages route at an applications top
|
@@ -25,7 +25,8 @@ module Passages
|
|
25
25
|
unless Passages.config.no_auth?
|
26
26
|
Passages::RoutesController.http_basic_authenticate_with(
|
27
27
|
name: Passages.username,
|
28
|
-
password: Passages.password
|
28
|
+
password: Passages.password
|
29
|
+
)
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
data/lib/passages/route.rb
CHANGED
@@ -6,7 +6,7 @@ module Passages
|
|
6
6
|
# Main DelegateClass used for decoration and discerning if a route is
|
7
7
|
# a "regular" route or a mount route
|
8
8
|
class Route < DelegateClass(ActionDispatch::Routing::RouteWrapper)
|
9
|
-
ATTRIBUTES_FOR_DISPLAY = %w
|
9
|
+
ATTRIBUTES_FOR_DISPLAY = %w[name verb controller action path].freeze
|
10
10
|
|
11
11
|
def initialize(route)
|
12
12
|
super(ActionDispatch::Routing::RouteWrapper.new(route))
|
data/passages.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.homepage = 'https://github.com/yez/passages'
|
17
17
|
s.license = 'MIT'
|
18
18
|
|
19
|
-
s.require_paths = %w
|
19
|
+
s.require_paths = %w[lib app]
|
20
20
|
s.files = `git ls-files`.split("\n")
|
21
21
|
s.test_files = s.files.grep(%r{^spec/})
|
22
22
|
|
@@ -24,5 +24,5 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_dependency 'rails', '~> 5.0'
|
25
25
|
|
26
26
|
s.add_development_dependency 'rspec', '~> 3.2'
|
27
|
-
s.add_development_dependency 'rubocop', '0.
|
27
|
+
s.add_development_dependency 'rubocop', '0.49.0'
|
28
28
|
end
|
@@ -9,9 +9,9 @@ module Passages
|
|
9
9
|
describe RoutesController do
|
10
10
|
describe '#routes' do
|
11
11
|
before do
|
12
|
-
allow(subject).to receive(:application_routes) {
|
13
|
-
allow(subject).to receive(:engine_routes) {
|
14
|
-
allow(subject).to receive(:mount_routes) {
|
12
|
+
allow(subject).to receive(:application_routes) { [] }
|
13
|
+
allow(subject).to receive(:engine_routes) { [] }
|
14
|
+
allow(subject).to receive(:mount_routes) { {} }
|
15
15
|
subject.routes
|
16
16
|
end
|
17
17
|
|
@@ -23,6 +23,21 @@ module Passages
|
|
23
23
|
expect(subject.instance_variable_get(:@engine_routes)).to_not be_nil
|
24
24
|
end
|
25
25
|
|
26
|
+
it 'sets @engine_routes only if a corresponding mounte route exists' do
|
27
|
+
first_engine_route = { engine: :foo, routes: [anything] }
|
28
|
+
second_engine_route = { engine: :bar, routes: [anything] }
|
29
|
+
allow(subject).to receive(:engine_routes) do
|
30
|
+
[
|
31
|
+
first_engine_route,
|
32
|
+
second_engine_route
|
33
|
+
]
|
34
|
+
end
|
35
|
+
allow(subject).to receive(:mount_routes) { { foo: anything } }
|
36
|
+
expected = [first_engine_route]
|
37
|
+
subject.routes
|
38
|
+
expect(subject.instance_variable_get(:@engine_routes)).to eq(expected)
|
39
|
+
end
|
40
|
+
|
26
41
|
it 'sets @mount_routes' do
|
27
42
|
expect(subject.instance_variable_get(:@mount_routes)).to_not be_nil
|
28
43
|
end
|
data/spec/spec_helper.rb
CHANGED
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Yesbeck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.49.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.49.0
|
55
55
|
description: |-
|
56
56
|
Rails Engine to make internal routes searchable and
|
57
57
|
discoverable for more than just the name of the route.
|
@@ -63,6 +63,7 @@ extensions: []
|
|
63
63
|
extra_rdoc_files: []
|
64
64
|
files:
|
65
65
|
- ".gitignore"
|
66
|
+
- ".rubocop.yml"
|
66
67
|
- ".travis.yml"
|
67
68
|
- Gemfile
|
68
69
|
- Gemfile.lock
|
@@ -126,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
127
|
version: '0'
|
127
128
|
requirements: []
|
128
129
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.6.14
|
130
131
|
signing_key:
|
131
132
|
specification_version: 4
|
132
133
|
summary: Display and search capabilities for Ruby on Rails routes
|