Skip to content

Instantly share code, notes, and snippets.

@crishoj
Forked from jarinudom/gist:813291
Created October 24, 2012 05:16
Show Gist options
  • Save crishoj/3944108 to your computer and use it in GitHub Desktop.
Save crishoj/3944108 to your computer and use it in GitHub Desktop.
desc "remotely console"
task :console, :roles => :app do
input = ''
run "cd #{current_path} && rails 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 =~ /:\d{3}:\d+(\*|>)/
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment