Skip to content

Commit b26650d

Browse files
ryanfox1985ctran
authored andcommitted
Fixed some offenses (#423)
Fixed some offenses
1 parent bb8cdf8 commit b26650d

18 files changed

+358
-417
lines changed

.rubocop_todo.yml

Lines changed: 43 additions & 87 deletions
Large diffs are not rendered by default.

Gemfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
source 'https://rubygems.org'
22

3-
gem 'rake', require: false
43
gem 'activerecord', '>= 4.2.5', require: false
4+
gem 'rake', require: false
55

66
group :development do
7-
gem 'mg', require: false
87
gem 'bump'
8+
gem 'mg', require: false
99
platforms :mri, :mingw do
1010
gem 'yard', require: false
1111
end
1212
end
1313

1414
group :development, :test do
1515
gem 'byebug'
16-
gem 'rspec', require: false
1716
gem 'guard-rspec', require: false
18-
gem 'terminal-notifier-guard', require: false
19-
gem 'simplecov', require: false
17+
gem 'rspec', require: false
18+
2019
gem 'rubocop', '~> 0.46.0', require: false unless RUBY_VERSION =~ /^1.8/
21-
gem 'coveralls'
20+
gem 'simplecov', require: false
21+
gem 'terminal-notifier-guard', require: false
22+
2223
gem 'codeclimate-test-reporter'
24+
gem 'coveralls'
25+
2326
gem 'ruby_dep', '1.3.1'
2427

2528
platforms :mri, :mingw do
@@ -29,6 +32,6 @@ group :development, :test do
2932
end
3033

3134
group :test do
32-
gem 'wrong', require: false
3335
gem 'files', require: false
36+
gem 'wrong', require: false
3437
end

Guardfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
# Note: The cmd option is now required due to the increasing number of ways
42
# rspec may be run, below are examples of the most common uses.
53
# * bundler: 'bundle exec rspec'
@@ -11,16 +9,16 @@
119
guard :rspec, cmd: 'bundle exec rspec' do
1210
watch(%r{^spec/.+_spec\.rb$})
1311
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
14-
watch('spec/spec_helper.rb') { "spec" }
12+
watch('spec/spec_helper.rb') { 'spec' }
1513

1614
# Rails example
1715
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
1816
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
1917
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
20-
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
21-
watch('config/routes.rb') { "spec/routing" }
22-
watch('app/controllers/application_controller.rb') { "spec/controllers" }
23-
watch('spec/rails_helper.rb') { "spec" }
18+
watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
19+
watch('config/routes.rb') { 'spec/routing' }
20+
watch('app/controllers/application_controller.rb') { 'spec/controllers' }
21+
watch('spec/rails_helper.rb') { 'spec' }
2422

2523
# Capybara features specs
2624
watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
@@ -29,4 +27,3 @@ guard :rspec, cmd: 'bundle exec rspec' do
2927
watch(%r{^spec/acceptance/(.+)\.feature$})
3028
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
3129
end
32-

annotate.gemspec

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,36 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
44
require 'annotate/version'
55

66
Gem::Specification.new do |s|
7-
s.name = "annotate"
7+
s.name = 'annotate'
88
s.version = Annotate.version
99

1010
s.required_ruby_version = '>= 1.9.3'
11-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12-
s.authors = ["Alex Chaffee", "Cuong Tran", "Marcos Piccinini", "Turadg Aleahmad", "Jon Frisby"]
13-
s.description = "Annotates Rails/ActiveRecord Models, routes, fixtures, and others based on the database schema."
14-
15-
s.executables = ["annotate"]
16-
s.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "TODO.rdoc"]
17-
s.files = ["AUTHORS.rdoc", "CHANGELOG.rdoc", "LICENSE.txt", "README.rdoc", "TODO.rdoc", "annotate.gemspec", "bin/annotate", "lib/annotate.rb", "lib/annotate/active_record_patch.rb", "lib/annotate/annotate_models.rb", "lib/annotate/annotate_routes.rb", "lib/annotate/tasks.rb", "lib/annotate/version.rb", "lib/generators/annotate/USAGE", "lib/generators/annotate/install_generator.rb", "lib/generators/annotate/templates/auto_annotate_models.rake", "lib/tasks/annotate_models.rake", "lib/tasks/annotate_routes.rake", "lib/tasks/migrate.rake"]
18-
s.homepage = "http://github.com/ctran/annotate_models"
19-
s.licenses = ["Ruby"]
20-
s.require_paths = ["lib"]
21-
s.rubyforge_project = "annotate"
22-
s.rubygems_version = "2.1.11"
23-
s.summary = "Annotates Rails Models, routes, fixtures, and others based on the database schema."
11+
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
12+
s.authors = ['Alex Chaffee', 'Cuong Tran', 'Marcos Piccinini', 'Turadg Aleahmad', 'Jon Frisby']
13+
s.description = 'Annotates Rails/ActiveRecord Models, routes, fixtures, and others based on the database schema.'
14+
15+
s.executables = ['annotate']
16+
s.extra_rdoc_files = ['README.rdoc', 'CHANGELOG.rdoc', 'TODO.rdoc']
17+
s.files = ['AUTHORS.rdoc', 'CHANGELOG.rdoc', 'LICENSE.txt', 'README.rdoc', 'TODO.rdoc', 'annotate.gemspec', 'bin/annotate', 'lib/annotate.rb', 'lib/annotate/active_record_patch.rb', 'lib/annotate/annotate_models.rb', 'lib/annotate/annotate_routes.rb', 'lib/annotate/tasks.rb', 'lib/annotate/version.rb', 'lib/generators/annotate/USAGE', 'lib/generators/annotate/install_generator.rb', 'lib/generators/annotate/templates/auto_annotate_models.rake', 'lib/tasks/annotate_models.rake', 'lib/tasks/annotate_routes.rake', 'lib/tasks/migrate.rake']
18+
s.homepage = 'http://github.com/ctran/annotate_models'
19+
s.licenses = ['Ruby']
20+
s.require_paths = ['lib']
21+
s.rubyforge_project = 'annotate'
22+
s.rubygems_version = '2.1.11'
23+
s.summary = 'Annotates Rails Models, routes, fixtures, and others based on the database schema.'
2424

25-
if s.respond_to? :specification_version then
25+
if s.respond_to? :specification_version
2626
s.specification_version = 4
2727

28-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
29-
s.add_runtime_dependency(%q<rake>, [">= 10.4", "< 12.1"])
30-
s.add_runtime_dependency(%q<activerecord>, [">= 3.2", "< 6.0"])
28+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0')
29+
s.add_runtime_dependency(%q<rake>, ['>= 10.4', '< 12.1'])
30+
s.add_runtime_dependency(%q<activerecord>, ['>= 3.2', '< 6.0'])
3131
else
32-
s.add_dependency(%q<rake>, [">= 10.4", "< 12.1"])
33-
s.add_dependency(%q<activerecord>, [">= 3.2", "< 6.0"])
32+
s.add_dependency(%q<rake>, ['>= 10.4', '< 12.1'])
33+
s.add_dependency(%q<activerecord>, ['>= 3.2', '< 6.0'])
3434
end
3535
else
36-
s.add_dependency(%q<rake>, [">= 0.8.7"])
37-
s.add_dependency(%q<activerecord>, [">= 3.2", "< 6.0"])
36+
s.add_dependency(%q<rake>, ['>= 0.8.7'])
37+
s.add_dependency(%q<activerecord>, ['>= 3.2', '< 6.0'])
3838
end
3939
end

lib/annotate/annotate_models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ def classified_sort(cols)
716716
id = c
717717
elsif c.name.eql?('created_at') || c.name.eql?('updated_at')
718718
timestamps << c
719-
elsif c.name[-3,3].eql?('_id')
719+
elsif c.name[-3, 3].eql?('_id')
720720
associations << c
721721
else
722722
rest_cols << c

0 commit comments

Comments
 (0)