traceroute 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60ea3977c5ea662099ccd5708e96b4ae0102f041946de05b26a7365ef78036b5
4
- data.tar.gz: 3f5befad7e7b8c8c845aa85a533f73892033ba27b40946145dd020cf3a4e73c0
3
+ metadata.gz: f18a51e51368f5ad62d415ea291ca46c11ce5e8450704e47537f9bdb4f8f49a3
4
+ data.tar.gz: 0e6ad9c20b2422d4adfffd5aaa6382f3a38456d037c4b4c22144e773fc473f10
5
5
  SHA512:
6
- metadata.gz: e14c514faf5e80942141430f1a99bc4d15434b8dace7428488114ad6bd67187a75961fe7935ead9dd0acb83b127ae606fadd9004208303c84a5803205923d4f4
7
- data.tar.gz: cc942c1cdbfe1e7642bf1e082cab9c78376d801e2e32d78a66f1262436c21af8c6624260cefb7b87ac5c4ff6945c44ffb11f3f0ab3b04fd8db509686b7a473f6
6
+ metadata.gz: 521786552e926d4f2a4af20d47af74c8398b4337f4825c7ed20ac801bd1a21c8985246f56ceb8289f90d89a316292ac6fdc06f0719a99aeee46bcf8cda173187
7
+ data.tar.gz: 559b64f9ade6468bf16182acc101e41ca6b3e51574ca71f8e0563f8062c1a59775a557adb3e3652d51142295287ca527c37af7120d131baf9afca989d2037a07
data/lib/traceroute.rb CHANGED
@@ -28,10 +28,12 @@ class Traceroute
28
28
  end
29
29
 
30
30
  def defined_action_methods
31
- ActionController::Base.descendants.map do |controller|
32
- controller.action_methods.reject {|a| (a =~ /\A(_conditional)?_callback_/) || (a == '_layout_from_proc')}.map do |action|
33
- "#{controller.controller_path}##{action}"
34
- end
31
+ [ActionController::Base, ActionController::API].map do |klass|
32
+ klass.descendants.map do |controller|
33
+ controller.action_methods.reject {|a| (a =~ /\A(_conditional)?_callback_/) || (a == '_layout_from_proc')}.map do |action|
34
+ "#{controller.controller_path}##{action}"
35
+ end
36
+ end.flatten
35
37
  end.flatten.reject {|r| @ignored_unreachable_actions.any? { |m| r.match(m) } }
36
38
  end
37
39
 
data/test/app.rb CHANGED
@@ -14,6 +14,7 @@ module DummyApp
14
14
  end
15
15
 
16
16
  class ApplicationController < ActionController::Base; end
17
+ class ApiController < ActionController::API; end
17
18
 
18
19
  class UsersController < ApplicationController
19
20
  def index; end
@@ -25,3 +26,8 @@ module Admin; class ShopsController < ApplicationController
25
26
  def index; end
26
27
  def create; end
27
28
  end; end
29
+
30
+ module Api; class BooksController < ApiController
31
+ def index; end
32
+ def create; end
33
+ end; end
@@ -9,7 +9,7 @@ module TracerouteTest
9
9
  end
10
10
 
11
11
  def test_defined_action_methods
12
- assert_equal ['users#index', 'users#show', 'users#index2', 'admin/shops#create', 'admin/shops#index'].sort, @traceroute.defined_action_methods.sort
12
+ assert_equal ['users#index', 'users#show', 'users#index2', 'admin/shops#create', 'admin/shops#index', 'api/books#create', 'api/books#index'].sort, @traceroute.defined_action_methods.sort
13
13
  end
14
14
 
15
15
  def test_routed_actions
@@ -25,6 +25,10 @@ module TracerouteTest
25
25
  namespace :admin do
26
26
  resources :shops, :only => :index
27
27
  end
28
+
29
+ namespace :api do
30
+ resources :books, :only => :index
31
+ end
28
32
  end
29
33
 
30
34
  @traceroute = Traceroute.new Rails.application
@@ -35,7 +39,7 @@ module TracerouteTest
35
39
  end
36
40
 
37
41
  def test_routed_actions
38
- assert_equal ['admin/shops#index', 'users#index', 'users#show', 'users#new', 'users#create'].sort, @traceroute.routed_actions.sort
42
+ assert_equal ['admin/shops#index', 'api/books#index', 'users#index', 'users#show', 'users#new', 'users#create'].sort, @traceroute.routed_actions.sort
39
43
  end
40
44
  end
41
45
 
@@ -76,6 +80,10 @@ module TracerouteTest
76
80
  resources :shops, :only => [:index, :create]
77
81
  end
78
82
 
83
+ namespace :api do
84
+ resources :books, :only => [:index, :create]
85
+ end
86
+
79
87
  namespace :rails do
80
88
  resources :mailers, only: ["index"] do
81
89
  member do
@@ -32,7 +32,7 @@ module TracerouteWithEngineTest
32
32
  end
33
33
 
34
34
  def test_defined_action_methods
35
- assert_equal ["admin/shops#create", "admin/shops#index", "test_engine/tasks#index", "users#index", "users#index2", "users#show"].sort, @traceroute.defined_action_methods.sort
35
+ assert_equal ["admin/shops#create", "admin/shops#index", "api/books#create", "api/books#index", "test_engine/tasks#index", "users#index", "users#index2", "users#show"].sort, @traceroute.defined_action_methods.sort
36
36
  end
