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 +1 -1
- data/drbman.gemspec +2 -2
- data/examples/primes/lib/primes/sieve_of_eratosthenes.rb +8 -8
- data/lib/drbman/drbman.rb +7 -6
- data/lib/drbman/host_machine.rb +1 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
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
|
+
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-
|
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 [
|
10
|
-
#
|
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
|
-
#
|
14
|
-
#
|
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] =
|
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 [
|
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 |
|
196
|
-
if File.directory?(
|
197
|
-
host.upload(
|
198
|
-
host.upload(drb_server_file, "#{host.dir}/#{
|
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 { "\"#{
|
201
|
+
@logger.error { "\"#{src}\" is not a directory" }
|
201
202
|
end
|
202
203
|
end
|
203
204
|
end
|
data/lib/drbman/host_machine.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2009-07-19 00:00:00 -07:00
|
13
13
|
default_executable: drbman
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|