Created
February 6, 2011 11:02
-
-
Save jarinudom/813291 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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