rails-route-checker 0.4.0 → 0.6.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: 89fcf6a85dd10ed700f7ff32370300fc1e49d5313fa3753ee922c139489b6022
4
- data.tar.gz: b07d868c353911637604066e41436d1de682f0ccc8fc5569b376a151c852c152
3
+ metadata.gz: 5f4afc2aa6446dce803f66ee1f800e0ceabdc6bda39eb9ca650bc06fa3b0a090
4
+ data.tar.gz: 31e9204229f39fea31a563220f34f85afb86c4eae2f5fe0b1089305106ee2aa1
5
5
  SHA512:
6
- metadata.gz: 9bbf90bc7d66953cd66a5eab2ff5baf871cced4434b6f3bc8aad25e5bd64160b5a1ed533ff21a78e8e30bc06ab7e3768742132945b0fc0788d4f1bfd3b29101b
7
- data.tar.gz: 3ebd02b81b3046fa80c7b9e3faea8de917e77b141a0142952b2ff7bb6158368601bc708e6b988be06ff61877361fa31fae79e65e6b99f1b71f66b4f8530769d1
6
+ metadata.gz: f0dfbdaaa247be61613980079b3e065e689c5d0ce71d0310a1dd51ab933a340bb6f2c3a9d1076eadb4977aa079ae47f13fc0284dc10af0a75ee0e63d61672628
7
+ data.tar.gz: 43d372019c0bec95b29dabce39eecb3fa91387cbf18d5e0d9295c606543698f13baea326484e5d99452199086b59d3cb86fefc3fbc610313676183185d6ec3b1
@@ -48,13 +48,24 @@ module RailsRouteChecker
48
48
  end
49
49
 
50
50
  def controller_information
51
- @controller_information ||= ActionController::Base.descendants.map do |controller|
51
+ return @controller_information if @controller_information
52
+
53
+ base_controllers_descendants = [ActionController::Base, ActionController::API].flat_map(&:descendants)
54
+
55
+ @controller_information = base_controllers_descendants.map do |controller|
52
56
  next if controller.controller_path.nil? || controller.controller_path.start_with?('rails/')
53
57
 
58
+ controller_helper_methods =
59
+ if controller.respond_to?(:helpers)
60
+ controller.helpers.methods.map(&:to_s)
61
+ else
62
+ []
63
+ end
64
+
54
65
  [
55
66
  controller.controller_path,
56
67
  {
57
- helpers: controller.helpers.methods.map(&:to_s),
68
+ helpers: controller_helper_methods,
58
69
  actions: controller.action_methods.to_a,
59
70
  instance_methods: instance_methods(controller),
60
71
  lookup_context: lookup_context(controller)
@@ -19,7 +19,7 @@ module RailsRouteChecker
19
19
  when '~> 5.0', '~> 5.1', '~> 5.2'
20
20
  options = Haml::Options.new
21
21
  Haml::Parser.new(options).call(@source)
22
- when '~> 6.0', '~> 6.1', '~> 6.2'
22
+ when '~> 6.0', '~> 6.1', '~> 6.2', '~> 6.3'
23
23
  Haml::Parser.new({}).call(@source)
24
24
  else
25
25
  raise "Cannot handle Haml version: #{version}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsRouteChecker
4
- VERSION = '0.4.0'
4
+ VERSION = '0.6.0'
5
5
  end
@@ -23,9 +23,12 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
+ spec.add_dependency 'rails'
27
+
26
28
  spec.add_development_dependency 'bundler', '~> 2.1'
27
29
  spec.add_development_dependency 'rake', '~> 13.0'
28
30
  spec.add_development_dependency 'rubocop', '~> 0.86'
29
31
  spec.add_development_dependency 'appraisal', '~> 2.5.0'
30
32
  spec.add_development_dependency 'minitest'
31
- end
33
+ spec.add_development_dependency 'propshaft'
34
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-route-checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Allie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,20 @@ dependencies:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: propshaft
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  description: A linting tool that helps you find any routes defined in your routes.rb
84
112
  file that don't have a corresponding controller action, and find any _path or _url
85
113
  calls that don't have a corresponding route in the routes.rb file.
@@ -130,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
158
  - !ruby/object:Gem::Version
131
159
  version: '0'
132
160
  requirements: []
133
- rubygems_version: 3.4.6
161
+ rubygems_version: 3.5.9
134
162
  signing_key:
135
163
  specification_version: 4
136
164
  summary: A linting tool for your Rails routes