Skip to content

Instantly share code, notes, and snippets.

@jsierles
Created January 2, 2009 13:49
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 jsierles/42533 to your computer and use it in GitHub Desktop.
Save jsierles/42533 to your computer and use it in GitHub Desktop.
desc "remotely console"
task :console, :roles => :app do
input = ''
run "cd #{current_path} && ./script/console #{ENV['RAILS_ENV']}" do |channel, stream, data|
next if data.chomp == input.chomp || data.chomp == ''
print data
channel.send_data(input = $stdin.gets) if data =~ /^(>|\?)>/
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment