Changeset 6106
- Timestamp:
- 02/04/07 02:03:56 (3 years ago)
- Files:
-
- tools/capistrano/CHANGELOG (modified) (3 diffs)
- tools/capistrano/lib/capistrano/command.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/capistrano/CHANGELOG
r6105 r6106 1 *SVN* 2 3 * Add :env option to 'run' (and friends) so that you can specify environment variables to be injected into the new process' environment [Mathieu Lajugie] 4 5 1 6 *1.4.0* (February 3, 2007) 2 7 … … 25 30 * Fix off-by-one bug in show_tasks width-computation [NeilW] 26 31 32 27 33 *1.3.1* (January 5, 2007) 28 34 29 35 * Fix connection problems when using gateways [Ezra Zygmuntowicz] 30 36 37 31 38 *1.3.0* (December 23, 2006) 32 39 … … 58 65 59 66 * Added :as option to sudo, so you can specify who the command is executed as [Mark Imbriaco] 67 60 68 61 69 *1.2.0* (September 14, 2006) tools/capistrano/lib/capistrano/command.rb
r5775 r6106 10 10 def initialize(servers, command, callback, options, actor) #:nodoc: 11 11 @servers = servers 12 @command = command.strip.gsub(/\r?\n/, "\\\n")12 @command = extract_environment(options) + command.strip.gsub(/\r?\n/, "\\\n") 13 13 @callback = callback 14 14 @options = options … … 97 97 end 98 98 end 99 100 # prepare a space-separated sequence of variables assignments 101 # intended to be prepended to a command, so the shell sets 102 # the environment before running the command. 103 # i.e.: options[:env] = {'PATH' => '/opt/ruby/bin:$PATH', 104 # 'TEST' => '( "quoted" )'} 105 # extract_environment(options) returns: 106 # "TEST=(\ \"quoted\"\ ) PATH=/opt/ruby/bin:$PATH" 107 def extract_environment(options) 108 Array(options[:env]).inject("") do |string, (name, value)| 109 string << %|#{name}=#{value.gsub(/"/, "\\\"").gsub(/ /, "\\ ")} | 110 end 111 end 99 112 end 100 113 end