Skip to content

Instantly share code, notes, and snippets.

@jhass
jhass / .rubocop.yml
Last active December 15, 2023 22:23
My preferred Rubocop config
AllCops:
RunRailsCops: true
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
@timdiggins
timdiggins / rake_testing_support.rb
Created March 20, 2015 13:11
testing rake in rspec (etc)
# ./spec/support/rake_testing_support.rb
def invoke_rake_task_in_test(task_name)
require 'rake'
Rails.application.load_tasks if Rake.application.tasks.count < 10
Rake::Task[task_name].reenable
Rake::Task[task_name].invoke
end