rails_best_practices 1.9.1 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/.rvmrc +1 -1
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +10 -2
  4. data/README.md +33 -27
  5. data/lib/rails_best_practices/analyzer.rb +13 -13
  6. data/lib/rails_best_practices/core/check.rb +7 -6
  7. data/lib/rails_best_practices/core/checking_visitor.rb +1 -1
  8. data/lib/rails_best_practices/core/runner.rb +2 -3
  9. data/lib/rails_best_practices/core_ext/sexp.rb +18 -17
  10. data/lib/rails_best_practices/lexicals.rb +1 -0
  11. data/lib/rails_best_practices/lexicals/long_line_check.rb +31 -0
  12. data/lib/rails_best_practices/prepares/config_prepare.rb +1 -1
  13. data/lib/rails_best_practices/reviews.rb +2 -0
  14. data/lib/rails_best_practices/reviews/add_model_virtual_attribute_review.rb +2 -2
  15. data/lib/rails_best_practices/reviews/always_add_db_index_review.rb +1 -1
  16. data/lib/rails_best_practices/reviews/hash_syntax_review.rb +63 -0
  17. data/lib/rails_best_practices/reviews/keep_finders_on_their_own_model_review.rb +1 -1
  18. data/lib/rails_best_practices/reviews/move_code_into_model_review.rb +1 -1
  19. data/lib/rails_best_practices/reviews/move_finder_to_named_scope_review.rb +1 -1
  20. data/lib/rails_best_practices/reviews/move_model_logic_into_model_review.rb +1 -1
  21. data/lib/rails_best_practices/reviews/needless_deep_nesting_review.rb +1 -1
  22. data/lib/rails_best_practices/reviews/overuse_route_customizations_review.rb +1 -1
  23. data/lib/rails_best_practices/reviews/protect_mass_assignment_review.rb +15 -6
  24. data/lib/rails_best_practices/reviews/remove_unused_methods_in_models_review.rb +4 -2
  25. data/lib/rails_best_practices/reviews/replace_complex_creation_with_factory_method_review.rb +8 -4
  26. data/lib/rails_best_practices/reviews/replace_instance_variable_with_local_variable_review.rb +2 -1
  27. data/lib/rails_best_practices/reviews/restrict_auto_generated_routes_review.rb +52 -8
  28. data/lib/rails_best_practices/reviews/simplify_render_in_views_review.rb +14 -2
  29. data/lib/rails_best_practices/reviews/use_before_filter_review.rb +8 -3
  30. data/lib/rails_best_practices/reviews/use_multipart_alternative_as_content_type_of_email_review.rb +2 -1
  31. data/lib/rails_best_practices/reviews/use_observer_review.rb +1 -1
  32. data/lib/rails_best_practices/reviews/use_parentheses_in_method_def_review.rb +33 -0
  33. data/lib/rails_best_practices/reviews/use_query_attribute_review.rb +16 -6
  34. data/lib/rails_best_practices/reviews/use_say_with_time_in_migrations_review.rb +9 -6
  35. data/lib/rails_best_practices/reviews/use_scope_access_review.rb +8 -3
  36. data/lib/rails_best_practices/version.rb +1 -1
  37. data/rails_best_practices.yml +28 -25
  38. data/rake_rubies.sh +1 -1
  39. data/spec/rails_best_practices/analyzer_spec.rb +1 -1
  40. data/spec/rails_best_practices/core/check_spec.rb +7 -7
  41. data/spec/rails_best_practices/core/checking_visitor_spec.rb +7 -7
  42. data/spec/rails_best_practices/core/error_spec.rb +12 -12
  43. data/spec/rails_best_practices/core_ext/sexp_spec.rb +103 -85
  44. data/spec/rails_best_practices/lexicals/long_line_check_spec.rb +47 -0
  45. data/spec/rails_best_practices/lexicals/remove_tab_check_spec.rb +1 -1
  46. data/spec/rails_best_practices/lexicals/remove_trailing_whitespace_check_spec.rb +1 -1
  47. data/spec/rails_best_practices/prepares/config_prepare_spec.rb +1 -1
  48. data/spec/rails_best_practices/prepares/controller_prepare_spec.rb +1 -1
  49. data/spec/rails_best_practices/prepares/helper_prepare_spec.rb +1 -1
  50. data/spec/rails_best_practices/prepares/mailer_prepare_spec.rb +1 -1
  51. data/spec/rails_best_practices/prepares/model_prepare_spec.rb +4 -4
  52. data/spec/rails_best_practices/prepares/route_prepare_spec.rb +54 -54
  53. data/spec/rails_best_practices/prepares/schema_prepare_spec.rb +6 -6
  54. data/spec/rails_best_practices/reviews/add_model_virtual_attribute_review_spec.rb +4 -4
  55. data/spec/rails_best_practices/reviews/always_add_db_index_review_spec.rb +46 -46
  56. data/spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb +3 -3
  57. data/spec/rails_best_practices/reviews/hash_syntax_review_spec.rb +67 -0
  58. data/spec/rails_best_practices/reviews/isolate_seed_data_review_spec.rb +8 -8
  59. data/spec/rails_best_practices/reviews/keep_finders_on_their_own_model_review_spec.rb +9 -9
  60. data/spec/rails_best_practices/reviews/law_of_demeter_review_spec.rb +7 -7
  61. data/spec/rails_best_practices/reviews/move_code_into_controller_review_spec.rb +1 -1
  62. data/spec/rails_best_practices/reviews/move_code_into_helper_review_spec.rb +1 -1
  63. data/spec/rails_best_practices/reviews/move_code_into_model_review_spec.rb +1 -1
  64. data/spec/rails_best_practices/reviews/move_finder_to_named_scope_review_spec.rb +13 -13
  65. data/spec/rails_best_practices/reviews/move_model_logic_into_model_review_spec.rb +2 -2
  66. data/spec/rails_best_practices/reviews/needless_deep_nesting_review_spec.rb +3 -3
  67. data/spec/rails_best_practices/reviews/not_use_default_route_review_spec.rb +3 -3
  68. data/spec/rails_best_practices/reviews/not_use_times_ago_in_words_review_spec.rb +1 -1
  69. data/spec/rails_best_practices/reviews/overuse_route_customizations_review_spec.rb +26 -26
  70. data/spec/rails_best_practices/reviews/protect_mass_assignment_review_spec.rb +11 -2
  71. data/spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb +1 -1
  72. data/spec/rails_best_practices/reviews/remove_unused_methods_in_controllers_review_spec.rb +8 -8
  73. data/spec/rails_best_practices/reviews/remove_unused_methods_in_helpers_review_spec.rb +2 -2
  74. data/spec/rails_best_practices/reviews/remove_unused_methods_in_models_review_spec.rb +25 -10
  75. data/spec/rails_best_practices/reviews/replace_complex_creation_with_factory_method_review_spec.rb +3 -3
  76. data/spec/rails_best_practices/reviews/replace_instance_variable_with_local_variable_review_spec.rb +1 -1
  77. data/spec/rails_best_practices/reviews/restrict_auto_generated_routes_review_spec.rb +28 -28
  78. data/spec/rails_best_practices/reviews/simplify_render_in_controllers_review_spec.rb +4 -4
  79. data/spec/rails_best_practices/reviews/simplify_render_in_views_review_spec.rb +15 -7
  80. data/spec/rails_best_practices/reviews/use_before_filter_review_spec.rb +3 -3
  81. data/spec/rails_best_practices/reviews/use_model_association_review_spec.rb +3 -3
  82. data/spec/rails_best_practices/reviews/use_multipart_alternative_as_content_type_of_email_review_spec.rb +3 -3
  83. data/spec/rails_best_practices/reviews/use_observer_review_spec.rb +5 -5
  84. data/spec/rails_best_practices/reviews/use_parenthesis_in_method_def_spec.rb +41 -0
  85. data/spec/rails_best_practices/reviews/use_query_attribute_review_spec.rb +3 -3
  86. data/spec/rails_best_practices/reviews/use_say_with_time_in_migrations_review_spec.rb +8 -8
  87. data/spec/rails_best_practices/reviews/use_scope_access_review_spec.rb +9 -9
  88. data/spec/spec_helper.rb +1 -1
  89. metadata +36 -29
  90. data/.rspec.example +0 -2
  91. data/.rvmrc.example +0 -2
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module RailsBestPractices
4
4
  module Reviews
