Skip to content

Commit

Permalink
Addressing a bunch of RuboCop stuff, breaking the API, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
meatballhat committed Feb 11, 2014
1 parent 96a57a0 commit 36d9c87
Show file tree
Hide file tree
Showing 29 changed files with 954 additions and 954 deletions.
126 changes: 14 additions & 112 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,129 +1,31 @@
# This configuration was generated by `rubocop --auto-gen-config`.
# This configuration was generated by `rubocop --auto-gen-config`
# on 2014-02-09 12:18:33 -0500 using RuboCop version 0.18.1.
# The point is for the user to remove these configuration records
# one by one as the offences are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

AccessorMethodName:
Enabled: false

AlignParameters:
Enabled: false

AssignmentInCondition:
Enabled: false

BracesAroundHashParameters:
Enabled: false

# Offence count: 1
CaseEquality:
Enabled: false

# Offence count: 1
# Configuration parameters: CountComments.
ClassLength:
Max: 318

ClassVars:
Enabled: false

CollectionMethods:
Enabled: false

ColonMethodCall:
Enabled: false

CommentAnnotation:
Enabled: false

# Offence count: 4
CyclomaticComplexity:
Max: 28

Documentation:
Enabled: false

Encoding:
Enabled: false

FavorUnlessOverNegatedIf:
Enabled: false

FavorUntilOverNegatedWhile:
Enabled: false

HandleExceptions:
Enabled: false

HashSyntax:
Enabled: false

IfUnlessModifier:
Enabled: false

IndentationWidth:
Enabled: false

LineLength:
Max: 152

Loop:
Enabled: false

MethodCallParentheses:
Enabled: false
Max: 24

# Offence count: 17
# Configuration parameters: CountComments.
MethodLength:
Max: 180

ModuleFunction:
Enabled: false

NumericLiterals:
Enabled: false

ParenthesesAroundCondition:
Enabled: false

PredicateName:
Enabled: false

RedundantBegin:
Enabled: false
Max: 150

# Offence count: 1
RescueException:
Enabled: false

RescueModifier:
Enabled: false

SingleLineMethods:
Enabled: false

SpaceAfterComma:
Enabled: false

SpaceAroundBlockBraces:
Enabled: false

SpaceAroundEqualsInParameterDefault:
Enabled: false

SpaceAroundOperators:
Enabled: false

SpaceInsideHashLiteralBraces:
Enabled: false

SpecialGlobalVars:
Enabled: false

StringLiterals:
Enabled: false

TrailingBlankLines:
Enabled: false

TrailingWhitespace:
Enabled: false

TrivialAccessors:
Enabled: false

UselessAssignment:
Documentation:
Enabled: false
21 changes: 3 additions & 18 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rubocop/rake_task'

task default: [:rubocop, :test]

Rubocop::RakeTask.new

Rake::TestTask.new do |t|
t.libs << 'test'
t.pattern = ENV['PATTERN'] || 'test/*_test.rb'
t.verbose = !!ENV['VERBOSE']
t.options = "--seed #{ENV['SEED']}" if ENV['SEED']
end

desc 'Run rubocop'
task :rubocop do
unless RUBY_VERSION < '1.9'
sh('rubocop --format simple') { |ok, _| ok || abort }
end
end

begin
require 'rdoc/task'

Rake::RDocTask.new do |rd|
rd.main = 'README.md'
rd.rdoc_files.include('README.md', 'lib/**/*.rb')
rd.rdoc_dir = 'doc'
end
rescue LoadError
end
6 changes: 2 additions & 4 deletions examples/dynamic-scheduling/app/jobs/fix_schedules_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ def self.perform

User.all.each do |user|
# get schedule for the user
schedule = Resque.get_schedule("send_email_#{user.id}")
schedule = Resque.fetch_schedule("send_email_#{user.id}")
# if a user has no schedule, add it to the array
if schedule.nil?
users_unscheduled << user
end
users_unscheduled << user if schedule.nil?
end

if users_unscheduled.length > 0
Expand Down
4 changes: 2 additions & 2 deletions examples/dynamic-scheduling/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class User < ActiveRecord::Base
after_create :schedule_send_email

private

def schedule_send_email
name = "send_email_#{id}"
config = {}
Expand Down
Loading

0 comments on commit 36d9c87

Please sign in to comment.