Skip to content

Commit

Permalink
Merge pull request #511 from codeforamerica/414-rubocop-integration
Browse files Browse the repository at this point in the history
Fixes #414 - integrates rubocop gem
  • Loading branch information
anselmbradford committed Jul 25, 2014
2 parents d08e6f1 + 5e73284 commit 59d032c
Show file tree
Hide file tree
Showing 67 changed files with 732 additions and 753 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
/spec/screenshots/
/spec/tmp/*

# Ignore metric_fu directory
/specifications

# Ignore yard docs and db docs
/doc/*
.yardoc/*
Expand Down
27 changes: 27 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
AllCops:
Include:
- 'Gemfile'
- 'Rakefile'
Exclude:
- 'bin/*'
- 'db/seeds.rb'
- 'config/initializers/generators.rb'

# Allow dots at the end of lines when chaining methods
# that span multiple lines
DotPosition:
Enabled: false

LineLength:
Enabled: false

Documentation:
Enabled: false

MethodLength:
CountComments: false
Max: 15

ClassLength:
CountComments: false
Max: 100
19 changes: 10 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,19 @@ gem 'figaro', '~> 1.0.0.rc1'

gem 'coveralls', '>= 0.7.0', require: false

# Pagination
# Handles logic behind Pagination UI component.
gem 'kaminari'

group :production, :staging do
# rails_12factor runs only in production to suppress logging in rspec output.
# Per advice of http://stackoverflow.com/questions/18132920/how-to-suppress-noise-from-requests-when-running-rspec-feature-specs
# Heroku recommended.
# Enables serving assets in production and setting logger to standard out.
gem 'rails_12factor'
end

# dev and debugging tools
group :development do
gem 'quiet_assets', '>= 1.0.2'
gem 'better_errors', '>= 1.1.0'
gem 'binding_of_caller', '>= 0.7.2', :platforms => [:mri_19, :rbx]
gem 'metric_fu', '>= 4.11.0'
gem 'binding_of_caller', '>= 0.7.2', platforms: [:mri_19, :rbx]

# For mocking emails for sending.
gem 'letter_opener', '>= 1.2.0'
Expand All @@ -77,7 +74,7 @@ group :development do
end

group :test do
#gem 'launchy', '>= 2.2.0'
# gem 'launchy', '>= 2.2.0'
gem 'capybara', '>= 2.2.1'
gem 'json', '>= 1.8.1'

Expand All @@ -86,9 +83,13 @@ group :test do
gem 'vcr', '>= 2.9.0'
gem 'webmock', '>= 1.17.4'
gem 'email_spec', '>= 1.5.0'

# Ruby static code analyzer, based on the community Ruby style guide.
gem 'rubocop'
end

group :development, :test do
#gem 'teaspoon' #enable teaspoon to use JasmineJS for performing unit testing on JS code
# Enable teaspoon to use JasmineJS for performing unit testing on JS code.
# gem 'teaspoon'
gem 'rspec-rails', '>= 2.14.2'
end
end
87 changes: 13 additions & 74 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,17 @@ GEM
tzinfo (~> 0.3.37)
addressable (2.3.6)
arel (4.0.2)
arrayfields (4.9.2)
ast (2.0.0)
autoparse (0.3.3)
addressable (>= 2.3.1)
extlib (>= 0.9.15)
multi_json (>= 1.0.0)
awesome_print (1.2.0)
better_errors (1.1.0)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.1.4)
cane (2.6.2)
parallel
capybara (2.3.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
Expand All @@ -50,21 +47,8 @@ GEM
capybara-webkit (1.1.0)
capybara (~> 2.0, >= 2.0.2)
json
chronic (0.10.2)
chunky_png (1.3.1)
churn (0.0.35)
chronic (>= 0.2.3)
hirb
json_pure
main
rest-client (>= 1.6.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.1)
code_analyzer (0.4.5)
sexp_processor
code_metrics (0.1.3)
coderay (1.1.0)
colored (1.2)
compass (0.12.6)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
Expand Down Expand Up @@ -94,16 +78,9 @@ GEM
multipart-post (>= 1.2, < 3)
faraday-http-cache (0.4.0)
faraday (~> 0.8)
fattr (2.2.2)
figaro (1.0.0.rc1)
rails (>= 3, < 5)
thor (~> 0.14)
flay (2.4.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.0)
flog (4.2.0)
ruby_parser (~> 3.1, > 3.1.0)
sexp_processor (~> 4.4)
font-awesome-sass (4.1.0)
sass (~> 3.2)
fssm (0.2.10)
Expand All @@ -126,14 +103,12 @@ GEM
haml (>= 3.1, < 5.0)
railties (>= 4.0.1)
hike (1.2.3)
hirb (0.7.2)
i18n (0.6.11)
jshintrb (0.2.4)
execjs
multi_json (>= 1.3)
rake
json (1.8.1)
json_pure (1.8.1)
jwt (1.0.0)
kaminari (0.16.1)
actionpack (>= 3.0.0)
Expand All @@ -146,28 +121,7 @@ GEM
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
main (6.0.0)
arrayfields (>= 4.7.4)
chronic (>= 0.6.2)
fattr (>= 2.2.0)
map (>= 5.1.0)
map (6.5.3)
memcachier (0.0.2)
metric_fu (4.11.1)
cane (~> 2.5, >= 2.5.2)
churn (~> 0.0.35)
code_metrics (~> 0.1)
coderay
flay (~> 2.1, >= 2.0.1)
flog (~> 4.1, >= 4.1.1)
launchy (~> 2.0)
metric_fu-Saikuro (~> 1.1, >= 1.1.3)
multi_json
rails_best_practices (~> 1.14, >= 1.14.3)
redcard
reek (~> 1.3, >= 1.3.4)
roodi (~> 3.1)
metric_fu-Saikuro (1.1.3)
mime-types (1.25.1)
mini_portile (0.6.0)
minitest (4.7.5)
Expand All @@ -178,8 +132,11 @@ GEM
mini_portile (= 0.6.0)
ohanakapa (1.1.1)
sawyer (~> 0.3.0)
parallel (1.0.0)
parser (2.1.9)
ast (>= 1.1, < 3.0)
slop (~> 3.4, >= 3.4.5)
polyglot (0.3.5)
powerpack (0.0.9)
quiet_assets (1.0.2)
railties (>= 3.1, < 5.0)
rack (1.5.2)
Expand All @@ -199,16 +156,6 @@ GEM
rails_12factor (0.0.2)
rails_serve_static_assets
rails_stdout_logging
rails_best_practices (1.15.4)
activesupport
awesome_print
code_analyzer (>= 0.4.3)
colored
erubis
i18n
json
require_all
ruby-progressbar
rails_serve_static_assets (0.0.2)
rails_stdout_logging (0.0.3)
railties (4.0.8)
Expand All @@ -219,20 +166,11 @@ GEM
rainbow (2.0.0)
raindrops (0.13.0)
rake (10.3.2)
redcard (1.1.0)
reek (1.3.7)
rainbow
ruby2ruby (~> 2.0.8)
ruby_parser (~> 3.3)
sexp_processor
require_all (1.3.2)
requirejs-rails (0.9.3)
railties (>= 3.1.1)
rest-client (1.6.7)
mime-types (>= 1.16)
retriable (1.4.1)
roodi (3.3.1)
ruby_parser (~> 3.2, >= 3.2.2)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
Expand All @@ -245,12 +183,13 @@ GEM
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rubocop (0.21.0)
json (>= 1.7.7, < 2)
parser (~> 2.1.9)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-progressbar (1.5.1)
ruby2ruby (2.0.8)
ruby_parser (~> 3.1)
sexp_processor (~> 4.0)
ruby_parser (3.6.1)
sexp_processor (~> 4.1)
safe_yaml (1.0.3)
sass (3.2.19)
sass-rails (4.0.3)
Expand All @@ -261,7 +200,6 @@ GEM
sawyer (0.3.0)
faraday (~> 0.8, < 0.10)
uri_template (~> 0.5.0)
sexp_processor (4.4.3)
signet (0.5.0)
addressable (>= 2.2.3)
faraday (>= 0.9.0.rc5)
Expand All @@ -272,6 +210,7 @@ GEM
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slop (3.5.0)
sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
Expand Down Expand Up @@ -331,7 +270,6 @@ DEPENDENCIES
kgio
letter_opener (>= 1.2.0)
memcachier
metric_fu (>= 4.11.0)
newrelic_rpm (>= 3.8.0.218)
ohanakapa (~> 1.1.1)
quiet_assets (>= 1.0.2)
Expand All @@ -341,6 +279,7 @@ DEPENDENCIES
rails_12factor
requirejs-rails (>= 0.9.2)
rspec-rails (>= 2.14.2)
rubocop
sass-rails (~> 4.0.2)
uglifier (>= 2.5.0)
unicorn (>= 4.8.3)
Expand Down
10 changes: 6 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
# for example lib/tasks/capistrano.rake, and they will automatically
# be available to Rake.

require File.expand_path('../config/application', __FILE__)

HumanServicesFinder::Application.load_tasks

# Enables running of teaspoon gem by default when rake is run.
# Teaspoon is a JS testing gem using JasmineJS (https://github.com/pivotal/jasmine).
#task :tests => [:spec, :teaspoon]
#task :default => [:tests]
# Teaspoon is a JS testing gem using JasmineJS
# (https://github.com/pivotal/jasmine).
# task :tests => [:spec, :teaspoon]
# task :default => [:tests]
12 changes: 4 additions & 8 deletions app/controllers/about_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@ class AboutController < ApplicationController
respond_to :html, :json

def index

# feedback request, send a feedback mail
if request.xhr?
FeedbackMailer.send_feedback(params).deliver
end
FeedbackMailer.send_feedback(params).deliver if request.xhr?

respond_to do |format|

# JSON response is for the feedback form.
# No content needs to be returned, it just needs a response.
format.json { render :json => {} }
# JSON response is for the feedback form.
# No content needs to be returned, it just needs a response.
format.json { render json: {} }

format.html
end

end
end
Loading

0 comments on commit 59d032c

Please sign in to comment.