Skip to content

Instantly share code, notes, and snippets.

@durrellchamorro
Last active January 21, 2016 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save durrellchamorro/dfc97681a527f502e199 to your computer and use it in GitHub Desktop.
Save durrellchamorro/dfc97681a527f502e199 to your computer and use it in GitHub Desktop.
The Rakefile I wrote to use with Exercism
# Include this rakefile in the same directory as your Exercism exercise.
# Instead of submitting with $ exercism submit my_file.rb
# Enter $ rake s my_file.rb
# Now rubocop will automatically check your file before it submits to Exercism.
# If there are any problems, rubocop will tell you what they are like normal, and your exercise won't get submitted.
# If rubocop doesn't find any problems, then your exercise will be submitted.
require 'fileutils'
task :rubocop do
file = ARGV.last
sh %(rubocop "#{file}")
task file.to_sym do; end
end
task :exercism do
file = ARGV.last
sh %(exercism submit "#{file}")
task file.to_sym do; end
end
task s: [:rubocop, :exercism]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment