Readme.md in remote_run-0.1.3 vs Readme.md in remote_run-0.1.4

- old
+ new

@@ -10,10 +10,11 @@ ## Example: require 'rubygems' require 'remote_run' + require 'benchmark' hosts = ["broadway", "wall"] setup = "source ~/.profile; rvm use ree; bundle install;" tasks = [ "#{setup} bundle exec rspec spec/models", @@ -22,10 +23,19 @@ # configure runner runner = Runner.new do |config| config.hosts = hosts config.tasks = tasks + config.before_task = lambda do |host, task, remote_runner| + puts "#{host.hostname} is running '#{task.command}' " + end + config.around_task = lambda do |&block| + time = Benchmark.measure do + block.call + end + puts time + end end # kick off the run runner.run @@ -41,11 +51,17 @@ temp_path - the location where the working directory is cached on the local machine when starting a run (default: /tmp/remote) remote_path - the location to rsync files to on the remote host. (default: /tmp/remote) exclude - directories to exclude when rsyncing to remote host (default: []) login_as - the user used to log into ssh (default: current user) + Callbacks (optional): + before_run and after_run - the code to be executed before and after the run respectively, receives the remote_run instance as a paramater + before_task and after_task - the code to be executed before and after each task respectively, receives host, task and the remote_run instance as paramaters + around_run - the code to execute around the run, receives the block to call + around_task - the code to execute around each task, receives the block to call + ## Accessible Attributes: local_hostname - your computer's hostname identifier - a unique identifier for your test run @@ -68,10 +84,10 @@ * displays failure message if any status codes from the forks are non-zero Dependencies: ---------------------------------------------------------------------- -* HighLine +* HighLine License: ----------------------------------------------------------------------