5
5
  describe UseBeforeFilterReview do
6
- let(:runner) { Core::Runner.new(:reviews => UseBeforeFilterReview.new('customize_count' => 2)) }
6
+ let(:runner) { Core::Runner.new(reviews: UseBeforeFilterReview.new('customize_count' => 2)) }
7
7
 
8
8
  it "should use before_filter" do
9
9
  content = <<-EOF
@@ -29,7 +29,7 @@ module RailsBestPractices
29
29
  EOF
30
30
  runner.review('app/controllers/posts_controller.rb', content)
31
31
  runner.should have(1).errors
32
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:3,7,11,16 - use before_filter for show,edit,update,destroy"
32
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:2,6,10,15 - use before_filter for show,edit,update,destroy"
33
33
  end
34
34
 
35
35
  it "should not use before_filter when equal to customize count" do
@@ -51,7 +51,7 @@ module RailsBestPractices
51
51
  it "should not use before_filter" do
52
52
  content = <<-EOF
53
53
  class PostsController < ApplicationController
54
- before_filter :find_post, :only => [:show, :edit, :update, :destroy]
54
+ before_filter :find_post, only: [:show, :edit, :update, :destroy]
55
55
 
56
56
  def update
57
57
  @post.update_attributes(params[:post])
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module RailsBestPractices
4
4
  module Reviews
5
5
  describe UseModelAssociationReview do
6
- let(:runner) { Core::Runner.new(:reviews => UseModelAssociationReview.new) }
6
+ let(:runner) { Core::Runner.new(reviews: UseModelAssociationReview.new) }
7
7
 
8
8
  it "should use model association for instance variable" do
9
9
  content = <<-EOF
@@ -17,7 +17,7 @@ module RailsBestPractices
17
17
  EOF
18
18
  runner.review('app/controllers/posts_controller.rb', content)
19
19
  runner.should have(1).errors
20
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:3 - use model association (for @post)"
20
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:2 - use model association (for @post)"
21
21
  end
22
22
 
23
23
  it "should not use model association without association assign" do
@@ -45,7 +45,7 @@ module RailsBestPractices
45
45
  EOF
46
46
  runner.review('app/controllers/posts_controller.rb', content)
47
47
  runner.should have(1).errors
48
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:3 - use model association (for post)"
48
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:2 - use model association (for post)"
49
49
  end
50
50
 
51
51
  it "should not use model association" do
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module RailsBestPractices
4
4
  module Reviews
5
5
  describe UseMultipartAlternativeAsContentTypeOfEmailReview do
6
- let(:runner) { Core::Runner.new(:reviews => UseMultipartAlternativeAsContentTypeOfEmailReview.new) }
6
+ let(:runner) { Core::Runner.new(reviews: UseMultipartAlternativeAsContentTypeOfEmailReview.new) }
7
7
 
8
8
  before(:each) { Core::Runner.stub!(:base_path).and_return(".") }
9
9
 
@@ -35,7 +35,7 @@ module RailsBestPractices
35
35
  from email.from
36
36
  recipients email.recipients
37
37
  sent_on Time.now
38
- body :email => email
38
+ body email: email
39
39
  end
40
40
  end
41
41
  EOF
@@ -149,7 +149,7 @@ module RailsBestPractices
149
149
  from email.from
150
150
  recipients email.recipients
151
151
  sent_on Time.now
152
- body :email => email
152
+ body email: email
153
153
  end
154
154
  end
155
155
  EOF
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module RailsBestPractices
4
4
  module Reviews
5
5
  describe UseObserverReview do
6
- let(:runner) { Core::Runner.new(:prepares => Prepares::MailerPrepare.new, :reviews => UseObserverReview.new) }
6
+ let(:runner) { Core::Runner.new(prepares: Prepares::MailerPrepare.new, reviews: UseObserverReview.new) }
7
7
 
8
8
  before :each do
9
9
  content =<<-EOF
@@ -29,7 +29,7 @@ module RailsBestPractices
29
29
  EOF
30
30
  runner.review('app/models/project.rb', content)
31
31
  runner.should have(1).errors
32
- runner.errors[0].to_s.should == "app/models/project.rb:6 - use observer"
32
+ runner.errors[0].to_s.should == "app/models/project.rb:5 - use observer"
33
33
  end
34
34
 
35
35
  it "should not use observer without callback" do
@@ -65,7 +65,7 @@ module RailsBestPractices
65
65
  EOF
66
66
  runner.review('app/models/project.rb', content)
67
67
  runner.should have(1).errors
68
- runner.errors[0].to_s.should == "app/models/project.rb:6 - use observer"
68
+ runner.errors[0].to_s.should == "app/models/project.rb:5 - use observer"
69
69
  end
70
70
 
71
71
  it "should not raise when initiate an object in callback" do
@@ -94,7 +94,7 @@ module RailsBestPractices
94
94
  EOF
95
95
  runner.review('app/models/project.rb', content)
96
96
  runner.should have(1).errors
97
- runner.errors[0].to_s.should == "app/models/project.rb:6 - use observer"
97
+ runner.errors[0].to_s.should == "app/models/project.rb:5 - use observer"
98
98
  end
99
99
 
100
100
  it "should not use observer without callback" do
@@ -130,7 +130,7 @@ module RailsBestPractices
130
130
  EOF
131
131
  runner.review('app/models/project.rb', content)
132
132
  runner.should have(1).errors
133
- runner.errors[0].to_s.should == "app/models/project.rb:6 - use observer"
133
+ runner.errors[0].to_s.should == "app/models/project.rb:5 - use observer"
134
134
  end
135
135
 
136
136
  it "should not raise when initiate an object in callback" do
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+
3
+ module RailsBestPractices
4
+ module Reviews
5
+ describe UseParenthesesInMethodDefReview do
6
+ let(:runner) { Core::Runner.new(reviews: UseParenthesesInMethodDefReview.new) }
7
+
8
+ it "should find missing parentheses" do
9
+ content = <<-EOF
10
+ class PostsController < ApplicationController
11
+ def edit foo, bar
12
+ end
13
+ end
14
+ EOF
15
+ runner.review('app/controllers/posts_controller.rb', content)
16
+ runner.should have(1).errors
17
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:2 - use parentheses around parameters in method definitions"
18
+ end
19
+ it "should find parentheses with no error" do
20
+ content = <<-EOF
21
+ class PostsController < ApplicationController
22
+ def edit(foo, bar)
23
+ end
24
+ end
25
+ EOF
26
+ runner.review('app/controllers/posts_controller.rb', content)
27
+ runner.should have(0).errors
28
+ end
29
+ it "should not throw an error without parameters" do
30
+ content = <<-EOF
31
+ class PostsController < ApplicationController
32
+ def edit
33
+ end
34
+ end
35
+ EOF
36
+ runner.review('app/controllers/posts_controller.rb', content)
37
+ runner.should have(0).errors
38
+ end
39
+ end
40
+ end
41
+ end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module RailsBestPractices
4
4
  module Reviews
5
5
  describe UseQueryAttributeReview do
6
- let(:runner) { Core::Runner.new(:prepares => [Prepares::ModelPrepare.new, Prepares::SchemaPrepare.new], :reviews => UseQueryAttributeReview.new) }
6
+ let(:runner) { Core::Runner.new(prepares: [Prepares::ModelPrepare.new, Prepares::SchemaPrepare.new], reviews: UseQueryAttributeReview.new) }
7
7
 
8
8
  before :each do
9
9
  content = <<-EOF
@@ -12,13 +12,13 @@ module RailsBestPractices
12
12
  belongs_to :location
13
13
  has_one :phone
14
14
 
15
- belongs_to :category, :class_name => 'IssueCategory', :foreign_key => 'category_id'
15
+ belongs_to :category, class_name: 'IssueCategory', foreign_key: 'category_id'
16
16
  end
17
17
  EOF
18
18
  runner.prepare('app/models/user.rb', content)
19
19
 
20
20
  content = <<-EOF
21
- ActiveRecord::Schema.define(:version => 20110216150853) do
21
+ ActiveRecord::Schema.define(version: 20110216150853) do
22
22
  create_table "users", force => true do |t|
23
23
  t.string :login
24
24
  t.integer :age
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module RailsBestPractices
4
4
  module Reviews
5
5
  describe UseSayWithTimeInMigrationsReview do
6
- let(:runner) { Core::Runner.new(:reviews => UseSayWithTimeInMigrationsReview.new) }
6
+ let(:runner) { Core::Runner.new(reviews: UseSayWithTimeInMigrationsReview.new) }
7
7
 
8
8
  it "should use say with time in migrations" do
9
9
  content =<<-EOF
@@ -93,18 +93,18 @@ module RailsBestPractices
93
93
  end
94
94
 
95
95
  def self.up
96
- add_column :people, :admin, :boolean, :default => false, :null => false
96
+ add_column :people, :admin, :boolean, default: false, null: false
97
97
  add_column :people, :deactivated, :boolean,
98
- :default => false, :null => false
98
+ default: false, null: false
99
99
 
100
100
  key = Crypto::Key.from_file("\#{RAILS_ROOT}/rsa_key.pub")
101
- person = Person.new(:email => "admin@example.com",
102
- :name => "admin",
103
- :crypted_password => key.encrypt("admin"),
104
- :description => "")
101
+ person = Person.new(email: "admin@example.com",
102
+ name: "admin",
103
+ crypted_password: key.encrypt("admin"),
104
+ description: "")
105
105
  person.admin = true
106
106
  person.save!
107
- Blog.create(:person_id => person.id)
107
+ Blog.create(person_id: person.id)
108
108
  end
109
109
 
110
110
  def self.down
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module RailsBestPractices
4
4
  module Reviews
5
5
  describe UseScopeAccessReview do
6
- let(:runner) { Core::Runner.new(:reviews => UseScopeAccessReview.new) }
6
+ let(:runner) { Core::Runner.new(reviews: UseScopeAccessReview.new) }
7
7
 
8
8
  context "if" do
9
9
  it "shoud use scope access" do
@@ -21,7 +21,7 @@ module RailsBestPractices
21
21
  EOF
22
22
  runner.review('app/controllers/posts_controller.rb', content)
23
23
  runner.should have(1).errors
24
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:6 - use scope access"
24
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:5 - use scope access"
25
25
  end
26
26
 
27
27
  it "shoud use scope access by comparing with id" do
@@ -39,7 +39,7 @@ module RailsBestPractices
39
39
  EOF
40
40
  runner.review('app/controllers/posts_controller.rb', content)
41
41
  runner.should have(1).errors
42
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:6 - use scope access"
42
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:5 - use scope access"
43
43
  end
44
44
 
45
45
  it "shoud use scope access with current_user ==" do
@@ -57,7 +57,7 @@ module RailsBestPractices
57
57
  EOF
58
58
  runner.review('app/controllers/posts_controller.rb', content)
59
59
  runner.should have(1).errors
60
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:6 - use scope access"
60
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:5 - use scope access"
61
61
  end
62
62
 
63
63
  it "shoud use scope access by current_user.id ==" do
@@ -75,7 +75,7 @@ module RailsBestPractices
75
75
  EOF
76
76
  runner.review('app/controllers/posts_controller.rb', content)
77
77
  runner.should have(1).errors
78
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:6 - use scope access"
78
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:5 - use scope access"
79
79
  end
80
80
  end
81
81
 
@@ -95,7 +95,7 @@ module RailsBestPractices
95
95
  EOF
96
96
  runner.review('app/controllers/posts_controller.rb', content)
97
97
  runner.should have(1).errors
98
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:6 - use scope access"
98
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:5 - use scope access"
99
99
  end
100
100
 
101
101
  it "shoud use scope access by comparing with id" do
@@ -113,7 +113,7 @@ module RailsBestPractices
113
113
  EOF
114
114
  runner.review('app/controllers/posts_controller.rb', content)
115
115
  runner.should have(1).errors
116
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:6 - use scope access"
116
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:5 - use scope access"
117
117
  end
118
118
 
119
119
  it "shoud use scope access with current_user ==" do
@@ -131,7 +131,7 @@ module RailsBestPractices
131
131
  EOF
132
132
  runner.review('app/controllers/posts_controller.rb', content)
133
133
  runner.should have(1).errors
134
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:6 - use scope access"
134
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:5 - use scope access"
135
135
  end
136
136
 
137
137
  it "shoud use scope access by current_user.id ==" do
@@ -149,7 +149,7 @@ module RailsBestPractices
149
149
  EOF
150
150
  runner.review('app/controllers/posts_controller.rb', content)
151
151
  runner.should have(1).errors
152
- runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:6 - use scope access"
152
+ runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:5 - use scope access"
153
153
  end
154
154
 
155
155
  it "should no error in use_scope_access_review" do
data/spec/spec_helper.rb CHANGED
@@ -8,7 +8,7 @@ RSpec.configure do |config|
8
8
  config.after do
9
9
  RailsBestPractices::Prepares.clear
10
10
  end
11
- config.filter_run :focus => true
11
+ config.filter_run focus: true
12
12
  config.run_all_when_everything_filtered = true
13
13
  end
14
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_best_practices
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.10.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-19 00:00:00.000000000 Z
12
+ date: 2012-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sexp_processor
16
- requirement: &70273211510520 !ruby/object:Gem::Requirement
16
+ requirement: &70312121266920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70273211510520
24
+ version_requirements: *70312121266920
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: progressbar
27
- requirement: &70273211510000 !ruby/object:Gem::Requirement
27
+ requirement: &70312121266140 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70273211510000
35
+ version_requirements: *70312121266140
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: colored
38
- requirement: &70273211509320 !ruby/object:Gem::Requirement
38
+ requirement: &70312121264060 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70273211509320
46
+ version_requirements: *70312121264060
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: erubis
49
- requirement: &70273211508720 !ruby/object:Gem::Requirement
49
+ requirement: &70312121262840 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70273211508720
57
+ version_requirements: *70312121262840
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: i18n
60
- requirement: &70273211508220 !ruby/object:Gem::Requirement
60
+ requirement: &70312121261320 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70273211508220
68
+ version_requirements: *70312121261320
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
- requirement: &70273211507520 !ruby/object:Gem::Requirement
71
+ requirement: &70312121281720 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70273211507520
79
+ version_requirements: *70312121281720
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: awesome_print
82
- requirement: &70273211506140 !ruby/object:Gem::Requirement
82
+ requirement: &70312121280640 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70273211506140
90
+ version_requirements: *70312121280640
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rake
93
- requirement: &70273211504420 !ruby/object:Gem::Requirement
93
+ requirement: &70312121279160 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70273211504420
101
+ version_requirements: *70312121279160
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rspec
104
- requirement: &70273211503240 !ruby/object:Gem::Requirement
104
+ requirement: &70312121276940 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70273211503240
112
+ version_requirements: *70312121276940
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: haml
115
- requirement: &70273211502360 !ruby/object:Gem::Requirement
115
+ requirement: &70312121275740 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70273211502360
123
+ version_requirements: *70312121275740
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: slim
126
- requirement: &70273211501280 !ruby/object:Gem::Requirement
126
+ requirement: &70312121295400 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70273211501280
134
+ version_requirements: *70312121295400
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: bundler
137
- requirement: &70273211500360 !ruby/object:Gem::Requirement
137
+ requirement: &70312121292680 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,7 +142,7 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70273211500360
145
+ version_requirements: *70312121292680
146
146
  description: a code metric tool for rails codes, written in Ruby.
147
147
  email:
148
148
  - flyerhzm@gmail.com
@@ -154,9 +154,7 @@ files:
154
154
  - .gemtest
155
155
  - .gitignore
156
156
  - .rspec
157
- - .rspec.example
158
157
  - .rvmrc
159
- - .rvmrc.example
160
158
  - .travis.yml
161
159
  - Gemfile
162
160
  - Gemfile.lock
@@ -191,6 +189,7 @@ files:
191
189
  - lib/rails_best_practices/core_ext/erubis.rb
192
190
  - lib/rails_best_practices/core_ext/sexp.rb
193
191
  - lib/rails_best_practices/lexicals.rb
192
+ - lib/rails_best_practices/lexicals/long_line_check.rb
194
193
  - lib/rails_best_practices/lexicals/remove_tab_check.rb
195
194
  - lib/rails_best_practices/lexicals/remove_trailing_whitespace_check.rb
196
195
  - lib/rails_best_practices/prepares.rb
@@ -205,6 +204,7 @@ files:
205
204
  - lib/rails_best_practices/reviews/add_model_virtual_attribute_review.rb
206
205
  - lib/rails_best_practices/reviews/always_add_db_index_review.rb
207
206
  - lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb
207
+ - lib/rails_best_practices/reviews/hash_syntax_review.rb
208
208
  - lib/rails_best_practices/reviews/isolate_seed_data_review.rb
209
209
  - lib/rails_best_practices/reviews/keep_finders_on_their_own_model_review.rb
210
210
  - lib/rails_best_practices/reviews/law_of_demeter_review.rb
@@ -232,6 +232,7 @@ files:
232
232
  - lib/rails_best_practices/reviews/use_model_association_review.rb
233
233
  - lib/rails_best_practices/reviews/use_multipart_alternative_as_content_type_of_email_review.rb
234
234
  - lib/rails_best_practices/reviews/use_observer_review.rb
235
+ - lib/rails_best_practices/reviews/use_parentheses_in_method_def_review.rb
235
236
  - lib/rails_best_practices/reviews/use_query_attribute_review.rb
236
237
  - lib/rails_best_practices/reviews/use_say_with_time_in_migrations_review.rb
237
238
  - lib/rails_best_practices/reviews/use_scope_access_review.rb
@@ -260,6 +261,7 @@ files:
260
261
  - spec/rails_best_practices/core_ext/enumerable_spec.rb
261
262
  - spec/rails_best_practices/core_ext/erubis_spec.rb
262
263
  - spec/rails_best_practices/core_ext/sexp_spec.rb
264
+ - spec/rails_best_practices/lexicals/long_line_check_spec.rb
263
265
  - spec/rails_best_practices/lexicals/remove_tab_check_spec.rb
264
266
  - spec/rails_best_practices/lexicals/remove_trailing_whitespace_check_spec.rb
