Sha256: cae73d3242b20db1cb5ed5a810283a3149c3c2d1d367116843b3ec89af2927af
Contents?: true
Size: 887 Bytes
Versions: 5
Compression:
Stored size: 887 Bytes
Contents
module Astrovan module Rake # Execute a rake task on the remote servers. # # Options: # * +rake+ - path to rake tool. Default is 'rake' # * +rakefile+ - specify the path to a rakefile (if not in the default location) def rake(*tasks) options = tasks.last.is_a?(Hash) ? tasks.pop : {} rake = options[:rake] || self.environment[:rake] rakefile = options[:rakefile] || self.rakefile rake << ' -f ' << rakefile if rakefile exec "cd #{current_path} && #{rake} #{tasks.join(' ')}", options end # Map one or more rake tasks to deployment methods. def surrogate(map) map.each do |method,task| raise ArgumentError, "Method <#{method}> already defined" if methods.include?(method.to_s) instance_eval "def #{method}; rake '#{task}'; end" end end alias_method :surrogates, :surrogate end end
Version data entries
5 entries across 5 versions & 1 rubygems