Skip to content

Instantly share code, notes, and snippets.

@enebo
Created March 18, 2011 15:40
Show Gist options
  • Save enebo/876288 to your computer and use it in GitHub Desktop.
Save enebo/876288 to your computer and use it in GitHub Desktop.
require 'fileutils'
launcher = ARGV.shift || "jruby"
options = ARGV.shift || ""
$jruby = "#{launcher} #{options}"
def jruby_command(command, *args)
command = "#{$jruby} -S #{command} #{args.join(' ')}"
puts "$ #{command}"
value = system command
puts value
end
rails_app = 'frogger'
FileUtils.rm_rf rails_app
jruby_command("gem", "install rails")
jruby_command("rails", "new", rails_app, "-m http://jruby.org/rails3.rb")
Dir.chdir(rails_app) do
jruby_command("bundle", "install")
jruby_command("rails", "generate scaffold person name:string")
jruby_command("rake", "db:migrate")
jruby_command("rails", "server")
end
puts "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment