rails_best_practices 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +14 -12
- data/lib/rails_best_practices.rb +7 -21
- data/lib/rails_best_practices/core.rb +1 -0
- data/lib/rails_best_practices/core/check.rb +156 -6
- data/lib/rails_best_practices/core/checking_visitor.rb +2 -2
- data/lib/rails_best_practices/core/methods.rb +1 -0
- data/lib/rails_best_practices/core/nil.rb +10 -0
- data/lib/rails_best_practices/core/routes.rb +33 -0
- data/lib/rails_best_practices/core/runner.rb +3 -1
- data/lib/rails_best_practices/core_ext/sexp.rb +11 -0
- data/lib/rails_best_practices/prepares.rb +5 -2
- data/lib/rails_best_practices/prepares/controller_prepare.rb +8 -14
- data/lib/rails_best_practices/prepares/mailer_prepare.rb +2 -7
- data/lib/rails_best_practices/prepares/model_prepare.rb +3 -8
- data/lib/rails_best_practices/prepares/route_prepare.rb +142 -0
- data/lib/rails_best_practices/prepares/schema_prepare.rb +3 -8
- data/lib/rails_best_practices/reviews.rb +1 -0
- data/lib/rails_best_practices/reviews/add_model_virtual_attribute_review.rb +3 -8
- data/lib/rails_best_practices/reviews/always_add_db_index_review.rb +9 -12
- data/lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb +3 -8
- data/lib/rails_best_practices/reviews/isolate_seed_data_review.rb +3 -8
- data/lib/rails_best_practices/reviews/keep_finders_on_their_own_model_review.rb +2 -8
- data/lib/rails_best_practices/reviews/law_of_demeter_review.rb +3 -4
- data/lib/rails_best_practices/reviews/move_code_into_controller_review.rb +2 -8
- data/lib/rails_best_practices/reviews/move_code_into_helper_review.rb +3 -8
- data/lib/rails_best_practices/reviews/move_code_into_model_review.rb +3 -8
- data/lib/rails_best_practices/reviews/move_finder_to_named_scope_review.rb +2 -8
- data/lib/rails_best_practices/reviews/move_model_logic_into_model_review.rb +3 -8
- data/lib/rails_best_practices/reviews/needless_deep_nesting_review.rb +3 -8
- data/lib/rails_best_practices/reviews/not_use_default_route_review.rb +3 -8
- data/lib/rails_best_practices/reviews/overuse_route_customizations_review.rb +3 -9
- data/lib/rails_best_practices/reviews/remove_empty_helpers_review.rb +3 -8
- data/lib/rails_best_practices/reviews/remove_unused_methods_in_controllers_review.rb +57 -0
- data/lib/rails_best_practices/reviews/remove_unused_methods_in_models_review.rb +6 -92
- data/lib/rails_best_practices/reviews/replace_complex_creation_with_factory_method_review.rb +3 -8
- data/lib/rails_best_practices/reviews/replace_instance_variable_with_local_variable_review.rb +3 -8
- data/lib/rails_best_practices/reviews/restrict_auto_generated_routes_review.rb +3 -8
- data/lib/rails_best_practices/reviews/simplify_render_in_controllers_review.rb +3 -8
- data/lib/rails_best_practices/reviews/simplify_render_in_views_review.rb +3 -8
- data/lib/rails_best_practices/reviews/use_before_filter_review.rb +3 -8
- data/lib/rails_best_practices/reviews/use_model_association_review.rb +3 -8
- data/lib/rails_best_practices/reviews/use_multipart_alternative_as_content_type_of_email_review.rb +3 -8
- data/lib/rails_best_practices/reviews/use_observer_review.rb +3 -8
- data/lib/rails_best_practices/reviews/use_query_attribute_review.rb +2 -4
- data/lib/rails_best_practices/reviews/use_say_with_time_in_migrations_review.rb +2 -8
- data/lib/rails_best_practices/reviews/use_scope_access_review.rb +3 -8
- data/lib/rails_best_practices/version.rb +1 -1
- data/rails_best_practices.yml +1 -0
- data/spec/rails_best_practices/core/check_spec.rb +2 -2
- data/spec/rails_best_practices/core/checking_visitor_spec.rb +12 -32
- data/spec/rails_best_practices/core/nil_spec.rb +12 -0
- data/spec/rails_best_practices/core/routes_spec.rb +10 -0
- data/spec/rails_best_practices/core_ext/sexp_spec.rb +14 -0
- data/spec/rails_best_practices/prepares/route_prepare_spec.rb +502 -0
- data/spec/rails_best_practices/reviews/always_add_db_index_review_spec.rb +14 -1
- data/spec/rails_best_practices/reviews/overuse_route_customizations_review_spec.rb +20 -4
- data/spec/rails_best_practices/reviews/remove_unused_methods_in_controllers_review_spec.rb +120 -0
- data/spec/rails_best_practices/reviews/remove_unused_methods_in_models_review_spec.rb +1 -1
- metadata +113 -123
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
4
|
-
let(:runner) { RailsBestPractices::Core::Runner.new(
|
4
|
+
let(:runner) { RailsBestPractices::Core::Runner.new(
|
5
|
+
:reviews => RailsBestPractices::Reviews::AlwaysAddDbIndexReview.new
|
6
|
+
) }
|
5
7
|
|
6
8
|
it "should always add db index" do
|
7
9
|
content = <<-EOF
|
@@ -14,6 +16,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
14
16
|
end
|
15
17
|
EOF
|
16
18
|
runner.review('db/schema.rb', content)
|
19
|
+
runner.on_complete
|
17
20
|
runner.should have(2).errors
|
18
21
|
runner.errors[0].to_s.should == "db/schema.rb:2 - always add db index (comments => [post_id])"
|
19
22
|
runner.errors[1].to_s.should == "db/schema.rb:2 - always add db index (comments => [user_id])"
|
@@ -30,6 +33,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
30
33
|
end
|
31
34
|
EOF
|
32
35
|
runner.review('db/schema.rb', content)
|
36
|
+
runner.on_complete
|
33
37
|
runner.should have(1).errors
|
34
38
|
runner.errors[0].to_s.should == "db/schema.rb:2 - always add db index (versions => [versioned_id, versioned_type])"
|
35
39
|
end
|
@@ -45,6 +49,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
45
49
|
end
|
46
50
|
EOF
|
47
51
|
runner.review('db/schema.rb', content)
|
52
|
+
runner.on_complete
|
48
53
|
runner.should have(1).errors
|
49
54
|
runner.errors[0].to_s.should == "db/schema.rb:2 - always add db index (versions => [versioned_id, versioned_type])"
|
50
55
|
end
|
@@ -62,6 +67,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
62
67
|
end
|
63
68
|
EOF
|
64
69
|
runner.review('db/schema.rb', content)
|
70
|
+
runner.on_complete
|
65
71
|
runner.should have(1).errors
|
66
72
|
runner.errors[0].to_s.should == "db/schema.rb:2 - always add db index (taggings => [taggable_id, taggable_type])"
|
67
73
|
end
|
@@ -79,6 +85,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
79
85
|
end
|
80
86
|
EOF
|
81
87
|
runner.review('db/schema.rb', content)
|
88
|
+
runner.on_complete
|
82
89
|
runner.should have(1).errors
|
83
90
|
runner.errors[0].to_s.should == "db/schema.rb:2 - always add db index (taggings => [tag_id])"
|
84
91
|
end
|
@@ -95,6 +102,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
95
102
|
end
|
96
103
|
EOF
|
97
104
|
runner.review('db/schema.rb', content)
|
105
|
+
runner.on_complete
|
98
106
|
runner.should have(1).errors
|
99
107
|
runner.errors[0].to_s.should == "db/schema.rb:2 - always add db index (websites => [user_id])"
|
100
108
|
end
|
@@ -109,6 +117,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
109
117
|
end
|
110
118
|
EOF
|
111
119
|
runner.review('db/schema.rb', content)
|
120
|
+
runner.on_complete
|
112
121
|
runner.should have(0).errors
|
113
122
|
end
|
114
123
|
|
@@ -126,6 +135,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
126
135
|
end
|
127
136
|
EOF
|
128
137
|
runner.review('db/schema.rb', content)
|
138
|
+
runner.on_complete
|
129
139
|
runner.should have(0).errors
|
130
140
|
end
|
131
141
|
|
@@ -138,6 +148,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
138
148
|
end
|
139
149
|
EOF
|
140
150
|
runner.review('db/schema.rb', content)
|
151
|
+
runner.on_complete
|
141
152
|
runner.should have(0).errors
|
142
153
|
end
|
143
154
|
|
@@ -154,6 +165,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
154
165
|
end
|
155
166
|
EOF
|
156
167
|
runner.review('db/schema.rb', content)
|
168
|
+
runner.on_complete
|
157
169
|
runner.should have(0).errors
|
158
170
|
end
|
159
171
|
|
@@ -170,6 +182,7 @@ describe RailsBestPractices::Reviews::AlwaysAddDbIndexReview do
|
|
170
182
|
end
|
171
183
|
EOF
|
172
184
|
runner.review('db/schema.rb', content)
|
185
|
+
runner.on_complete
|
173
186
|
runner.should have(0).errors
|
174
187
|
end
|
175
188
|
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe RailsBestPractices::Reviews::OveruseRouteCustomizationsReview do
|
4
|
-
let(:runner) { RailsBestPractices::Core::Runner.new(
|
4
|
+
let(:runner) { RailsBestPractices::Core::Runner.new(
|
5
|
+
:reviews => RailsBestPractices::Reviews::OveruseRouteCustomizationsReview.new
|
6
|
+
) }
|
5
7
|
|
6
8
|
describe "rails2" do
|
7
9
|
it "should overuse route customizations" do
|
@@ -18,13 +20,27 @@ describe RailsBestPractices::Reviews::OveruseRouteCustomizationsReview do
|
|
18
20
|
runner.errors[0].to_s.should == "config/routes.rb:2 - overuse route customizations (customize_count > 3)"
|
19
21
|
end
|
20
22
|
|
21
|
-
it "should overuse route customizations with
|
23
|
+
it "should overuse route customizations with member" do
|
22
24
|
content = <<-EOF
|
23
25
|
ActionController::Routing::Routes.draw do |map|
|
24
26
|
map.resources :posts, :member => { :create_comment => :post,
|
25
27
|
:update_comment => :update,
|
26
|
-
:delete_comment => :delete
|
27
|
-
|
28
|
+
:delete_comment => :delete,
|
29
|
+
:disable_comment => :post }
|
30
|
+
end
|
31
|
+
EOF
|
32
|
+
runner.review('config/routes.rb', content)
|
33
|
+
runner.should have(1).errors
|
34
|
+
runner.errors[0].to_s.should == "config/routes.rb:2 - overuse route customizations (customize_count > 3)"
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should overuse route customizations with collection" do
|
38
|
+
content = <<-EOF
|
39
|
+
ActionController::Routing::Routes.draw do |map|
|
40
|
+
map.resources :posts, :collection => { :list_comments => :get,
|
41
|
+
:update_comments => :get,
|
42
|
+
:delete_comments => :get,
|
43
|
+
:disable_comments => :get }
|
28
44
|
end
|
29
45
|
EOF
|
30
46
|
runner.review('config/routes.rb', content)
|
@@ -0,0 +1,120 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RailsBestPractices::Reviews::RemoveUnusedMethodsInControllersReview do
|
4
|
+
let(:runner) { RailsBestPractices::Core::Runner.new(
|
5
|
+
:prepares => [RailsBestPractices::Prepares::ControllerPrepare.new, RailsBestPractices::Prepares::RoutePrepare.new],
|
6
|
+
:reviews => RailsBestPractices::Reviews::RemoveUnusedMethodsInControllersReview.new({'except_methods' => []})
|
7
|
+
) }
|
8
|
+
|
9
|
+
context "private/protected" do
|
10
|
+
it "should remove unused methods" do
|
11
|
+
content =<<-EOF
|
12
|
+
RailsBestPracticesCom::Application.routes.draw do
|
13
|
+
resources :posts
|
14
|
+
end
|
15
|
+
EOF
|
16
|
+
runner.prepare('config/routes.rb', content)
|
17
|
+
content =<<-EOF
|
18
|
+
class PostsController < ActiveRecord::Base
|
19
|
+
def show; end
|
20
|
+
protected
|
21
|
+
def load_post; end
|
22
|
+
private
|
23
|
+
def load_user; end
|
24
|
+
end
|
25
|
+
EOF
|
26
|
+
runner.prepare('app/controllers/posts_controller.rb', content)
|
27
|
+
runner.review('app/controllers/posts_controller.rb', content)
|
28
|
+
runner.on_complete
|
29
|
+
runner.should have(2).errors
|
30
|
+
runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:4 - remove unused methods (PostsController#load_post)"
|
31
|
+
runner.errors[1].to_s.should == "app/controllers/posts_controller.rb:6 - remove unused methods (PostsController#load_user)"
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should not remove unused methods for before_filter" do
|
35
|
+
content =<<-EOF
|
36
|
+
RailsBestPracticesCom::Application.routes.draw do
|
37
|
+
resources :posts
|
38
|
+
end
|
39
|
+
EOF
|
40
|
+
runner.prepare('config/routes.rb', content)
|
41
|
+
content =<<-EOF
|
42
|
+
class PostsController < ActiveRecord::Base
|
43
|
+
before_filter :load_post, :load_user
|
44
|
+
def show; end
|
45
|
+
protected
|
46
|
+
def load_post; end
|
47
|
+
def load_user; end
|
48
|
+
end
|
49
|
+
EOF
|
50
|
+
runner.prepare('app/controllers/posts_controller.rb', content)
|
51
|
+
runner.review('app/controllers/posts_controller.rb', content)
|
52
|
+
runner.on_complete
|
53
|
+
runner.should have(0).errors
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should not remove inherited_resources methods" do
|
57
|
+
content =<<-EOF
|
58
|
+
RailsBestPracticesCom::Application.routes.draw do
|
59
|
+
resources :posts
|
60
|
+
end
|
61
|
+
EOF
|
62
|
+
runner.prepare('config/routes.rb', content)
|
63
|
+
content =<<-EOF
|
64
|
+
class PostsController < InheritedResources::Base
|
65
|
+
def show; end
|
66
|
+
protected
|
67
|
+
def resource; end
|
68
|
+
def collection; end
|
69
|
+
def begin_of_association_chain; end
|
70
|
+
end
|
71
|
+
EOF
|
72
|
+
runner.prepare('app/controllers/posts_controller.rb', content)
|
73
|
+
runner.review('app/controllers/posts_controller.rb', content)
|
74
|
+
runner.on_complete
|
75
|
+
runner.should have(0).errors
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
context "public" do
|
80
|
+
it "should remove unused methods" do
|
81
|
+
content =<<-EOF
|
82
|
+
RailsBestPracticesCom::Application.routes.draw do
|
83
|
+
resources :posts
|
84
|
+
end
|
85
|
+
EOF
|
86
|
+
runner.prepare('config/routes.rb', content)
|
87
|
+
content =<<-EOF
|
88
|
+
class PostsController < ApplicationController
|
89
|
+
def show; end
|
90
|
+
def list; end
|
91
|
+
end
|
92
|
+
EOF
|
93
|
+
runner.prepare('app/controllers/posts_controller.rb', content)
|
94
|
+
runner.review('app/controllers/posts_controller.rb', content)
|
95
|
+
runner.on_complete
|
96
|
+
runner.should have(1).errors
|
97
|
+
runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:3 - remove unused methods (PostsController#list)"
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should not remove unused methods if all actions are used in route" do
|
101
|
+
content =<<-EOF
|
102
|
+
ActionController::Routing::Routes.draw do |map|
|
103
|
+
map.connect 'internal/:action/*whatever', :controller => "internal"
|
104
|
+
end
|
105
|
+
EOF
|
106
|
+
runner.prepare('config/routes.rb', content)
|
107
|
+
content =<<-EOF
|
108
|
+
class InternalController < ApplicationController
|
109
|
+
def list; end
|
110
|
+
def delete; end
|
111
|
+
def whatever; end
|
112
|
+
end
|
113
|
+
EOF
|
114
|
+
runner.prepare('app/controllers/internal_controller.rb', content)
|
115
|
+
runner.review('app/controllers/internal_controller.rb', content)
|
116
|
+
runner.on_complete
|
117
|
+
runner.should have(0).errors
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe RailsBestPractices::Reviews::RemoveUnusedMethodsInModelsReview do
|
4
4
|
let(:runner) { RailsBestPractices::Core::Runner.new(
|
5
|
-
:prepares =>
|
5
|
+
:prepares => RailsBestPractices::Prepares::ModelPrepare.new,
|
6
6
|
:reviews => RailsBestPractices::Reviews::RemoveUnusedMethodsInModelsReview.new({'except_methods' => ['set_cache']})
|
7
7
|
) }
|
8
8
|
|
metadata
CHANGED
@@ -1,149 +1,145 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_best_practices
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.4.0
|
4
5
|
prerelease:
|
5
|
-
version: 1.3.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Richard Huang
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-11-20 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: sexp_processor
|
18
|
-
requirement: &
|
16
|
+
requirement: &2152381700 !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
21
|
-
- -
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
24
22
|
type: :runtime
|
25
23
|
prerelease: false
|
26
|
-
version_requirements: *
|
27
|
-
- !ruby/object:Gem::Dependency
|
24
|
+
version_requirements: *2152381700
|
25
|
+
- !ruby/object:Gem::Dependency
|
28
26
|
name: progressbar
|
29
|
-
requirement: &
|
27
|
+
requirement: &2152380940 !ruby/object:Gem::Requirement
|
30
28
|
none: false
|
31
|
-
requirements:
|
32
|
-
- -
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version:
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
35
33
|
type: :runtime
|
36
34
|
prerelease: false
|
37
|
-
version_requirements: *
|
38
|
-
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: *2152380940
|
36
|
+
- !ruby/object:Gem::Dependency
|
39
37
|
name: colored
|
40
|
-
requirement: &
|
38
|
+
requirement: &2152380200 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version:
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
46
44
|
type: :runtime
|
47
45
|
prerelease: false
|
48
|
-
version_requirements: *
|
49
|
-
- !ruby/object:Gem::Dependency
|
46
|
+
version_requirements: *2152380200
|
47
|
+
- !ruby/object:Gem::Dependency
|
50
48
|
name: erubis
|
51
|
-
requirement: &
|
49
|
+
requirement: &2152379500 !ruby/object:Gem::Requirement
|
52
50
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version:
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
57
55
|
type: :runtime
|
58
56
|
prerelease: false
|
59
|
-
version_requirements: *
|
60
|
-
- !ruby/object:Gem::Dependency
|
57
|
+
version_requirements: *2152379500
|
58
|
+
- !ruby/object:Gem::Dependency
|
61
59
|
name: i18n
|
62
|
-
requirement: &
|
60
|
+
requirement: &2152378620 !ruby/object:Gem::Requirement
|
63
61
|
none: false
|
64
|
-
requirements:
|
65
|
-
- -
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version:
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
68
66
|
type: :runtime
|
69
67
|
prerelease: false
|
70
|
-
version_requirements: *
|
71
|
-
- !ruby/object:Gem::Dependency
|
68
|
+
version_requirements: *2152378620
|
69
|
+
- !ruby/object:Gem::Dependency
|
72
70
|
name: activesupport
|
73
|
-
requirement: &
|
71
|
+
requirement: &2152373900 !ruby/object:Gem::Requirement
|
74
72
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version:
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
79
77
|
type: :runtime
|
80
78
|
prerelease: false
|
81
|
-
version_requirements: *
|
82
|
-
- !ruby/object:Gem::Dependency
|
79
|
+
version_requirements: *2152373900
|
80
|
+
- !ruby/object:Gem::Dependency
|
83
81
|
name: rake
|
84
|
-
requirement: &
|
82
|
+
requirement: &2152373120 !ruby/object:Gem::Requirement
|
85
83
|
none: false
|
86
|
-
requirements:
|
87
|
-
- -
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version:
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
90
88
|
type: :development
|
91
89
|
prerelease: false
|
92
|
-
version_requirements: *
|
93
|
-
- !ruby/object:Gem::Dependency
|
90
|
+
version_requirements: *2152373120
|
91
|
+
- !ruby/object:Gem::Dependency
|
94
92
|
name: rspec
|
95
|
-
requirement: &
|
93
|
+
requirement: &2152372280 !ruby/object:Gem::Requirement
|
96
94
|
none: false
|
97
|
-
requirements:
|
98
|
-
- -
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version:
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
101
99
|
type: :development
|
102
100
|
prerelease: false
|
103
|
-
version_requirements: *
|
104
|
-
- !ruby/object:Gem::Dependency
|
101
|
+
version_requirements: *2152372280
|
102
|
+
- !ruby/object:Gem::Dependency
|
105
103
|
name: watchr
|
106
|
-
requirement: &
|
104
|
+
requirement: &2152371480 !ruby/object:Gem::Requirement
|
107
105
|
none: false
|
108
|
-
requirements:
|
109
|
-
- -
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version:
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
112
110
|
type: :development
|
113
111
|
prerelease: false
|
114
|
-
version_requirements: *
|
115
|
-
- !ruby/object:Gem::Dependency
|
112
|
+
version_requirements: *2152371480
|
113
|
+
- !ruby/object:Gem::Dependency
|
116
114
|
name: haml
|
117
|
-
requirement: &
|
115
|
+
requirement: &2152370380 !ruby/object:Gem::Requirement
|
118
116
|
none: false
|
119
|
-
requirements:
|
120
|
-
- -
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version:
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
123
121
|
type: :development
|
124
122
|
prerelease: false
|
125
|
-
version_requirements: *
|
126
|
-
- !ruby/object:Gem::Dependency
|
123
|
+
version_requirements: *2152370380
|
124
|
+
- !ruby/object:Gem::Dependency
|
127
125
|
name: bundler
|
128
|
-
requirement: &
|
126
|
+
requirement: &2152369500 !ruby/object:Gem::Requirement
|
129
127
|
none: false
|
130
|
-
requirements:
|
131
|
-
- -
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version:
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
134
132
|
type: :development
|
135
133
|
prerelease: false
|
136
|
-
version_requirements: *
|
134
|
+
version_requirements: *2152369500
|
137
135
|
description: a code metric tool for rails codes, written in Ruby.
|
138
|
-
email:
|
136
|
+
email:
|
139
137
|
- flyerhzm@gmail.com
|
140
|
-
executables:
|
138
|
+
executables:
|
141
139
|
- rails_best_practices
|
142
140
|
extensions: []
|
143
|
-
|
144
141
|
extra_rdoc_files: []
|
145
|
-
|
146
|
-
files:
|
142
|
+
files:
|
147
143
|
- .gemtest
|
148
144
|
- .gitignore
|
149
145
|
- .rspec.example
|
@@ -174,6 +170,7 @@ files:
|
|
174
170
|
- lib/rails_best_practices/core/model_attributes.rb
|
175
171
|
- lib/rails_best_practices/core/models.rb
|
176
172
|
- lib/rails_best_practices/core/nil.rb
|
173
|
+
- lib/rails_best_practices/core/routes.rb
|
177
174
|
- lib/rails_best_practices/core/runner.rb
|
178
175
|
- lib/rails_best_practices/core_ext/enumerable.rb
|
179
176
|
- lib/rails_best_practices/core_ext/sexp.rb
|
@@ -184,6 +181,7 @@ files:
|
|
184
181
|
- lib/rails_best_practices/prepares/controller_prepare.rb
|
185
182
|
- lib/rails_best_practices/prepares/mailer_prepare.rb
|
186
183
|
- lib/rails_best_practices/prepares/model_prepare.rb
|
184
|
+
- lib/rails_best_practices/prepares/route_prepare.rb
|
187
185
|
- lib/rails_best_practices/prepares/schema_prepare.rb
|
188
186
|
- lib/rails_best_practices/reviews.rb
|
189
187
|
- lib/rails_best_practices/reviews/add_model_virtual_attribute_review.rb
|
@@ -201,6 +199,7 @@ files:
|
|
201
199
|
- lib/rails_best_practices/reviews/not_use_default_route_review.rb
|
202
200
|
- lib/rails_best_practices/reviews/overuse_route_customizations_review.rb
|
203
201
|
- lib/rails_best_practices/reviews/remove_empty_helpers_review.rb
|
202
|
+
- lib/rails_best_practices/reviews/remove_unused_methods_in_controllers_review.rb
|
204
203
|
- lib/rails_best_practices/reviews/remove_unused_methods_in_models_review.rb
|
205
204
|
- lib/rails_best_practices/reviews/replace_complex_creation_with_factory_method_review.rb
|
206
205
|
- lib/rails_best_practices/reviews/replace_instance_variable_with_local_variable_review.rb
|
@@ -231,6 +230,7 @@ files:
|
|
231
230
|
- spec/rails_best_practices/core/model_attributes_spec.rb
|
232
231
|
- spec/rails_best_practices/core/models_spec.rb
|
233
232
|
- spec/rails_best_practices/core/nil_spec.rb
|
233
|
+
- spec/rails_best_practices/core/routes_spec.rb
|
234
234
|
- spec/rails_best_practices/core/runner_spec.rb
|
235
235
|
- spec/rails_best_practices/core_ext/enumerable_spec.rb
|
236
236
|
- spec/rails_best_practices/core_ext/sexp_spec.rb
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- spec/rails_best_practices/prepares/controller_prepare_spec.rb
|
240
240
|
- spec/rails_best_practices/prepares/mailer_prepare_spec.rb
|
241
241
|
- spec/rails_best_practices/prepares/model_prepare_spec.rb
|
242
|
+
- spec/rails_best_practices/prepares/route_prepare_spec.rb
|
242
243
|
- spec/rails_best_practices/prepares/schema_prepare_spec.rb
|
243
244
|
- spec/rails_best_practices/reviews/add_model_virtual_attribute_review_spec.rb
|
244
245
|
- spec/rails_best_practices/reviews/always_add_db_index_review_spec.rb
|
@@ -255,6 +256,7 @@ files:
|
|
255
256
|
- spec/rails_best_practices/reviews/not_use_default_route_review_spec.rb
|
256
257
|
- spec/rails_best_practices/reviews/overuse_route_customizations_review_spec.rb
|
257
258
|
- spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
|
259
|
+
- spec/rails_best_practices/reviews/remove_unused_methods_in_controllers_review_spec.rb
|
258
260
|
- spec/rails_best_practices/reviews/remove_unused_methods_in_models_review_spec.rb
|
259
261
|
- spec/rails_best_practices/reviews/replace_complex_creation_with_factory_method_review_spec.rb
|
260
262
|
- spec/rails_best_practices/reviews/replace_instance_variable_with_local_variable_review_spec.rb
|
@@ -270,52 +272,37 @@ files:
|
|
270
272
|
- spec/rails_best_practices/reviews/use_scope_access_review_spec.rb
|
271
273
|
- spec/rails_best_practices_spec.rb
|
272
274
|
- spec/spec_helper.rb
|
273
|
-
has_rdoc: true
|
274
275
|
homepage: http://rails-bestpractices.com
|
275
276
|
licenses: []
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
rails_best_practices is a code metric tool to check the quality of rails codes.
|
281
|
-
|
282
|
-
I highly recommend you browse the Rails Best Practices website first.
|
283
|
-
|
284
|
-
http://rails-bestpractices.com
|
285
|
-
|
286
|
-
Enjoy!
|
287
|
-
|
288
|
-
Richard Huang (flyerhzm@gmail.com)
|
289
|
-
|
290
|
-
********************************************************************************
|
291
|
-
|
277
|
+
post_install_message: ! "********************************************************************************\n\n
|
278
|
+
\ rails_best_practices is a code metric tool to check the quality of rails codes.\n\n
|
279
|
+
\ I highly recommend you browse the Rails Best Practices website first.\n\n http://rails-bestpractices.com\n\n
|
280
|
+
\ Enjoy!\n\n Richard Huang (flyerhzm@gmail.com)\n\n********************************************************************************\n"
|
292
281
|
rdoc_options: []
|
293
|
-
|
294
|
-
require_paths:
|
282
|
+
require_paths:
|
295
283
|
- lib
|
296
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
284
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
297
285
|
none: false
|
298
|
-
requirements:
|
299
|
-
- -
|
300
|
-
- !ruby/object:Gem::Version
|
301
|
-
|
302
|
-
segments:
|
286
|
+
requirements:
|
287
|
+
- - ! '>='
|
288
|
+
- !ruby/object:Gem::Version
|
289
|
+
version: '0'
|
290
|
+
segments:
|
303
291
|
- 0
|
304
|
-
|
305
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
292
|
+
hash: 1634590398891543727
|
293
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
306
294
|
none: false
|
307
|
-
requirements:
|
308
|
-
- -
|
309
|
-
- !ruby/object:Gem::Version
|
295
|
+
requirements:
|
296
|
+
- - ! '>='
|
297
|
+
- !ruby/object:Gem::Version
|
310
298
|
version: 1.3.6
|
311
299
|
requirements: []
|
312
|
-
|
313
300
|
rubyforge_project:
|
314
|
-
rubygems_version: 1.
|
301
|
+
rubygems_version: 1.8.10
|
315
302
|
signing_key:
|
316
303
|
specification_version: 3
|
317
304
|
summary: a code metric tool for rails codes.
|
318
|
-
test_files:
|
305
|
+
test_files:
|
319
306
|
- spec/fixtures/lib/rails_best_practices/plugins/reviews/not_use_rails_root_review.rb
|
320
307
|
- spec/rails_best_practices/core/check_spec.rb
|
321
308
|
- spec/rails_best_practices/core/checking_visitor_spec.rb
|
@@ -328,6 +315,7 @@ test_files:
|
|
328
315
|
- spec/rails_best_practices/core/model_attributes_spec.rb
|
329
316
|
- spec/rails_best_practices/core/models_spec.rb
|
330
317
|
- spec/rails_best_practices/core/nil_spec.rb
|
318
|
+
- spec/rails_best_practices/core/routes_spec.rb
|
331
319
|
- spec/rails_best_practices/core/runner_spec.rb
|
332
320
|
- spec/rails_best_practices/core_ext/enumerable_spec.rb
|
333
321
|
- spec/rails_best_practices/core_ext/sexp_spec.rb
|
@@ -336,6 +324,7 @@ test_files:
|
|
336
324
|
- spec/rails_best_practices/prepares/controller_prepare_spec.rb
|
337
325
|
- spec/rails_best_practices/prepares/mailer_prepare_spec.rb
|
338
326
|
- spec/rails_best_practices/prepares/model_prepare_spec.rb
|
327
|
+
- spec/rails_best_practices/prepares/route_prepare_spec.rb
|
339
328
|
- spec/rails_best_practices/prepares/schema_prepare_spec.rb
|
340
329
|
- spec/rails_best_practices/reviews/add_model_virtual_attribute_review_spec.rb
|
341
330
|
- spec/rails_best_practices/reviews/always_add_db_index_review_spec.rb
|
@@ -352,6 +341,7 @@ test_files:
|
|
352
341
|
- spec/rails_best_practices/reviews/not_use_default_route_review_spec.rb
|
353
342
|
- spec/rails_best_practices/reviews/overuse_route_customizations_review_spec.rb
|
354
343
|
- spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
|
344
|
+
- spec/rails_best_practices/reviews/remove_unused_methods_in_controllers_review_spec.rb
|
355
345
|
- spec/rails_best_practices/reviews/remove_unused_methods_in_models_review_spec.rb
|
356
346
|
- spec/rails_best_practices/reviews/replace_complex_creation_with_factory_method_review_spec.rb
|
357
347
|
- spec/rails_best_practices/reviews/replace_instance_variable_with_local_variable_review_spec.rb
|