May be there is another better method to do this. If you have the better way to do it, please tell me.
BTW, below code were successful running in rails3 and ruby 1.8.7

1. first, you should add open4 gem to your Rails project Gemfile

gem 'open4'

and run “bundle install” in terminal to install it in project dir.

2. add below code to config/deploy.rb, please change the namespace name to your own

namespace :your_namespance_name do
  require 'open4'
  rails_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
  stdin, stdout, stderr = Open4::popen4("cd #{rails_root} && rake -T")
  #please replace :your_namespance_name to your own, this code to grap you special of namespance rake tasks
  stderr.read.scan(/your_namespance_name\:(\w+)/).each do |match|
    desc "rake task named '#{match.last}'"
    task match.last.to_sym, :roles => :app do
      run "cd #{current_path}; RAILS_ENV=production rake railscasts:#{match}"
    end
  end
end

after do that, when you run cap -T in you command shell, you will be found the tasks from rake, also, it can invoked from the remote server of you own.

 
	CALayer *touchedLayer = [self.view layer];

	// here is an example wiggle
	CABasicAnimation *wiggle = [CABasicAnimation animationWithKeyPath:@"transform"];
	wiggle.duration = 0.1;
	wiggle.repeatCount = 1e100f;
	wiggle.autoreverses = YES;
	wiggle.toValue = [NSValue valueWithCATransform3D:CATransform3DRotate(touchedLayer.transform,0.1, 0.0 ,1.0 ,2.0)];

	// doing the wiggle
//	[touchedLayer addAnimation:wiggle forKey:@"wiggle"];
© 2012 { joycodes blog } Suffusion theme by Sayontan Sinha