Permalink
Browse files

Add Rubocop & autocorrect. Setup Travis config

  • Loading branch information...
1 parent ca78b90 commit 44392d03ae8984d6ccd7f8e772f05069df0ca81a @mscoutermarsh mscoutermarsh committed Oct 25, 2015
Showing with 87 additions and 61 deletions.
  1. +4 −0 .rubocop.yml
  2. +8 −0 .travis.yml
  3. +1 −0 Gemfile
  4. +15 −0 Gemfile.lock
  5. +2 −2 Rakefile
  6. +2 −2 app.rb
  7. +1 −1 app/helpers.rb
  8. +2 −2 config/puma.rb
  9. +52 −54 spec/spec_helper.rb
View
@@ -0,0 +1,4 @@
+Documentation:
+ Enabled: false
+Metrics/LineLength:
+ Max: 120
View
@@ -0,0 +1,8 @@
+language: ruby
+rvm:
+ - 2.2.3
+ - 2.1.0
+before_install: gem install bundler -v 1.10.5
+script:
+ - bundle exec rspec
+ - bundle exec rubocop
View
@@ -20,6 +20,7 @@ group :development, :test do
gem 'rspec'
gem 'pry'
gem 'byebug'
+ gem 'rubocop'
end
gem 'bundler', group: :development
View
@@ -18,6 +18,9 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
+ ast (2.1.0)
+ astrolabe (1.3.1)
+ parser (~> 2.2)
aws-sdk (2.1.31)
aws-sdk-resources (= 2.1.31)
aws-sdk-core (2.1.31)
@@ -37,6 +40,9 @@ GEM
method_source (0.8.2)
minitest (5.8.1)
multi_json (1.11.2)
+ parser (2.2.3.0)
+ ast (>= 1.1, < 3.0)
+ powerpack (0.1.1)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
@@ -48,6 +54,7 @@ GEM
rack-standards (0.0.1)
rack-test (0.6.3)
rack (>= 1.0)
+ rainbow (2.0.0)
rake (10.4.2)
rspec (3.3.0)
rspec-core (~> 3.3.0)
@@ -62,6 +69,13 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
+ rubocop (0.34.2)
+ astrolabe (~> 1.3)
+ parser (>= 2.2.2.5, < 3.0)
+ powerpack (~> 0.1)
+ rainbow (>= 1.99.1, < 3.0)
+ ruby-progressbar (~> 1.4)
+ ruby-progressbar (1.7.5)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
@@ -92,6 +106,7 @@ DEPENDENCIES
rack-standards
rake
rspec
+ rubocop
sinatra
sinatra-contrib!
wkhtmltoimage-binary
View
@@ -4,6 +4,6 @@ task :app do
require './app'
end
-Dir[File.dirname(__FILE__) + "/lib/tasks/*.rb"].sort.each do |path|
+Dir[File.dirname(__FILE__) + '/lib/tasks/*.rb'].sort.each do |path|
require path
-end
+end
View
4 app.rb
@@ -3,8 +3,8 @@
# Setup load paths
Bundler.require
-$: << File.expand_path('../', __FILE__)
-$: << File.expand_path('../lib', __FILE__)
+$LOAD_PATH << File.expand_path('../', __FILE__)
+$LOAD_PATH << File.expand_path('../lib', __FILE__)
require 'dotenv'
Dotenv.load
View
@@ -1,4 +1,4 @@
module ShareMeow
module Helpers
end
-end
+end
View
@@ -4,6 +4,6 @@
preload_app!
-rackup DefaultRackup
-port ENV['PORT'] || 3000
+rackup DefaultRackup
+port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
View
@@ -17,7 +17,7 @@
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
-require File.expand_path("../../app", __FILE__)
+require File.expand_path('../../app', __FILE__)
require 'pry'
require 'byebug'
@@ -45,57 +45,55 @@
mocks.verify_partial_doubles = true
end
-# The settings below are suggested to provide a good initial experience
-# with RSpec, but feel free to customize to your heart's content.
-=begin
- # These two settings work together to allow you to limit a spec run
- # to individual examples or groups you care about by tagging them with
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
- # get run.
- config.filter_run :focus
- config.run_all_when_everything_filtered = true
-
- # Allows RSpec to persist some state between runs in order to support
- # the `--only-failures` and `--next-failure` CLI options. We recommend
- # you configure your source control system to ignore this file.
- config.example_status_persistence_file_path = "spec/examples.txt"
-
- # Limits the available syntax to the non-monkey patched syntax that is
- # recommended. For more details, see:
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
- # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
- # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
- config.disable_monkey_patching!
-
- # This setting enables warnings. It's recommended, but in some cases may
- # be too noisy due to issues in dependencies.
- config.warnings = true
-
- # Many RSpec users commonly either run the entire suite or an individual
- # file, and it's useful to allow more verbose output when running an
- # individual spec file.
- if config.files_to_run.one?
- # Use the documentation formatter for detailed output,
- # unless a formatter has already been configured
- # (e.g. via a command-line flag).
- config.default_formatter = 'doc'
- end
-
- # Print the 10 slowest examples and example groups at the
- # end of the spec run, to help surface which specs are running
- # particularly slow.
- config.profile_examples = 10
-
- # Run specs in random order to surface order dependencies. If you find an
- # order dependency and want to debug it, you can fix the order by providing
- # the seed, which is printed after each run.
- # --seed 1234
- config.order = :random
-
- # Seed global randomization in this process using the `--seed` CLI option.
- # Setting this allows you to use `--seed` to deterministically reproduce
- # test failures related to randomization by passing the same `--seed` value
- # as the one that triggered the failure.
- Kernel.srand config.seed
-=end
+ # The settings below are suggested to provide a good initial experience
+ # with RSpec, but feel free to customize to your heart's content.
+ # # These two settings work together to allow you to limit a spec run
+ # # to individual examples or groups you care about by tagging them with
+ # # `:focus` metadata. When nothing is tagged with `:focus`, all examples
+ # # get run.
+ # config.filter_run :focus
+ # config.run_all_when_everything_filtered = true
+ #
+ # # Allows RSpec to persist some state between runs in order to support
+ # # the `--only-failures` and `--next-failure` CLI options. We recommend
+ # # you configure your source control system to ignore this file.
+ # config.example_status_persistence_file_path = "spec/examples.txt"
+ #
+ # # Limits the available syntax to the non-monkey patched syntax that is
+ # # recommended. For more details, see:
+ # # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
+ # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
+ # # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
+ # config.disable_monkey_patching!
+ #
+ # # This setting enables warnings. It's recommended, but in some cases may
+ # # be too noisy due to issues in dependencies.
+ # config.warnings = true
+ #
+ # # Many RSpec users commonly either run the entire suite or an individual
+ # # file, and it's useful to allow more verbose output when running an
+ # # individual spec file.
+ # if config.files_to_run.one?
+ # # Use the documentation formatter for detailed output,
+ # # unless a formatter has already been configured
+ # # (e.g. via a command-line flag).
+ # config.default_formatter = 'doc'
+ # end
+ #
+ # # Print the 10 slowest examples and example groups at the
+ # # end of the spec run, to help surface which specs are running
+ # # particularly slow.
+ # config.profile_examples = 10
+ #
+ # # Run specs in random order to surface order dependencies. If you find an
+ # # order dependency and want to debug it, you can fix the order by providing
+ # # the seed, which is printed after each run.
+ # # --seed 1234
+ # config.order = :random
+ #
+ # # Seed global randomization in this process using the `--seed` CLI option.
+ # # Setting this allows you to use `--seed` to deterministically reproduce
+ # # test failures related to randomization by passing the same `--seed` value
+ # # as the one that triggered the failure.
+ # Kernel.srand config.seed
end

0 comments on commit 44392d0

Please sign in to comment.