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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9222ad73782391482c0c599d4cc2fab3a731b1d
4
- data.tar.gz: 3e813114c9aa59ae36a1e4a37350ac48b4f9309b
3
+ metadata.gz: 1545e7207653537cd21e3fc22e717fb51c15154f
4
+ data.tar.gz: fde415b8f6d56d9bc882c13f56c0bb00e2bce321
5
5
  SHA512:
6
- metadata.gz: 64674b61c287c6b0b81f41ea705112a49f74b38bd299fa5aea5df1c22ec4eaaceff806ff18a32f2e37e22d4552c482c9d4d4aae71009d0d28fd443534ebd11a2
7
- data.tar.gz: 63801b31a44fe49e6f024a795cfe452be60454b0bac40fe93a75de9eda81dcf2a9842e75531c040645eed216be2b2f22ac0718c59edfd6937c2c806b02413d4f
6
+ metadata.gz: 736a61de7b2f02de0b15333e6214df8bd1526114b045118eeb82928dfa0c32f5aed9ea7254f4e9910b8cc26c7cfe9b27c5fb54b1b762463e083a0ce55b7ff4b9
7
+ data.tar.gz: 5194dd0128d2e860c38ec48ec81c56e661e65b87b206a06e1301aa631279fb7a966a06c4c08a74ec698595142ebb3e1b3611c18216b15bed2d992efa417e8e83
data/.rubocop.yml ADDED
@@ -0,0 +1,6 @@
1
+ Style/FrozenStringLiteralComment:
2
+ Enabled: false
3
+
4
+ Style/BlockLength:
5
+ Exclude:
6
+ - 'spec/**/*.rb'
data/.travis.yml CHANGED
@@ -1,9 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0
4
- - 2.2.1
5
3
  - 2.2.2
6
4
  - 2.3.0
5
+ - 2.4.0
7
6
 
8
7
  script:
9
8
  - bundle exec rspec spec
data/Gemfile.lock CHANGED
@@ -7,131 +7,143 @@ PATH
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (5.1.1)
11
- actionpack (= 5.1.1)
10
+ actioncable (5.2.0)
11
+ actionpack (= 5.2.0)
12
12
  nio4r (~> 2.0)
13
- websocket-driver (~> 0.6.1)
14
- actionmailer (5.1.1)
15
- actionpack (= 5.1.1)
16
- actionview (= 5.1.1)
17
- activejob (= 5.1.1)
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.1.1)
21
- actionview (= 5.1.1)
22
- activesupport (= 5.1.1)
20
+ actionpack (5.2.0)
21
+ actionview (= 5.2.0)
22
+ activesupport (= 5.2.0)
23
23
  rack (~> 2.0)
24
- rack-test (~> 0.6.3)
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.1.1)
28
- activesupport (= 5.1.1)
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.1.1)
34
- activesupport (= 5.1.1)
33
+ activejob (5.2.0)
34
+ activesupport (= 5.2.0)
35
35
  globalid (>= 0.3.6)
36
- activemodel (5.1.1)
37
- activesupport (= 5.1.1)
38
- activerecord (5.1.1)
39
- activemodel (= 5.1.1)
40
- activesupport (= 5.1.1)
41
- arel (~> 8.0)
42
- activesupport (5.1.1)
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 (~> 0.7)
48
+ i18n (>= 0.7, < 2)
45
49
  minitest (~> 5.1)
46
50
  tzinfo (~> 1.1)
47
- arel (8.0.0)
48
- ast (2.2.0)
51
+ arel (9.0.0)
52
+ ast (2.4.0)
49
53
  builder (3.2.3)
50
54
  concurrent-ruby (1.0.5)
51
- diff-lcs (1.2.5)
52
- erubi (1.6.0)
53
- globalid (0.4.0)
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.8.1)
56
- loofah (2.0.3)
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.6.5)
59
- mime-types (>= 1.16, < 4)
60
- method_source (0.8.2)
61
- mime-types (3.1)
62
- mime-types-data (~> 3.2015)
63
- mime-types-data (3.2016.0521)
64
- mini_portile2 (2.1.0)
65
- minitest (5.10.2)
66
- nio4r (2.0.0)
67
- nokogiri (1.7.2)
68
- mini_portile2 (~> 2.1.0)
69
- parser (2.3.0.7)
70
- ast (~> 2.2)
71
- powerpack (0.1.1)
72
- rack (2.0.3)
73
- rack-test (0.6.3)
74
- rack (>= 1.0)
75
- rails (5.1.1)
76
- actioncable (= 5.1.1)
77
- actionmailer (= 5.1.1)
78
- actionpack (= 5.1.1)
79
- actionview (= 5.1.1)
80
- activejob (= 5.1.1)
81
- activemodel (= 5.1.1)
82
- activerecord (= 5.1.1)
83
- activesupport (= 5.1.1)
84
- bundler (>= 1.3.0, < 2.0)
85
- railties (= 5.1.1)
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.3)
91
- loofah (~> 2.0)
92
- railties (5.1.1)
93
- actionpack (= 5.1.1)
94
- activesupport (= 5.1.1)
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.1.0)
99
- rake (12.0.0)
100
- rspec (3.3.0)
101
- rspec-core (~> 3.3.0)
102
- rspec-expectations (~> 3.3.0)
103
- rspec-mocks (~> 3.3.0)
104
- rspec-core (3.3.2)
105
- rspec-support (~> 3.3.0)
106
- rspec-expectations (3.3.1)
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.3.0)
109
- rspec-mocks (3.3.2)
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.3.0)
112
- rspec-support (3.3.0)
113
- rubocop (0.39.0)
114
- parser (>= 2.3.0.7, < 3.0)
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.7.5)
120
- sprockets (3.7.1)
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.0)
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.19.4)
139
+ thor (0.20.0)
128
140
  thread_safe (0.3.6)
129
- tzinfo (1.2.3)
141
+ tzinfo (1.2.5)
130
142
  thread_safe (~> 0.1)
131
- unicode-display_width (1.0.2)
132
- websocket-driver (0.6.5)
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.2)
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.39.0)
154
+ rubocop (= 0.49.0)
143
155
 
144
156
  BUNDLED WITH
145
- 1.11.2
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
@@ -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(application.css application.js)
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
@@ -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(name verb controller action path).freeze
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(lib app)
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.39.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) { anything }
13
- allow(subject).to receive(:engine_routes) { anything }
14
- allow(subject).to receive(:mount_routes) { anything }
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
@@ -18,7 +18,7 @@ module Passages
18
18
  end
19
19
  end
20
20
 
21
- [:internal?, :path].each do |method|
21
+ %i[internal? path].each do |method|
22
22
  describe "##{method}" do
23
23
  it "responds to #{method}" do
24
24
  expect(subject).to respond_to(method)
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,4 @@
1
- require 'action_dispatch/routing'
2
- require 'action_dispatch/routing/inspector'
3
1
  require 'active_support'
2
+ require 'action_dispatch'
4
3
  require 'action_controller'
5
4
  require './lib/passages'
data/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Passages
2
2
  MAJOR = 2
3
- MINOR = 0
3
+ MINOR = 1
4
4
  TINY = 0
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join('.').freeze
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.0.0
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: 2017-05-17 00:00:00.000000000 Z
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.39.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.39.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.5.1
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