rails-route-checker 0.2.9 → 0.4.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: 6a033b51eb9cdaf882526b2d66561fc4c172152f72a66a9ba20b149feb083f5c
4
- data.tar.gz: 6458250f79b92009d94a66d7e7472f0beb063100883aac46a69d0c9a9ecd6406
3
+ metadata.gz: 89fcf6a85dd10ed700f7ff32370300fc1e49d5313fa3753ee922c139489b6022
4
+ data.tar.gz: b07d868c353911637604066e41436d1de682f0ccc8fc5569b376a151c852c152
5
5
  SHA512:
6
- metadata.gz: 61b1815bfcf53a03f4fb7d1f9a095c3aa8705cd432cb9b9e1f7697bf79736ade476fd683e6053c3b142219d1800923d02d3d19edc8e74869b3f72828e3ab515d
7
- data.tar.gz: a28a726a4438b503ef92ed77002643d05a3007aa65c49fc489932a721a0ef13d61cb2a1b149014c4d5b03308d7b8ef0f3fd9bdb440fbc5aec7483ba0c71f7562
6
+ metadata.gz: 9bbf90bc7d66953cd66a5eab2ff5baf871cced4434b6f3bc8aad25e5bd64160b5a1ed533ff21a78e8e30bc06ab7e3768742132945b0fc0788d4f1bfd3b29101b
7
+ data.tar.gz: 3ebd02b81b3046fa80c7b9e3faea8de917e77b141a0142952b2ff7bb6158368601bc708e6b988be06ff61877361fa31fae79e65e6b99f1b71f66b4f8530769d1
@@ -23,8 +23,6 @@ module RailsRouteChecker
23
23
  suppress_output do
24
24
  @app = Rails.application
25
25
  @app.eager_load!
26
- attempt_to_load_default_controllers
27
- @app.reload_routes!
28
26
  Rails::Engine.subclasses.each(&:eager_load!)
29
27
  end
30
28
  end
@@ -97,23 +95,6 @@ module RailsRouteChecker
97
95
  retval
98
96
  end
99
97
 
100
- def attempt_to_load_default_controllers
101
- # rubocop:disable Lint/SuppressedException
102
- begin
103
- ::Rails::InfoController
104
- rescue NameError # ignored
105
- end
106
- begin
107
- ::Rails::WelcomeController
108
- rescue NameError # ignored
109
- end
110
- begin
111
- ::Rails::MailersController
112
- rescue NameError # ignored
113
- end
114
- # rubocop:enable Lint/SuppressedException
115
- end
116
-
117
98
  def reject_route?(route)
118
99
  return true if route.name.nil? && route.requirements.blank?
119
100
  return true if route.app.is_a?(ActionDispatch::Routing::Mapper::Constraints) &&
@@ -11,11 +11,18 @@ module RailsRouteChecker
11
11
  @source_lines = @source.split(/\r\n|\r|\n/)
12
12
 
13
13
  version = Gem::Version.new(Haml::VERSION).approximate_recommendation
14
- options = Haml::Options.new
14
+
15
15
  original_tree = case version
16
- when '~> 4.0', '~> 4.1' then Haml::Parser.new(@source, options).parse
17
- when '~> 5.0', '~> 5.1', '~> 5.2' then Haml::Parser.new(options).call(@source)
18
- else raise "Cannot handle Haml version: #{version}"
16
+ when '~> 4.0', '~> 4.1'
17
+ options = Haml::Options.new
18
+ Haml::Parser.new(@source, options).parse
19
+ when '~> 5.0', '~> 5.1', '~> 5.2'
20
+ options = Haml::Options.new
21
+ Haml::Parser.new(options).call(@source)
22
+ when '~> 6.0', '~> 6.1', '~> 6.2'
23
+ Haml::Parser.new({}).call(@source)
24
+ else
25
+ raise "Cannot handle Haml version: #{version}"
19
26
  end
20
27
 
21
28
  @tree = process_tree(original_tree)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsRouteChecker
4
- VERSION = '0.2.9'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -26,4 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'bundler', '~> 2.1'
27
27
  spec.add_development_dependency 'rake', '~> 13.0'
28
28
  spec.add_development_dependency 'rubocop', '~> 0.86'
29
- end
29
+ spec.add_development_dependency 'appraisal', '~> 2.5.0'
30
+ spec.add_development_dependency 'minitest'
31
+ 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.9
4
+ version: 0.4.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: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2023-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.86'
55
+ - !ruby/object:Gem::Dependency
56
+ name: appraisal
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.5.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.5.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  description: A linting tool that helps you find any routes defined in your routes.rb
56
84
  file that don't have a corresponding controller action, and find any _path or _url
57
85
  calls that don't have a corresponding route in the routes.rb file.
@@ -102,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
130
  - !ruby/object:Gem::Version
103
131
  version: '0'
104
132
  requirements: []
105
- rubygems_version: 3.1.2
133
+ rubygems_version: 3.4.6
106
134
  signing_key:
107
135
  specification_version: 4
108
136
  summary: A linting tool for your Rails routes