Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Chris Wanstrath http://errtheblog.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Run script/console Remotely with Capistrano

From http://errtheblog.com/post/21.
Allows you to execute script/console remotely through Capistrano. Not for use on multi-machine :roles.

   1  
   2  desc "remotely console" 
   3  task :console, :roles => :app do
   4    input = ''
   5    run "cd #{current_path} && ./script/console #{ENV['RAILS_ENV']}" do |channel, stream, data|
   6      next if data.chomp == input.chomp || data.chomp == ''
   7      print data
   8      channel.send_data(input = $stdin.gets) if data =~ /^(>|\?)>/
   9    end
  10  end
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS