class TiyoHw::Runners::Ruby
Public Instance Methods
_rails_commands()
click to toggle source
# File lib/tiyo_hw/runners/ruby.rb, line 16 def _rails_commands add_command "spring stop" if spring? add_command "bin/rake db:setup" add_command "bin/rails s & sleep #{SLEEP_TIME} && open http://localhost:3000" add_command "bin/rake test" add_command "sleep 1 && %%" # Reown the rails s process end
gemfile?()
click to toggle source
# File lib/tiyo_hw/runners/ruby.rb, line 8 def gemfile? file?("Gemfile") end
prepare_commands()
click to toggle source
# File lib/tiyo_hw/runners/ruby.rb, line 24 def prepare_commands add_command "bundle install" if gemfile? _rails_commands if rails? end
rails?()
click to toggle source
# File lib/tiyo_hw/runners/ruby.rb, line 4 def rails? file?("bin", "rails") end
spring?()
click to toggle source
# File lib/tiyo_hw/runners/ruby.rb, line 12 def spring? file_contents?(/spring/, "Gemfile.lock") end