royw-drbman 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
data/drbman.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{drbman}
5
- s.version = "0.0.5"
5
+ s.version = "0.0.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Roy Wright"]
9
- s.date = %q{2009-07-17}
9
+ s.date = %q{2009-07-19}
10
10
  s.default_executable = %q{drbman}
11
11
  s.email = %q{roy@wright.org}
12
12
  s.executables = ["drbman"]
@@ -5,14 +5,14 @@ class SieveOfEratosthenes
5
5
 
6
6
  # Use the Sieve of Eratosthenes to find prime numbers
7
7
  #
8
- # @param [Integer] maximum find all primes lower than this maximum value
9
- # @option choices [Array<String>] :dirs array of local directories to copy to the host machines. REQUIRED
10
- # @option choices [String] :run the name of the file to run on the host machine. REQUIRED
8
+ # @param [Integer] maximum find all primes lower than this maximum value - REQUIRED.
9
+ # @option choices [Hash<String,String>] :dirs hash of local directories to copy to the host
10
+ # machines where key is local source and value is directory on host machine - REQUIRED.
11
+ # @option choices [String] :run the name of the file to run on the host machine - REQUIRED.
11
12
  # This file should start the drb server. Note, this file will be daemonized before running.
12
- # @option choices [Array<String>] :hosts array of host machine descriptions "{user{:password}@}machine{:port}"
13
- # This defaults to ['localhost']
14
- # @option choices [Integer] :port default port number used to assign to hosts without a port number.
15
- # The port number is incremented for each host. This defaults to 9000
13
+ # @option choices [Array<String>] :hosts (['localhost']) array of host machine descriptions "{user{:password}@}machine{:port}".
14
+ # @option choices [Integer] :port (9000) default port number used to assign to hosts without a port number,
15
+ # the port number is incremented for each host.
16
16
  # @option choices [Array<String>] :gems array of gem names to verify are installed on the host machine.
17
17
  # Note, 'daemons' is always added to this array.
18
18
  # @param [Logger] logger the logger to use
@@ -25,7 +25,7 @@ class SieveOfEratosthenes
25
25
  @choices[:hosts] = ['localhost'] if @choices[:hosts].blank?
26
26
 
27
27
  # specify the directories to copy to the host machine
28
- @choices[:dirs] = [File.join(File.dirname(__FILE__), '../drb_server')]
28
+ @choices[:dirs] = {File.join(File.dirname(__FILE__), '../drb_server') => 'drb_server'}
29
29
 
30
30
  # set the file to be ran that contains the drb server
31
31
  @choices[:run] = 'drb_server/prime_helper.rb' if @choices[:run].blank?
data/lib/drbman/drbman.rb CHANGED
@@ -15,7 +15,8 @@
15
15
  class Drbman
16
16
  # @param [Logger] logger the logger
17
17
  # @param [UserChoices,Hash] choices
18
- # @option choices [Array<String>] :dirs array of local directories to copy to the host machines (REQUIRED).
18
+ # @option choices [Hash<String,String>] :dirs hash of local directories to copy to the host
19
+ # machines where key is local source and value is directory on host machine - REQUIRED.
19
20
  # @option choices [String] :run the name of the file to run on the host machine (REQUIRED).
20
21
  # This file should start the drb server. Note, this file will be daemonized before running.
21
22
  # @option choices [Array<String>] :hosts (['localhost']) array of host machine descriptions "{user{:password}@}machine{:port}".
@@ -192,12 +193,12 @@ class Drbman
192
193
  def upload_dirs(host)
193
194
  unless @user_choices[:dirs].blank?
194
195
  drb_server_file = File.join(File.dirname(__FILE__), "../drb_server/drbman_server.rb")
195
- @user_choices[:dirs].each do |name|
196
- if File.directory?(name)
197
- host.upload(name, "#{host.dir}/#{File.basename(name)}")
198
- host.upload(drb_server_file, "#{host.dir}/#{File.basename(name)}")
196
+ @user_choices[:dirs].each do |src,dest|
197
+ if File.directory?(src)
198
+ host.upload(src, "#{host.dir}/#{dest}")
199
+ host.upload(drb_server_file, "#{host.dir}/#{dest}/drbman_server.rb")
199
200
  else
200
- @logger.error { "\"#{name}\" is not a directory" }
201
+ @logger.error { "\"#{src}\" is not a directory" }
201
202
  end
202
203
  end
203
204
  end
@@ -111,6 +111,7 @@ class HostMachine
111
111
  @ssh.loop
112
112
  rescue Exception => e
113
113
  # only raise the exception if the files differ
114
+ @logger.debug { e }
114
115
  raise e unless same_files?(local_src, remote_dest)
115
116
  end
116
117
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: royw-drbman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roy Wright
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-17 00:00:00 -07:00
12
+ date: 2009-07-19 00:00:00 -07:00
13
13
  default_executable: drbman
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency