rails-route-checker 0.2.2 → 0.2.3

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: c2ee3366805e8dbc68755df5f5ce5e1342f5be11
4
- data.tar.gz: 9ce06f8c42d7f2940ee45ab82ad491afce95f2fa
3
+ metadata.gz: 19d68dcbdd849a080cf1e5d99f1ae4a5835ad770
4
+ data.tar.gz: eb811f79a36bdf90e44cc440549dd279cc1d8a73
5
5
  SHA512:
6
- metadata.gz: da784f02dd0cb29e448fb698e89196709a2b7be7b080b4d7e9c8770bf11bc66ec158907da3f51e9ff81fc3ebdf355dad4d047aebdb80675b4953038a0355ee3f
7
- data.tar.gz: 87d43f4feca31e8f58820570439fddbe97be9499ea5828a8111b9439e9e75df068c2d0bf5ae085c91b43dc1d3a452e548b996daeefd7b314489e5710233b311d
6
+ metadata.gz: 545ed87d3c89646a04cf3a7e7aee7b90ee48a16d33d7d8fce0699ec0c0ea01a211b2bd659dd5a85740a2c5ebeadd92cb017cfca426384fd09844700b4149d94c
7
+ data.tar.gz: 75ea1b5e8b936cb03925fb4c79369e86b9be5643401adda5bc0878689c8f3f6a16494fd74dec7f63307e582b86bd31c083805ed575466b87fa5ba33e56e8b058
@@ -10,7 +10,12 @@ module RailsRouteChecker
10
10
  action = r.requirements[:action]
11
11
 
12
12
  next if options[:ignored_controllers].include?(controller)
13
- next if controller_information.key?(controller) && controller_information[controller][:actions].include?(action)
13
+
14
+ if controller_information.key?(controller)
15
+ info = controller_information[controller]
16
+ next if info[:actions].include?(action)
17
+ next if info[:lookup_context] && info[:lookup_context].template_exists?("#{controller}/#{action}")
18
+ end
14
19
 
15
20
  {
16
21
  controller: controller,
@@ -41,13 +41,17 @@ module RailsRouteChecker
41
41
  next if controller.controller_path.start_with?('rails/')
42
42
 
43
43
  instance_methods = (controller.instance_methods.map(&:to_s) + controller.private_instance_methods.map(&:to_s))
44
+ lookup_context = ActionView::LookupContext.new(
45
+ controller._view_paths, {}, controller._prefixes
46
+ ) if controller.instance_methods.include?(:default_render)
44
47
 
45
48
  [
46
49
  controller.controller_path,
47
50
  {
48
51
  helpers: controller.helpers.methods.map(&:to_s),
49
52
  actions: controller.action_methods.to_a,
50
- instance_methods: instance_methods.compact.uniq
53
+ instance_methods: instance_methods.compact.uniq,
54
+ lookup_context: lookup_context
51
55
  }
52
56
  ]
53
57
  end.compact.to_h
@@ -14,7 +14,7 @@ module RailsRouteChecker
14
14
  end
15
15
 
16
16
  def issues?
17
- issues.values.flatten(1).count > 1
17
+ issues.values.flatten(1).count > 0
18
18
  end
19
19
 
20
20
  def output
@@ -1,3 +1,3 @@
1
1
  module RailsRouteChecker
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-route-checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Allie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-12 00:00:00.000000000 Z
11
+ date: 2018-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.6.12
106
+ rubygems_version: 2.6.8
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: A linting tool for your Rails routes