Skip to content

Instantly share code, notes, and snippets.

@j-manu
Created December 4, 2011 17:46
Show Gist options
  • Save j-manu/1430805 to your computer and use it in GitHub Desktop.
Save j-manu/1430805 to your computer and use it in GitHub Desktop.
desc "remote console"
task :console, :roles => :app do
input = ''
run "cd #{current_path} && bundle exec rails c production" do |channel, stream, data|
next if data.chomp == input.chomp || data.chomp == ''
print data
channel.send_data(input = $stdin.gets) if data =~ /:\d{3}\s+(\*|>)/
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment