rails-route-checker 0.2.5 → 0.2.6

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: c4b141ceab4b2c9bfada02222b6b7191799b59eb3348706c4aec7965c67f3f77
4
- data.tar.gz: '097b4055001f7eb1c9e563ffecb5b34d654009c35e6a0a22112252fc94d591ff'
3
+ metadata.gz: 91a3036bc852166e6e8d63efc1f3d319932bba5f3bbd361c5dbb08994e7878ad
4
+ data.tar.gz: 77345a3517d9812ad4a9d8357ed3cc170c129a0a1641925e5fda4fb9dda65ec5
5
5
  SHA512:
6
- metadata.gz: 2a066423f72be684eeae73e45c17435852ddaf72c90569e04164875874c87951bef6cd0c1aecc5ea1849b07d7c07b265b72195c061e73f0e02d9e5368233dfe9
7
- data.tar.gz: 211444cce6f9e4686c9e4090801ccdd033a3c55a21c44adc030ceed1cde7e166fdc093042aba42c708556da43f9cc497c340357fdbadbe29178b3c520305caae
6
+ metadata.gz: '019c96a2f0cd7b618f5356f11a11f6eabce34cbc0735d91d500b31e8082a0749f5047fdb6f4e1394025b4a19d993a48e5e7f9846f51de10319ec428f88f54791'
7
+ data.tar.gz: bdd94456a37c71846c2d878238e226097273728c69ac74b198533d9fa232e5893badd844209b34940b28a0b7a4dc4586a437db78fc48ab36f341f2f49f2934bd
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
  gemspec
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'rails-route-checker'
4
5
  require 'optparse'
@@ -24,6 +25,6 @@ end.parse!
24
25
 
25
26
  options[:config_file] = '.rails-route-checker.yml' if File.exist?('.rails-route-checker.yml') && !options[:config_file]
26
27
 
27
- rrc = RailsRouteChecker::Runner.new(options)
28
+ rrc = RailsRouteChecker::Runner.new(**options)
28
29
  puts rrc.output
29
30
  exit rrc.issues? ? 1 : 0
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'rails-route-checker/app_interface'
2
4
  require_relative 'rails-route-checker/config_file'
3
5
  require_relative 'rails-route-checker/loaded_app'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  class AppInterface
3
5
  def initialize(**opts)
@@ -42,7 +44,7 @@ module RailsRouteChecker
42
44
 
43
45
  info = controller_information[controller]
44
46
  return true if info[:actions].include?(action)
45
- return true if info[:lookup_context] && info[:lookup_context].template_exists?("#{controller}/#{action}")
47
+ return true if info[:lookup_context]&.template_exists?("#{controller}/#{action}")
46
48
 
47
49
  false
48
50
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  class ConfigFile
3
5
  def initialize(filename)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  class LoadedApp
3
5
  def initialize
@@ -85,7 +87,7 @@ module RailsRouteChecker
85
87
  end
86
88
 
87
89
  def attempt_to_load_default_controllers
88
- # rubocop:disable Lint/HandleExceptions
90
+ # rubocop:disable Lint/SuppressedException
89
91
  begin
90
92
  ::Rails::InfoController
91
93
  rescue NameError # ignored
@@ -98,7 +100,7 @@ module RailsRouteChecker
98
100
  ::Rails::MailersController
99
101
  rescue NameError # ignored
100
102
  end
101
- # rubocop:enable Lint/HandleExceptions
103
+ # rubocop:enable Lint/SuppressedException
102
104
  end
103
105
 
104
106
  def reject_route?(route)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module ErbParser
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'haml_parser/document'
2
4
  require_relative 'haml_parser/tree/node'
3
5
  require_relative 'haml_parser/tree/filter_node'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module HamlParser
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module HamlParser
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module HamlParser
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module HamlParser
@@ -68,7 +70,7 @@ module RailsRouteChecker
68
70
  next_sibling = siblings.next(self)
69
71
  return next_sibling if next_sibling
70
72
 
71
- parent.successor if parent
73
+ parent&.successor
72
74
  end
73
75
 
74
76
  def next_node
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module HamlParser
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module HamlParser
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module HamlParser
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module HamlParser
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  module Parsers
3
5
  module Loader
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ripper'
2
4
 
3
5
  module RailsRouteChecker
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
4
  class Runner
3
5
  def initialize(**opts)
@@ -14,7 +16,7 @@ module RailsRouteChecker
14
16
  end
15
17
 
16
18
  def issues?
17
- issues.values.flatten(1).count > 0
19
+ issues.values.flatten(1).count.positive?
18
20
  end
19
21
 
20
22
  def output
@@ -31,7 +33,7 @@ module RailsRouteChecker
31
33
  private
32
34
 
33
35
  def app_interface
34
- @app_interface ||= RailsRouteChecker::AppInterface.new(@options)
36
+ @app_interface ||= RailsRouteChecker::AppInterface.new(**@options)
35
37
  end
36
38
 
37
39
  def missing_actions_output
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RailsRouteChecker
2
- VERSION = '0.2.5'.freeze
4
+ VERSION = '0.2.6'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'rails-route-checker/version'
@@ -21,7 +23,7 @@ Gem::Specification.new do |spec|
21
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
24
  spec.require_paths = ['lib']
23
25
 
24
- spec.add_development_dependency 'bundler', '~> 1.15'
25
- spec.add_development_dependency 'rake', '~> 10.0'
26
- spec.add_development_dependency 'rubocop', '~> 0.60'
26
+ spec.add_development_dependency 'bundler', '~> 2.1'
27
+ spec.add_development_dependency 'rake', '~> 13.0'
28
+ spec.add_development_dependency 'rubocop', '~> 0.86'
27
29
  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.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Allie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-11 00:00:00.000000000 Z
11
+ date: 2020-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.15'
19
+ version: '2.1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.15'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubocop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.60'
47
+ version: '0.86'
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.60'
54
+ version: '0.86'
55
55
  description: A linting tool that helps you find any routes defined in your routes.rb
56
56
  file that don't have a corresponding controller action, and find any _path or _url
57
57
  calls that don't have a corresponding route in the routes.rb file.
@@ -102,8 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubyforge_project:
106
- rubygems_version: 2.7.9
105
+ rubygems_version: 3.1.2
107
106
  signing_key:
108
107
  specification_version: 4
109
108
  summary: A linting tool for your Rails routes