Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: FetLife/rigger
base: 1c139c59c6
...
head fork: FetLife/rigger
compare: c2b8efa4ba
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 44 additions and 17 deletions.
  1. +1 −1  VERSION
  2. +33 −5 lib/rigger/task_executor.rb
  3. +10 −11 rigger.gemspec
View
2  VERSION
@@ -1 +1 @@
-0.2.10
+0.2.11
View
38 lib/rigger/task_executor.rb
@@ -45,14 +45,14 @@ def run(command)
execute(command, @current_servers) do |ch|
ch.on_data do |c, data|
data.split("\n").each do |line|
- puts " ** [#{ch[:host]} :: stdout] #{line}"
+ $stdout.puts" ** [#{ch[:host]} :: stdout] #{line}"
$stdout.flush
end
end
ch.on_extended_data do |c, type, data|
data.split("\n").each do |line|
- puts " ** [#{ch[:host]} :: stderr] #{line}"
+ $stderr.puts" ** [#{ch[:host]} :: stderr] #{line}"
$stderr.flush
end
end
@@ -68,7 +68,7 @@ def capture(command)
ch.on_extended_data do |c, type, data|
data.split("\n").each do |line|
- puts " ** [#{server.connection_string} :: stderr] #{line}"
+ $stderr.puts " ** [#{server.connection_string} :: stderr] #{line}"
$stderr.flush
end
end
@@ -76,6 +76,32 @@ def capture(command)
end
end
+ def capture_all(command)
+ {:stdout => "", :stderr => ""}.tap do |captured|
+ execute(command, [@current_servers.first]) do |ch|
+ ch.on_data do |c, data|
+ captured[:stdout] << data
+ end
+
+ ch.on_extended_data do |c, type, data|
+ captured[:stderr] << data
+ end
+ end
+ end
+ end
+
+ def erl_call(cookie, node, code)
+ streams = capture_all("echo '#{code}' | erl_call -e -c #{cookie} -n #{node}")
+
+ if !streams[:stderr].empty?
+ raise CommandError, "erl_call #{code} failed on #{@current_servers.first.connection_string}: #{streams[:stderr]}"
+ end
+
+ if !streams[:stdout].include?('{ok,')
+ raise CommandError, "erl_call #{code} failed on #{@current_servers.first.connection_string}: #{streams[:stdout]}"
+ end
+ end
+
def run_task(task_name)
@execution_service.call(task_name)
end
@@ -84,11 +110,13 @@ def run_locally(command)
puts " * executing `#{command}` locally"
status = POpen4.popen4(command) do |stdout, stderr, stdin, pid|
stdout.each_line do |line|
- puts " ** [locally :: stdout] #{line}"
+ $stdout.puts " ** [locally :: stdout] #{line}"
+ $stdout.flush
end
stderr.each_line do |line|
- puts " ** [locally :: stderr] #{line}"
+ $stderr.puts " ** [locally :: stderr] #{line}"
+ $stderr.flush
end
end
View
21 rigger.gemspec
@@ -4,19 +4,17 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{rigger}
- s.version = "0.2.10"
+ s.name = "rigger"
+ s.version = "0.2.11"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["James Golick"]
- s.date = %q{2011-06-21}
- s.default_executable = %q{rig}
- s.description = %q{}
- s.email = %q{jamesgolick@gmail.com}
+ s.date = "2012-01-17"
+ s.description = ""
+ s.email = "jamesgolick@gmail.com"
s.executables = ["rig"]
s.extra_rdoc_files = [
"LICENSE.txt",
- "README.rdoc",
"TODO"
]
s.files = [
@@ -25,7 +23,6 @@ Gem::Specification.new do |s|
"Gemfile",
"Gemfile.lock",
"LICENSE.txt",
- "README.rdoc",
"Rakefile",
"TODO",
"VERSION",
@@ -45,14 +42,16 @@ Gem::Specification.new do |s|
"lib/rigger/task.rb",
"lib/rigger/task_execution_service.rb",
"lib/rigger/task_executor.rb",
+ "readme.md",
+ "rigger.gemspec",
"spec/server_resolver_spec.rb",
"spec/spec_helper.rb"
]
- s.homepage = %q{http://github.com/jamesgolick/rigger}
+ s.homepage = "http://github.com/jamesgolick/rigger"
s.licenses = ["MIT"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.9.2}
- s.summary = %q{}
+ s.rubygems_version = "1.8.10"
+ s.summary = ""
s.test_files = [
"spec/server_resolver_spec.rb",
"spec/spec_helper.rb"

No commit comments for this range

Something went wrong with that request. Please try again.