-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #285 from interagent/rubocop-template
Add and apply rubocop to template
- Loading branch information
Showing
25 changed files
with
126 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
Gemfile.lock | ||
.bundle | ||
.ruby-* | ||
.tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require: | ||
- rubocop-rspec | ||
AllCops: | ||
TargetRubyVersion: 2.3 | ||
# Offense count: 8 | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives. | ||
# URISchemes: http, https | ||
Metrics/LineLength: | ||
Enabled: false | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: Max. | ||
RSpec/ExampleLength: | ||
Enabled: false | ||
|
||
# Offense count: 1 | ||
Style/ClassVars: | ||
Enabled: false | ||
|
||
# Offense count: 6 | ||
Style/Documentation: | ||
Enabled: false | ||
|
||
Style/StringLiterals: | ||
Enabled: true | ||
EnforcedStyle: double_quotes | ||
|
||
Style/FrozenStringLiteralComment: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
|
||
require "pliny/tasks" | ||
|
||
# Add your rake tasks to lib/tasks! | ||
Dir["./lib/tasks/*.rake"].each { |task| load task } | ||
|
||
task :default => :spec | ||
task default: :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require_relative '../lib/application' | ||
# rubocop:disable Lint/Eval | ||
|
||
require_relative "../lib/application" | ||
|
||
eval ARGV.join(" ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require_relative 'lib/application' | ||
require_relative "lib/application" | ||
|
||
$stdout.sync = true | ||
$stderr.sync = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
database_setup_proc = lambda do |conn| | ||
# identify postgres connections coming from this process in pg_stat_activity | ||
process_identifier = ENV["DYNO"] || File.basename($0).gsub(/\W+/, "_") | ||
process_identifier = ENV["DYNO"] || File.basename($PROGRAM_NAME).gsub(/\W+/, "_") | ||
conn.execute "SET statement_timeout = '#{Config.database_timeout}s'" | ||
conn.execute "SET application_name = '#{process_identifier}'" | ||
end | ||
|
||
DB = Sequel.connect(Config.database_url, | ||
max_connections: Config.db_pool, | ||
after_connect: database_setup_proc) | ||
max_connections: Config.db_pool, | ||
after_connect: database_setup_proc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
require 'pliny/error_reporters/rollbar' | ||
require "pliny/error_reporters/rollbar" | ||
|
||
Pliny::ErrorReporters.error_reporters << Pliny::ErrorReporters::Rollbar | ||
|
||
Rollbar.configure do |config| | ||
config.enabled = ENV.has_key?('ROLLBAR_ACCESS_TOKEN') | ||
config.enabled = ENV.key?("ROLLBAR_ACCESS_TOKEN") | ||
config.disable_rack_monkey_patch = true | ||
config.access_token = ENV["ROLLBAR_ACCESS_TOKEN"] | ||
config.environment = ENV['ROLLBAR_ENV'] | ||
config.environment = ENV["ROLLBAR_ENV"] | ||
config.logger = Pliny::RollbarLogger.new | ||
config.use_sucker_punch | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require 'bundler' | ||
require "bundler" | ||
Bundler.require | ||
|
||
require_relative 'initializer' | ||
require_relative "initializer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module Mediators | ||
class Base | ||
def self.run(options={}) | ||
def self.run(options = {}) | ||
new(options).call | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
require "rubocop/rake_task" | ||
|
||
RuboCop::RakeTask.new do |task| | ||
task.requires << "rubocop-rspec" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
|
||
# define our own version of the spec task because rspec might not be available | ||
# in the production environment, so we can't rely on RSpec::Core::RakeTask | ||
desc "Run all app specs" | ||
task :spec do | ||
require "rspec/core" | ||
code = RSpec::Core::Runner.run( | ||
["./spec"], | ||
$stderr, $stdout) | ||
exit(code) unless code == 0 | ||
$stderr, $stdout | ||
) | ||
exit(code) unless code.zero? | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.