Last active
December 15, 2015 10:28
-
-
Save thbar/5245443 to your computer and use it in GitHub Desktop.
How to automatically restart the simulator in RubyMotion when code is updated (beta version!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'childprocess' | |
guard 'shell' do | |
watch %r{^app/(.+)\.rb$} do |m| | |
`killall rake` | |
# Why this: | |
# - spawn a child process to avoid locking Guard | |
# - make sure that the child process has stdout and stdin otherwise it crashes | |
# - bonus point: get REPL access in the simulator! | |
process = ChildProcess.build('rake') | |
process.io.inherit! | |
process.start | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install guard | |
gem install guard-shell | |
gem install rb-fsevent | |
gem install childprocess | |
guard -i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment