Skip to content

Instantly share code, notes, and snippets.

@kangkyu
Last active November 2, 2018 06:19
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 kangkyu/17b014143d7d2afaf2cb to your computer and use it in GitHub Desktop.
Save kangkyu/17b014143d7d2afaf2cb to your computer and use it in GitHub Desktop.
There should be better ways - hope anybody comment it

Use guard-shell gem.

# terminal (at exercism/ruby/)
gem install guard guard-shell
guard init shell
# Guardfile
guard :shell do
  watch(/^(.+)\.rb$/) do |m|
    `ruby -I"lib:test" #{m[1].chomp('_test')}_test.rb`
  end
end

Use minitest-reporters gem to add Red and Green

# terminal
gem install minitest-reporters
# test_helper.rb
require "minitest/reporters"
Minitest::Reporters.use!
# Guardfile
guard :shell do
  watch(/^(.+)\.rb$/) do |m|
    `ruby -I"lib:test" -r"./test_helper" #{m[1].chomp('_test')}_test.rb`
  end
end

Add more options to Minitest::Reporters

# test_helper.rb
require "minitest/reporters"
reporter_options = {
  detailed_skip: false, # true by default
  fast_fail: true, # false by default
  color: true
}
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(reporter_options)]

Run it

# terminal (at exercism/ruby/)
guard --notify false
@kkchu791
Copy link

Interesting. Is this contributing to exercism open source?

I'm wonder if we do all these directions within the ruby directory or the specific exercise directory ( for example in helloword directory)?

@kangkyu
Copy link
Author

kangkyu commented Nov 2, 2018

The answer is: in the exercism/ruby directory. Thank you @kkchu791 for asking, sorry for being late to answer! By the way, I just found your comment while I'm working on the listy-gisty, (do you remember this Study Group project?) which helps me go find old gists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment