exercism.io with Guard-Shell

I’m enjoying exercism.io like anybody else. Inspired by Ruby Koans with guard shell I set it up for my practicing.

Please comment at my gist for any further suggestions.

In the ~/exercism/ruby directory, add two files Guardfile and Rakefile after install the guard-shell gem.

Terminal #

gem install guard guard-shell
guard init shell

Guardfile #

guard :shell do
  watch(/^(.+)\.rb$/) do |m|
    `rake test TEST="#{m[1].chomp('_test')}_test.rb" TESTOPTS="--pride"`
  end
end

I added pride option because it colors a rainbow when success!

Rakefile #

#!/usr/bin/env ruby
# -*- ruby -*-

require 'rake/clean'
require 'rake/testtask'

task :default => :test

Rake::TestTask.new(:test) do |t|
  t.libs << "test"
  t.test_files = FileList['**/*_test.rb']
  t.verbose = true
end
$ guard

And then run guard on ~/exercism/ruby directory prompt. Now whenever I make changes onto the exercise files in any directory ~/exercism/ruby/name-of-exercise, it triggers testing automatically.

Again, please comment at my Github gist. Thank you!

 
3
Kudos
 
3
Kudos

Now read this

React with Ruby on Rails 5.1

$ ruby -v ruby 2.4.1p111 $ rails -v Rails 5.1.4 $ brew install yarn --without-node $ yarn -v 1.0.2 $ rails new scoreboard --webpack=react --api BOTH of two options. why not? https://yarnpkg.com/en/docs/install#alternatives-tab First let’... Continue →