rails_best_practices 1.13.4 → 1.13.5
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 +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/Gemfile +3 -1
- data/README.md +5 -4
- data/assets/result.html.erb +1 -1
- data/lib/rails_best_practices/analyzer.rb +11 -6
- data/lib/rails_best_practices/core/check.rb +7 -1
- data/lib/rails_best_practices/prepares/model_prepare.rb +3 -1
- data/lib/rails_best_practices/reviews/protect_mass_assignment_review.rb +3 -3
- data/lib/rails_best_practices/version.rb +1 -1
- data/rails_best_practices.yml +1 -1
- data/spec/rails_best_practices/analyzer_spec.rb +72 -2
- data/spec/rails_best_practices/prepares/model_prepare_spec.rb +17 -0
- data/spec/rails_best_practices/reviews/protect_mass_assignment_review_spec.rb +27 -20
- data/spec/spec_helper.rb +2 -0
- metadata +50 -62
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c85e47e8a7e3168810ac545ece3d4dd9074c8325
|
4
|
+
data.tar.gz: 969e22d76e6815743f3971e61d495c875f37d4fc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4501aedb47b7c816495cda8936edd10a86d1f5025ac0dca814620d7a6cfedc7f7d3265540492d5fecdf332cd7e3cee908c08f5e1bef7b69b2d691e42acdb4c6f
|
7
|
+
data.tar.gz: d481948983897dc84fe224e4d2cea953123b9ad3838c0e0c619c24e93a78fe7c3973b68911871bbfaac95b06038f54a3db42a95efd2b2e435b59c617847cadcb
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
repo_token: HdiJjr0c7NCGp2GIL3areCAENLRMT21Er
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# rails_best_practices
|
2
2
|
|
3
3
|
[](http://travis-ci.org/railsbp/rails_best_practices)
|
4
|
-
|
4
|
+
[](https://coveralls.io/r/railsbp/rails_best_practices)
|
5
6
|
[](http://coderwall.com/flyerhzm)
|
6
7
|
|
7
8
|
[](http://www.pledgie.com/campaigns/12057)
|
@@ -48,7 +49,7 @@ By default rails_best_practices will do parse codes in vendor, spec, test and fe
|
|
48
49
|
--with-textmate open file by textmate in html format
|
49
50
|
--with-sublime open file by sublime in html format (requires https://github.com/asuth/subl-handler)
|
50
51
|
--with-mvim open file by mvim in html format
|
51
|
-
--with-github GITHUB_NAME open file on github in html format. GITHUB_NAME is like railsbp/rails-bestpractices
|
52
|
+
--with-github GITHUB_NAME open file on github in html format. GITHUB_NAME is like railsbp/rails-bestpractices OR full URL to GitHub:FI repo
|
52
53
|
--with-hg display hg commit and username, only support html format
|
53
54
|
--with-git display git commit and username, only support html format
|
54
55
|
--template TEMPLATE customize erb template
|
@@ -93,7 +94,7 @@ rails_best_practices gem is rewritten based on ripper instead of ruby_parser to
|
|
93
94
|
or add in Gemfile
|
94
95
|
|
95
96
|
gem "rails_best_practices"
|
96
|
-
|
97
|
+
|
97
98
|
#### --with-sublime
|
98
99
|
|
99
100
|
Install <https://github.com/asuth/subl-handler>
|
@@ -122,7 +123,7 @@ Now you can customize this configuration file, the default configuration is as f
|
|
122
123
|
|
123
124
|
AddModelVirtualAttributeCheck: { }
|
124
125
|
AlwaysAddDbIndexCheck: { }
|
125
|
-
CheckSaveReturnValueCheck: { }
|
126
|
+
#CheckSaveReturnValueCheck: { }
|
126
127
|
DryBundlerInCapistranoCheck: { }
|
127
128
|
#HashSyntaxCheck: { }
|
128
129
|
IsolateSeedDataCheck: { }
|
data/assets/result.html.erb
CHANGED
@@ -111,7 +111,7 @@
|
|
111
111
|
<tr class="<%= error.type.split(':').last %>">
|
112
112
|
<td class='filename'>
|
113
113
|
<% if @github %>
|
114
|
-
<a href='
|
114
|
+
<a href='<%= @github_name %>/blob/<%= @last_commit_id %>/<%= error.short_filename %>#L<%= error.first_line_number %>' target='_blank'><%= error.short_filename %></a>
|
115
115
|
<% elsif @textmate %>
|
116
116
|
<a href='txmt://open/?url=file://<%= File.expand_path(error.filename) %>&line=<%= error.line_number %>'><%= error.short_filename %></a>
|
117
117
|
<% elsif @sublime %>
|
@@ -18,16 +18,21 @@ module RailsBestPractices
|
|
18
18
|
# After analyzing, output the violations.
|
19
19
|
class Analyzer
|
20
20
|
attr_accessor :runner
|
21
|
+
attr_reader :path
|
21
22
|
|
22
23
|
DEFAULT_CONFIG = File.join(File.dirname(__FILE__), "..", "..", "rails_best_practices.yml")
|
24
|
+
GITHUB_URL = 'https://github.com/'
|
23
25
|
|
24
26
|
# initialize
|
25
27
|
#
|
26
28
|
# @param [String] path where to generate the configuration yaml file
|
27
29
|
# @param [Hash] options
|
28
30
|
def initialize(path, options={})
|
29
|
-
@path = path || "."
|
31
|
+
@path = File.expand_path(path || ".")
|
32
|
+
|
30
33
|
@options = options
|
34
|
+
@options["exclude"] ||= []
|
35
|
+
@options["only"] ||= []
|
31
36
|
end
|
32
37
|
|
33
38
|
# generate configuration yaml file.
|
@@ -47,9 +52,6 @@ module RailsBestPractices
|
|
47
52
|
# @param [String] path the directory of rails project
|
48
53
|
# @param [Hash] options
|
49
54
|
def analyze
|
50
|
-
@options["exclude"] ||= []
|
51
|
-
@options["only"] ||= []
|
52
|
-
|
53
55
|
Core::Runner.base_path = @path
|
54
56
|
@runner = Core::Runner.new
|
55
57
|
|
@@ -105,8 +107,8 @@ module RailsBestPractices
|
|
105
107
|
end
|
106
108
|
|
107
109
|
# By default, tmp, vender, spec, test, features are ignored.
|
108
|
-
["vendor", "spec", "test", "features", "tmp"].each do |
|
109
|
-
files = file_ignore(files,
|
110
|
+
["vendor", "spec", "test", "features", "tmp"].each do |dir|
|
111
|
+
files = file_ignore(files, File.join(@path, dir)) unless @options[dir]
|
110
112
|
end
|
111
113
|
|
112
114
|
# Exclude files based on exclude regexes if the option is set.
|
@@ -219,6 +221,9 @@ module RailsBestPractices
|
|
219
221
|
|
220
222
|
if @options["with-github"]
|
221
223
|
last_commit_id = @options["last-commit-id"] ? @options["last-commit-id"] : `cd #{@runner.class.base_path} && git rev-parse HEAD`.chomp
|
224
|
+
unless @options["github-name"].start_with?('http')
|
225
|
+
@options["github-name"] = GITHUB_URL + @options["github-name"]
|
226
|
+
end
|
222
227
|
end
|
223
228
|
File.open(@options["output-file"], "w+") do |file|
|
224
229
|
eruby = Erubis::Eruby.new(template)
|
@@ -118,11 +118,13 @@ module RailsBestPractices
|
|
118
118
|
# remember the class anem
|
119
119
|
add_callback :start_class do |node|
|
120
120
|
@klass = Core::Klass.new(node.class_name.to_s, node.base_class.to_s, classable_modules)
|
121
|
+
klasses << @klass
|
121
122
|
end
|
122
123
|
|
123
124
|
# end of the class
|
124
125
|
add_callback :end_class do |node|
|
125
|
-
|
126
|
+
klasses.pop
|
127
|
+
# @klass = nil
|
126
128
|
end
|
127
129
|
end
|
128
130
|
end
|
@@ -141,6 +143,10 @@ module RailsBestPractices
|
|
141
143
|
def classable_modules
|
142
144
|
@class_moduels ||= []
|
143
145
|
end
|
146
|
+
|
147
|
+
def klasses
|
148
|
+
@klasses ||= []
|
149
|
+
end
|
144
150
|
end
|
145
151
|
|
146
152
|
# Helper to parse the module name.
|
@@ -40,7 +40,9 @@ module RailsBestPractices
|
|
40
40
|
# }
|
41
41
|
# }
|
42
42
|
add_callback :start_def do |node|
|
43
|
-
if @klass &&
|
43
|
+
if @klass &&
|
44
|
+
"ActionMailer::Base" != current_extend_class_name &&
|
45
|
+
(classable_modules.empty? || klasses.any?)
|
44
46
|
method_name = node.method_name.to_s
|
45
47
|
@methods.add_method(current_class_name, method_name, {"file" => node.file, "line" => node.line}, current_access_control)
|
46
48
|
end
|
@@ -20,13 +20,13 @@ module RailsBestPractices
|
|
20
20
|
# we treat it as mass assignment by default.
|
21
21
|
add_callback :start_class do |node|
|
22
22
|
@mass_assignement = true
|
23
|
+
check_whitelist_attributes_config
|
23
24
|
end
|
24
25
|
|
25
26
|
# check if it is ActiveRecord::Base subclass and
|
26
27
|
# if it sets config.active_record.whitelist_attributes to true.
|
27
28
|
add_callback :end_class do |node|
|
28
29
|
check_active_record(node)
|
29
|
-
check_whitelist_attributes_config
|
30
30
|
|
31
31
|
add_error "protect mass assignment" if @mass_assignement
|
32
32
|
end
|
@@ -54,12 +54,12 @@ module RailsBestPractices
|
|
54
54
|
private
|
55
55
|
def check_whitelist_attributes_config
|
56
56
|
if "true" == Prepares.configs["config.active_record.whitelist_attributes"]
|
57
|
-
@
|
57
|
+
@whitelist_attributes = true
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
61
|
def check_rails_builtin(node)
|
62
|
-
if [node.to_s, node.message.to_s].any? { |str| %w(attr_accessible attr_protected).include? str }
|
62
|
+
if @whitelist_attributes && [node.to_s, node.message.to_s].any? { |str| %w(attr_accessible attr_protected).include? str }
|
63
63
|
@mass_assignement = false
|
64
64
|
end
|
65
65
|
end
|
data/rails_best_practices.yml
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'tmpdir'
|
2
3
|
|
3
4
|
module RailsBestPractices
|
4
5
|
describe Analyzer do
|
5
6
|
subject { Analyzer.new(".") }
|
6
7
|
|
8
|
+
describe '::new' do
|
9
|
+
it 'should expand a relative path to an absolute' do
|
10
|
+
subject.path.should eq File.expand_path('.')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
7
14
|
describe "expand_dirs_to_files" do
|
8
15
|
it "should expand all files in spec directory" do
|
9
16
|
dir = File.dirname(__FILE__)
|
@@ -19,9 +26,17 @@ module RailsBestPractices
|
|
19
26
|
end
|
20
27
|
|
21
28
|
describe "file_ignore" do
|
29
|
+
before do
|
30
|
+
@all = ["app/controllers/users_controller.rb", "app/mailers/user_mailer.rb", "app/models/user.rb", "app/views/users/index.html.haml", "app/views/users/show.html.slim", "lib/user.rb"]
|
31
|
+
@filtered = ["app/controllers/users_controller.rb", "app/mailers/user_mailer.rb", "app/models/user.rb", "app/views/users/index.html.haml", "app/views/users/show.html.slim"]
|
32
|
+
end
|
33
|
+
|
22
34
|
it "should ignore lib" do
|
23
|
-
|
24
|
-
|
35
|
+
subject.file_ignore(@all, 'lib/').should == @filtered
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should ignore regexp patterns" do
|
39
|
+
subject.file_ignore(@all, /lib/).should == @filtered
|
25
40
|
end
|
26
41
|
end
|
27
42
|
|
@@ -43,5 +58,60 @@ module RailsBestPractices
|
|
43
58
|
result.should == ["app/models/user.rb:10 - law of demeter".red, "app/models/post.rb:100 - use query attribute".red, "\nPlease go to http://rails-bestpractices.com to see more useful Rails Best Practices.".green, "\nFound 2 warnings.".red].join("\n") + "\n"
|
44
59
|
end
|
45
60
|
end
|
61
|
+
|
62
|
+
describe 'parse_files' do
|
63
|
+
|
64
|
+
it 'should not filter out all files when the path contains "vendor"' do
|
65
|
+
Dir.mktmpdir { |random_dir|
|
66
|
+
Dir.mkdir(File.join(random_dir, 'vendor'))
|
67
|
+
Dir.mkdir(File.join(random_dir, 'vendor', 'my_project'))
|
68
|
+
File.open(File.join(random_dir, 'vendor', 'my_project', 'my_file.rb'), "w") { |file| file << 'woot' }
|
69
|
+
analyzer = Analyzer.new(File.join(random_dir, 'vendor', 'my_project'))
|
70
|
+
analyzer.parse_files.should be_include File.join(random_dir, 'vendor', 'my_project', 'my_file.rb')
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'should not filter out all files when the path contains "spec"' do
|
75
|
+
Dir.mktmpdir { |random_dir|
|
76
|
+
Dir.mkdir(File.join(random_dir, 'spec'))
|
77
|
+
Dir.mkdir(File.join(random_dir, 'spec', 'my_project'))
|
78
|
+
File.open(File.join(random_dir, 'spec', 'my_project', 'my_file.rb'), "w") { |file| file << 'woot' }
|
79
|
+
analyzer = Analyzer.new(File.join(random_dir, 'spec', 'my_project'))
|
80
|
+
analyzer.parse_files.should be_include File.join(random_dir, 'spec', 'my_project', 'my_file.rb')
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'should not filter out all files when the path contains "test"' do
|
85
|
+
Dir.mktmpdir { |random_dir|
|
86
|
+
Dir.mkdir(File.join(random_dir, 'test'))
|
87
|
+
Dir.mkdir(File.join(random_dir, 'test', 'my_project'))
|
88
|
+
File.open(File.join(random_dir, 'test', 'my_project', 'my_file.rb'), "w") { |file| file << 'woot' }
|
89
|
+
analyzer = Analyzer.new(File.join(random_dir, 'test', 'my_project'))
|
90
|
+
analyzer.parse_files.should be_include File.join(random_dir, 'test', 'my_project', 'my_file.rb')
|
91
|
+
}
|
92
|
+
end
|
93
|
+
|
94
|
+
it 'should not filter out all files when the path contains "features"' do
|
95
|
+
Dir.mktmpdir { |random_dir|
|
96
|
+
Dir.mkdir(File.join(random_dir, 'test'))
|
97
|
+
Dir.mkdir(File.join(random_dir, 'test', 'my_project'))
|
98
|
+
File.open(File.join(random_dir, 'test', 'my_project', 'my_file.rb'), "w") { |file| file << 'woot' }
|
99
|
+
analyzer = Analyzer.new(File.join(random_dir, 'test', 'my_project'))
|
100
|
+
analyzer.parse_files.should be_include File.join(random_dir, 'test', 'my_project', 'my_file.rb')
|
101
|
+
}
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'should not filter out all files when the path contains "tmp"' do
|
105
|
+
Dir.mktmpdir { |random_dir|
|
106
|
+
Dir.mkdir(File.join(random_dir, 'tmp'))
|
107
|
+
Dir.mkdir(File.join(random_dir, 'tmp', 'my_project'))
|
108
|
+
File.open(File.join(random_dir, 'tmp', 'my_project', 'my_file.rb'), "w") { |file| file << 'woot' }
|
109
|
+
analyzer = Analyzer.new(File.join(random_dir, 'tmp', 'my_project'))
|
110
|
+
analyzer.parse_files.should be_include File.join(random_dir, 'tmp', 'my_project', 'my_file.rb')
|
111
|
+
}
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
115
|
+
|
46
116
|
end
|
47
117
|
end
|
@@ -257,6 +257,23 @@ module RailsBestPractices
|
|
257
257
|
methods = Prepares.model_methods
|
258
258
|
methods.get_methods("Admin::Blog::Post").map(&:method_name).should == ["save", "find"]
|
259
259
|
end
|
260
|
+
|
261
|
+
it "should not add methods from module" do
|
262
|
+
content =<<-EOF
|
263
|
+
class Model < ActiveRecord::Base
|
264
|
+
end
|
265
|
+
EOF
|
266
|
+
runner.prepare("app/models/model.rb", content)
|
267
|
+
content =<<-EOF
|
268
|
+
module Mixin
|
269
|
+
def mixed_method
|
270
|
+
end
|
271
|
+
end
|
272
|
+
EOF
|
273
|
+
runner.prepare("app/models/mixins/mixin.rb", content)
|
274
|
+
methods = Prepares.model_methods
|
275
|
+
methods.get_methods('Model').should be_empty
|
276
|
+
end
|
260
277
|
end
|
261
278
|
|
262
279
|
context "scope" do
|
@@ -15,7 +15,15 @@ module RailsBestPractices
|
|
15
15
|
runner.errors[0].to_s.should == "app/models/user.rb:1 - protect mass assignment"
|
16
16
|
end
|
17
17
|
|
18
|
-
it "should not protect mass assignment if attr_accessible is used with arguments" do
|
18
|
+
it "should not protect mass assignment if attr_accessible is used with arguments and user set config.active_record.whitelist_attributes" do
|
19
|
+
content =<<-EOF
|
20
|
+
module RailsBestPracticesCom
|
21
|
+
class Application < Rails::Application
|
22
|
+
config.active_record.whitelist_attributes = true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
EOF
|
26
|
+
runner.prepare('config/application.rb', content)
|
19
27
|
content =<<-EOF
|
20
28
|
class User < ActiveRecord::Base
|
21
29
|
attr_accessible :email, :password, :password_confirmation
|
@@ -25,7 +33,15 @@ module RailsBestPractices
|
|
25
33
|
runner.should have(0).errors
|
26
34
|
end
|
27
35
|
|
28
|
-
it "should not protect mass assignment if attr_accessible is used without arguments" do
|
36
|
+
it "should not protect mass assignment if attr_accessible is used without arguments and user set config.active_record.whitelist_attributes" do
|
37
|
+
content =<<-EOF
|
38
|
+
module RailsBestPracticesCom
|
39
|
+
class Application < Rails::Application
|
40
|
+
config.active_record.whitelist_attributes = true
|
41
|
+
end
|
42
|
+
end
|
43
|
+
EOF
|
44
|
+
runner.prepare('config/application.rb', content)
|
29
45
|
content =<<-EOF
|
30
46
|
class User < ActiveRecord::Base
|
31
47
|
attr_accessible
|
@@ -35,7 +51,15 @@ module RailsBestPractices
|
|
35
51
|
runner.should have(0).errors
|
36
52
|
end
|
37
53
|
|
38
|
-
it "should not protect mass assignment with attr_protected" do
|
54
|
+
it "should not protect mass assignment with attr_protected if user set config.active_record.whitelist_attributes" do
|
55
|
+
content =<<-EOF
|
56
|
+
module RailsBestPracticesCom
|
57
|
+
class Application < Rails::Application
|
58
|
+
config.active_record.whitelist_attributes = true
|
59
|
+
end
|
60
|
+
end
|
61
|
+
EOF
|
62
|
+
runner.prepare('config/application.rb', content)
|
39
63
|
content =<<-EOF
|
40
64
|
class User < ActiveRecord::Base
|
41
65
|
attr_protected :role
|
@@ -77,23 +101,6 @@ module RailsBestPractices
|
|
77
101
|
runner.should have(0).errors
|
78
102
|
end
|
79
103
|
|
80
|
-
it "should not protect mass assignment if user set config.active_record.whitelist_attributes" do
|
81
|
-
content =<<-EOF
|
82
|
-
module RailsBestPracticesCom
|
83
|
-
class Application < Rails::Application
|
84
|
-
config.active_record.whitelist_attributes = true
|
85
|
-
end
|
86
|
-
end
|
87
|
-
EOF
|
88
|
-
runner.prepare('config/application.rb', content)
|
89
|
-
content =<<-EOF
|
90
|
-
class User < ActiveRecord::Base
|
91
|
-
end
|
92
|
-
EOF
|
93
|
-
runner.review('app/models/user.rb', content)
|
94
|
-
runner.should have(0).errors
|
95
|
-
end
|
96
|
-
|
97
104
|
it "should not protect mass assignment if checking non ActiveRecord::Base inherited model" do
|
98
105
|
content =<<-EOF
|
99
106
|
class User < Person
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,206 +1,181 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_best_practices
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
5
|
-
prerelease:
|
4
|
+
version: 1.13.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Richard Huang
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-05-06 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: code_analyzer
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: ruby-progressbar
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: colored
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: erubis
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: i18n
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - '>='
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - '>='
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: activesupport
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - '>='
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - '>='
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: awesome_print
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - '>='
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: '0'
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - '>='
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: '0'
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: rake
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - '>='
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: '0'
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- -
|
122
|
+
- - '>='
|
140
123
|
- !ruby/object:Gem::Version
|
141
124
|
version: '0'
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: rspec
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
|
-
- -
|
129
|
+
- - '>='
|
148
130
|
- !ruby/object:Gem::Version
|
149
131
|
version: '0'
|
150
132
|
type: :development
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
|
-
- -
|
136
|
+
- - '>='
|
156
137
|
- !ruby/object:Gem::Version
|
157
138
|
version: '0'
|
158
139
|
- !ruby/object:Gem::Dependency
|
159
140
|
name: haml
|
160
141
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
142
|
requirements:
|
163
|
-
- -
|
143
|
+
- - '>='
|
164
144
|
- !ruby/object:Gem::Version
|
165
145
|
version: '0'
|
166
146
|
type: :development
|
167
147
|
prerelease: false
|
168
148
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
149
|
requirements:
|
171
|
-
- -
|
150
|
+
- - '>='
|
172
151
|
- !ruby/object:Gem::Version
|
173
152
|
version: '0'
|
174
153
|
- !ruby/object:Gem::Dependency
|
175
154
|
name: slim
|
176
155
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
156
|
requirements:
|
179
|
-
- -
|
157
|
+
- - '>='
|
180
158
|
- !ruby/object:Gem::Version
|
181
159
|
version: '0'
|
182
160
|
type: :development
|
183
161
|
prerelease: false
|
184
162
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
163
|
requirements:
|
187
|
-
- -
|
164
|
+
- - '>='
|
188
165
|
- !ruby/object:Gem::Version
|
189
166
|
version: '0'
|
190
167
|
- !ruby/object:Gem::Dependency
|
191
168
|
name: bundler
|
192
169
|
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
170
|
requirements:
|
195
|
-
- -
|
171
|
+
- - '>='
|
196
172
|
- !ruby/object:Gem::Version
|
197
173
|
version: '0'
|
198
174
|
type: :development
|
199
175
|
prerelease: false
|
200
176
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
177
|
requirements:
|
203
|
-
- -
|
178
|
+
- - '>='
|
204
179
|
- !ruby/object:Gem::Version
|
205
180
|
version: '0'
|
206
181
|
description: a code metric tool for rails codes, written in Ruby.
|
@@ -211,6 +186,7 @@ executables:
|
|
211
186
|
extensions: []
|
212
187
|
extra_rdoc_files: []
|
213
188
|
files:
|
189
|
+
- .coveralls.yml
|
214
190
|
- .gemtest
|
215
191
|
- .gitignore
|
216
192
|
- .rspec
|
@@ -369,32 +345,44 @@ files:
|
|
369
345
|
- spec/spec_helper.rb
|
370
346
|
homepage: http://rails-bestpractices.com
|
371
347
|
licenses: []
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
348
|
+
metadata: {}
|
349
|
+
post_install_message: |
|
350
|
+
********************************************************************************
|
351
|
+
|
352
|
+
rails_best_practices is a code metric tool to check the quality of rails codes.
|
353
|
+
|
354
|
+
I highly recommend you browse the Rails Best Practices website first.
|
355
|
+
|
356
|
+
http://rails-bestpractices.com
|
357
|
+
|
358
|
+
Please also try our online service
|
359
|
+
|
360
|
+
http://railsbp.com
|
361
|
+
|
362
|
+
Enjoy!
|
363
|
+
|
364
|
+
Richard Huang (flyerhzm@gmail.com)
|
365
|
+
|
366
|
+
********************************************************************************
|
377
367
|
rdoc_options: []
|
378
368
|
require_paths:
|
379
369
|
- lib
|
380
370
|
- assets
|
381
371
|
required_ruby_version: !ruby/object:Gem::Requirement
|
382
|
-
none: false
|
383
372
|
requirements:
|
384
|
-
- -
|
373
|
+
- - '>='
|
385
374
|
- !ruby/object:Gem::Version
|
386
375
|
version: 1.9.0
|
387
376
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
388
|
-
none: false
|
389
377
|
requirements:
|
390
|
-
- -
|
378
|
+
- - '>='
|
391
379
|
- !ruby/object:Gem::Version
|
392
380
|
version: 1.3.6
|
393
381
|
requirements: []
|
394
382
|
rubyforge_project:
|
395
|
-
rubygems_version:
|
383
|
+
rubygems_version: 2.0.3
|
396
384
|
signing_key:
|
397
|
-
specification_version:
|
385
|
+
specification_version: 4
|
398
386
|
summary: a code metric tool for rails codes.
|
399
387
|
test_files:
|
400
388
|
- spec/fixtures/lib/rails_best_practices/plugins/reviews/not_use_rails_root_review.rb
|