265
267
  - spec/rails_best_practices/prepares/config_prepare_spec.rb
@@ -272,6 +274,7 @@ files:
272
274
  - spec/rails_best_practices/reviews/add_model_virtual_attribute_review_spec.rb
273
275
  - spec/rails_best_practices/reviews/always_add_db_index_review_spec.rb
274
276
  - spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
277
+ - spec/rails_best_practices/reviews/hash_syntax_review_spec.rb
275
278
  - spec/rails_best_practices/reviews/isolate_seed_data_review_spec.rb
276
279
  - spec/rails_best_practices/reviews/keep_finders_on_their_own_model_review_spec.rb
277
280
  - spec/rails_best_practices/reviews/law_of_demeter_review_spec.rb
@@ -298,6 +301,7 @@ files:
298
301
  - spec/rails_best_practices/reviews/use_model_association_review_spec.rb
299
302
  - spec/rails_best_practices/reviews/use_multipart_alternative_as_content_type_of_email_review_spec.rb
300
303
  - spec/rails_best_practices/reviews/use_observer_review_spec.rb
304
+ - spec/rails_best_practices/reviews/use_parenthesis_in_method_def_spec.rb
301
305
  - spec/rails_best_practices/reviews/use_query_attribute_review_spec.rb
302
306
  - spec/rails_best_practices/reviews/use_say_with_time_in_migrations_review_spec.rb
303
307
  - spec/rails_best_practices/reviews/use_scope_access_review_spec.rb
@@ -321,7 +325,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
321
325
  version: '0'
322
326
  segments:
323
327
  - 0
324
- hash: 1930159151247489089
328
+ hash: -3377092891025064967
325
329
  required_rubygems_version: !ruby/object:Gem::Requirement
326
330
  none: false
327
331
  requirements:
@@ -356,6 +360,7 @@ test_files:
356
360
  - spec/rails_best_practices/core_ext/enumerable_spec.rb
357
361
  - spec/rails_best_practices/core_ext/erubis_spec.rb
358
362
  - spec/rails_best_practices/core_ext/sexp_spec.rb
363
+ - spec/rails_best_practices/lexicals/long_line_check_spec.rb
359
364
  - spec/rails_best_practices/lexicals/remove_tab_check_spec.rb
360
365
  - spec/rails_best_practices/lexicals/remove_trailing_whitespace_check_spec.rb
361
366
  - spec/rails_best_practices/prepares/config_prepare_spec.rb
@@ -368,6 +373,7 @@ test_files:
368
373
  - spec/rails_best_practices/reviews/add_model_virtual_attribute_review_spec.rb
369
374
  - spec/rails_best_practices/reviews/always_add_db_index_review_spec.rb
370
375
  - spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
376
+ - spec/rails_best_practices/reviews/hash_syntax_review_spec.rb
371
377
  - spec/rails_best_practices/reviews/isolate_seed_data_review_spec.rb
372
378
  - spec/rails_best_practices/reviews/keep_finders_on_their_own_model_review_spec.rb
373
379
  - spec/rails_best_practices/reviews/law_of_demeter_review_spec.rb
@@ -394,6 +400,7 @@ test_files:
394
400
  - spec/rails_best_practices/reviews/use_model_association_review_spec.rb
395
401
  - spec/rails_best_practices/reviews/use_multipart_alternative_as_content_type_of_email_review_spec.rb
396
402
  - spec/rails_best_practices/reviews/use_observer_review_spec.rb
403
+ - spec/rails_best_practices/reviews/use_parenthesis_in_method_def_spec.rb
397
404
  - spec/rails_best_practices/reviews/use_query_attribute_review_spec.rb
398
405
  - spec/rails_best_practices/reviews/use_say_with_time_in_migrations_review_spec.rb
399
406
  - spec/rails_best_practices/reviews/use_scope_access_review_spec.rb