public
Fork of jamis/capistrano
Description: Remote multi-server automation tool
Homepage: http://www.capify.org
Clone URL: git://github.com/halorgium/capistrano.git
Ensure that the default run options are mixed into the command options 
when executing a command from the cap shell (closes #11348)


git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@9025 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
jamis (author)
Thu Mar 13 20:20:08 -0700 2008
commit  526782f55d16e2d05515632eb2a106d79a73c284
tree    4cdf97a9f1c78396d607e731368eba80784c1f83
parent  9e07fd2a231d8122d55376cc53596ba9db44fffd
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Ensure that the default run options are mixed into the command options when executing a command from the cap shell [Ken Collins]
0
+
0
 * Added :none SCM module for deploying a specific directory's contents [Jamis Buck]
0
 
0
 * Improved "copy" strategy supports local caching and pattern exclusion (via :copy_cache and :copy_exclude variables) [Jamis Buck]
...
169
170
171
172
 
 
173
174
175
...
169
170
171
 
172
173
174
175
176
0
@@ -169,7 +169,8 @@ HELP
0
         command = command.gsub(/\bsudo\b/, "sudo -p '#{configuration.sudo_prompt}'")
0
         processor = configuration.sudo_behavior_callback(Configuration.default_io_proc)
0
         sessions = servers.map { |server| configuration.sessions[server] }
0
- cmd = Command.new(command, sessions, :logger => configuration.logger, &processor)
0
+ options = configuration.add_default_command_options({})
0
+ cmd = Command.new(command, sessions, options.merge(:logger => configuration.logger), &processor)
0
         previous = trap("INT") { cmd.stop! }
0
         cmd.process!
0
       rescue Capistrano::Error => error
...
61
62
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
...
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
0
@@ -61,4 +61,30 @@ class ShellTest < Test::Unit::TestCase
0
     @shell.expects(:process_command).with("on", "app,db", "hello world")
0
     assert @shell.read_and_execute
0
   end
0
+
0
+ def test_task_command_with_bang_gets_processed_by_exec_tasks
0
+ while_testing_post_exec_commands do
0
+ @shell.expects(:read_line).returns("!deploy")
0
+ @shell.expects(:exec_tasks).with(["deploy"])
0
+ assert @shell.read_and_execute
0
+ end
0
+ end
0
+
0
+ def test_normal_command_gets_processed_by_exec_command
0
+ while_testing_post_exec_commands do
0
+ @shell.expects(:read_line).returns("uptime")
0
+ @shell.expects(:exec_command).with("uptime",nil)
0
+ @shell.expects(:connect)
0
+ assert @shell.read_and_execute
0
+ end
0
+ end
0
+
0
+
0
+ private
0
+
0
+ def while_testing_post_exec_commands(&block)
0
+ @shell.instance_variable_set(:@mutex,Mutex.new)
0
+ yield
0
+ end
0
+
0
 end

Comments

    No one has commented yet.