37
37
 
38
38
  def test_routed_actions
@@ -83,7 +83,7 @@ module TracerouteWithEngineTest
83
83
  end
84
84
 
85
85
  def test_defined_action_methods
86
- assert_equal ["admin/shops#create", "admin/shops#index", "test_engine/tasks#index", "users#index", "users#index2", "users#show"].sort, @traceroute.defined_action_methods.sort
86
+ assert_equal ["admin/shops#create", "admin/shops#index", "api/books#create", "api/books#index", "test_engine/tasks#index", "users#index", "users#index2", "users#show"].sort, @traceroute.defined_action_methods.sort
87
87
  end
88
88
 
89
89
  def test_routed_actions
data/test/yaml_test.rb CHANGED
@@ -36,6 +36,10 @@ class DotFileTest < Minitest::Test
36
36
  namespace :admin do
37
37
  resources :shops, :only => :index
38
38
  end
39
+
40
+ namespace :api do
41
+ resources :books, :only => :index
42
+ end
39
43
  end
40
44
 
41
45
  @traceroute = Traceroute.new Rails.application
@@ -52,7 +56,7 @@ class DotFileTest < Minitest::Test
52
56
  end
53
57
 
54
58
  def test_used_routes_are_ignored
55
- assert_equal ['admin/shops#index'].sort, @traceroute.routed_actions.sort
59
+ assert_equal ['admin/shops#index', 'api/books#index'].sort, @traceroute.routed_actions.sort
56
60
  end
57
61
  end
58
62
 
@@ -69,6 +73,9 @@ class EmptyFileTest < Minitest::Test
69
73
  namespace :admin do
70
74
  resources :shops, :only => :index
71
75
  end
76
+ namespace :api do
77
+ resources :books, :only => :index
78
+ end
72
79
  end
73
80
 
74
81
  @traceroute = Traceroute.new Rails.application
@@ -81,11 +88,11 @@ class EmptyFileTest < Minitest::Test
81
88
  end
82
89
 
83
90
  def test_empty_yaml_file_is_handled_the_same_as_no_file
84
- assert_equal ['users#index', 'users#show', 'users#index2', 'admin/shops#create', 'admin/shops#index', 'jasmine_rails/spec_runner#index'].sort, @traceroute.defined_action_methods.sort
91
+ assert_equal ['users#index', 'users#show', 'users#index2', 'admin/shops#create', 'admin/shops#index', 'api/books#create', 'api/books#index', 'jasmine_rails/spec_runner#index'].sort, @traceroute.defined_action_methods.sort
85
92
  end
86
93
 
87
94
  def test_property_with_no_key
88
- assert_equal ['admin/shops#index', 'users#index', 'users#show', 'users#new', 'users#create'].sort, @traceroute.routed_actions.sort
95
+ assert_equal ['admin/shops#index', 'api/books#index', 'users#index', 'users#show', 'users#new', 'users#create'].sort, @traceroute.routed_actions.sort
89
96
  end
90
97
  end
91
98
 
@@ -104,6 +111,10 @@ class InvalidFileTest < Minitest::Test
104
111
  namespace :admin do
105
112
  resources :shops, :only => :index
106
113
  end
114
+
115
+ namespace :api do
116
+ resources :books, :only => :index
117
+ end
107
118
  end
108
119
 
109
120
  @traceroute = Traceroute.new Rails.application
@@ -116,11 +127,11 @@ class InvalidFileTest < Minitest::Test
116
127
  end
117
128
 
118
129
  def test_empty_yaml_file_is_handled_the_same_as_no_file
119
- assert_equal ['users#index', 'users#show', 'users#index2', 'admin/shops#create', 'admin/shops#index', 'jasmine_rails/spec_runner#index'].sort, @traceroute.defined_action_methods.sort
130
+ assert_equal ['users#index', 'users#show', 'users#index2', 'admin/shops#create', 'admin/shops#index', 'api/books#create', 'api/books#index', 'jasmine_rails/spec_runner#index'].sort, @traceroute.defined_action_methods.sort
120
131
  end
121
132
 
122
133
  def test_property_with_no_key
123
- assert_equal ['admin/shops#index', 'users#index', 'users#show', 'users#new', 'users#create'].sort, @traceroute.routed_actions.sort
134
+ assert_equal ['admin/shops#index', 'api/books#index', 'users#index', 'users#show', 'users#new', 'users#create'].sort, @traceroute.routed_actions.sort
124
135
  end
125
136
  end
126
137
 
data/traceroute.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "traceroute"
6
- s.version = '0.6.2'
6
+ s.version = '0.7.0'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ['Akira Matsuda']
9
9
  s.email = ['[email protected]']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traceroute
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-15 00:00:00.000000000 Z
11
+ date: 2018-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  version: '0'
68
68
  requirements: []
69
69
  rubyforge_project: traceroute
70
- rubygems_version: 2.7.6
70
+ rubygems_version: 2.7.7
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: A Rake task that helps you find the dead routes and actions for your Rails
OSZAR »