Skip to content

Instantly share code, notes, and snippets.

@kcdragon
Last active September 15, 2016 21:31
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 kcdragon/d66a319dc85935f4f91b1c6c503eef7d to your computer and use it in GitHub Desktop.
Save kcdragon/d66a319dc85935f4f91b1c6c503eef7d to your computer and use it in GitHub Desktop.
exercism.io Ruby downloader
# run with `sh download-exercism-io-ruby-problem.sh pangram`
exercism fetch ruby $1
cp /Users/mdalton/Code/exercism/ruby/Guardfile /Users/mdalton/Code/exercism/ruby/$1/
file=`EXERCISM_FILE_NAME=$1 ruby -e 'puts Dir["/Users/mdalton/Code/exercism/ruby/#{ENV["EXERCISM_FILE_NAME"]}/*_test.rb"].map { |f| File.basename(f) }[0].gsub("_test", "")'`
echo $file
touch /Users/mdalton/Code/exercism/ruby/$1/$file
guard :minitest, test_folders: '.' do
# with Minitest::Unit
watch(%r{^(.+)_test\.rb}) { |m| "./#{m[1]}_test.rb" }
watch(%r{^(.+)\.rb}) { |m| "./#{m[1]}_test.rb" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment