rails_best_practices 1.13.2 → 1.13.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/rails_best_practices/analyzer.rb +7 -7
- data/lib/rails_best_practices/version.rb +1 -1
- data/rails_best_practices.gemspec +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -246,7 +246,7 @@ Follow us on twitter: <http://twitter.com/railsbp>
|
|
246
246
|
Send us email: <team@railsbp.com>
|
247
247
|
|
248
248
|
|
249
|
-
Copyright © 2009 -
|
249
|
+
Copyright © 2009 - 2013 Richard Huang (flyerhzm@gmail.com), released under the MIT license
|
250
250
|
|
251
251
|
|
252
252
|
[1]: https://github.com/railsbp/rails_best_practices/wiki/How-to-write-your-own-check-list
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'fileutils'
|
3
3
|
|
4
|
-
require 'progressbar'
|
4
|
+
require 'ruby-progressbar'
|
5
5
|
require 'colored'
|
6
6
|
require 'ap'
|
7
7
|
|
@@ -87,7 +87,7 @@ module RailsBestPractices
|
|
87
87
|
plain_output(warning, 'red')
|
88
88
|
end
|
89
89
|
end
|
90
|
-
@bar.
|
90
|
+
@bar.increment if display_bar?
|
91
91
|
end
|
92
92
|
@runner.send("after_#{process}")
|
93
93
|
end
|
@@ -183,7 +183,7 @@ module RailsBestPractices
|
|
183
183
|
|
184
184
|
# load hg commit and hg username info.
|
185
185
|
def load_hg_info
|
186
|
-
hg_progressbar = ProgressBar.
|
186
|
+
hg_progressbar = ProgressBar.create(:title => 'Hg Info', :total => errors.size) if display_bar?
|
187
187
|
errors.each do |error|
|
188
188
|
hg_info = `cd #{@runner.class.base_path} && hg blame -lvcu #{error.filename[@runner.class.base_path.size..-1].gsub(/^\//, "")} | sed -n /:#{error.line_number.split(',').first}:/p`
|
189
189
|
unless hg_info == ""
|
@@ -191,14 +191,14 @@ module RailsBestPractices
|
|
191
191
|
error.hg_username = hg_commit_username.split(/\ /)[0..-2].join(' ')
|
192
192
|
error.hg_commit = hg_commit_username.split(/\ /)[-1]
|
193
193
|
end
|
194
|
-
hg_progressbar.
|
194
|
+
hg_progressbar.increment if display_bar?
|
195
195
|
end
|
196
196
|
hg_progressbar.finish if display_bar?
|
197
197
|
end
|
198
198
|
|
199
199
|
# load git commit and git username info.
|
200
200
|
def load_git_info
|
201
|
-
git_progressbar = ProgressBar.
|
201
|
+
git_progressbar = ProgressBar.create(:title => 'Git Info', :total => errors.size) if display_bar?
|
202
202
|
start = @runner.class.base_path =~ /\/$/ ? @runner.class.base_path.size : @runner.class.base_path.size + 1
|
203
203
|
errors.each do |error|
|
204
204
|
git_info = `cd #{@runner.class.base_path} && git blame -L #{error.line_number.split(',').first},+1 #{error.filename[start..-1]}`
|
@@ -207,7 +207,7 @@ module RailsBestPractices
|
|
207
207
|
error.git_commit = git_commit.split(" ").first.strip
|
208
208
|
error.git_username = git_username.strip
|
209
209
|
end
|
210
|
-
git_progressbar.
|
210
|
+
git_progressbar.increment if display_bar?
|
211
211
|
end
|
212
212
|
git_progressbar.finish if display_bar?
|
213
213
|
end
|
@@ -257,7 +257,7 @@ module RailsBestPractices
|
|
257
257
|
|
258
258
|
# analyze source codes.
|
259
259
|
def analyze_source_codes
|
260
|
-
@bar = ProgressBar.
|
260
|
+
@bar = ProgressBar.create(:title => 'Source Codes', :total => parse_files.size * 3) if display_bar?
|
261
261
|
["lexical", "prepare", "review"].each { |process| send(:process, process) }
|
262
262
|
@bar.finish if display_bar?
|
263
263
|
end
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.required_rubygems_version = ">= 1.3.6"
|
15
15
|
|
16
16
|
s.add_dependency("code_analyzer")
|
17
|
-
s.add_dependency("progressbar")
|
17
|
+
s.add_dependency("ruby-progressbar")
|
18
18
|
s.add_dependency("colored")
|
19
19
|
s.add_dependency("erubis")
|
20
20
|
s.add_dependency("i18n")
|
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.13.
|
4
|
+
version: 1.13.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: code_analyzer
|
@@ -28,7 +28,7 @@ dependencies:
|
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name: progressbar
|
31
|
+
name: ruby-progressbar
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
@@ -386,7 +386,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
386
386
|
version: '0'
|
387
387
|
segments:
|
388
388
|
- 0
|
389
|
-
hash: -
|
389
|
+
hash: -3719283038052699502
|
390
390
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
391
391
|
none: false
|
392
392
|
requirements:
|