Module: MiniTest::Capistrano::ConfigurationExtension
- Defined in:
- lib/minitest/capistrano/configuration_extension.rb
Overview
Patches to Capistrano::Configuration to track invocations. Taken from the awesome capistrano-spec gem (https://github.com/technicalpickles/capistrano-spec)
Instance Method Summary collapse
- #capture(command, options = {}) ⇒ Object
- #captures ⇒ Object
- #captures_responses ⇒ Object
- #find_callback(on, task) ⇒ Object
- #get(remote_path, path, options = {}, &block) ⇒ Object
- #gets ⇒ Object
- #put(data, path, options = {}) ⇒ Object
- #putes ⇒ Object
- #run(cmd, options = {}, &block) ⇒ Object
- #runs ⇒ Object
- #stream(command, options = {}) ⇒ Object
- #streams ⇒ Object
- #streams_responses ⇒ Object
- #upload(from, to, options = {}, &block) ⇒ Object
- #uploads ⇒ Object
Instance Method Details
#capture(command, options = {}) ⇒ Object
40 41 42 43 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 40 def capture(command, ={}) captures[command] = {:options => } captures_responses[command] end |
#captures ⇒ Object
45 46 47 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 45 def captures @captures ||= {} end |
#captures_responses ⇒ Object
49 50 51 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 49 def captures_responses @captures_responses ||= {} end |
#find_callback(on, task) ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 66 def find_callback(on, task) task = find_task(task) if task.kind_of?(String) Array(callbacks[on]).select do |task_callback| task_callback.applies_to?(task) || task_callback.source == task.fully_qualified_name end end |
#get(remote_path, path, options = {}, &block) ⇒ Object
8 9 10 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 8 def get(remote_path, path, ={}, &block) gets[remote_path] = {:path => path, :options => , :block => block} end |
#gets ⇒ Object
12 13 14 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 12 def gets @gets ||= {} end |
#put(data, path, options = {}) ⇒ Object
32 33 34 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 32 def put(data, path, ={}) putes[path] = {:data => data, :options => } end |
#putes ⇒ Object
36 37 38 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 36 def putes @putes ||= {} end |
#run(cmd, options = {}, &block) ⇒ Object
16 17 18 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 16 def run(cmd, ={}, &block) runs[cmd] = {:options => , :block => block} end |
#runs ⇒ Object
20 21 22 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 20 def runs @runs ||= {} end |
#stream(command, options = {}) ⇒ Object
53 54 55 56 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 53 def stream(command, ={}) streams[command] = {:options => } streams_responses[command] end |
#streams ⇒ Object
58 59 60 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 58 def streams @streams ||= {} end |
#streams_responses ⇒ Object
62 63 64 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 62 def streams_responses @streams_responses ||= {} end |
#upload(from, to, options = {}, &block) ⇒ Object
24 25 26 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 24 def upload(from, to, ={}, &block) uploads[from] = {:to => to, :options => , :block => block} end |
#uploads ⇒ Object
28 29 30 |
# File 'lib/minitest/capistrano/configuration_extension.rb', line 28 def uploads @uploads ||= {} end |