specjour 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/specjour/db_scrub.rb +1 -0
- data/lib/specjour/dispatcher.rb +2 -5
- data/lib/specjour/manager.rb +2 -1
- data/lib/specjour/socket_helpers.rb +11 -0
- data/lib/specjour/worker.rb +1 -0
- data/lib/specjour.rb +2 -5
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.16
|
data/lib/specjour/db_scrub.rb
CHANGED
data/lib/specjour/dispatcher.rb
CHANGED
@@ -2,6 +2,7 @@ module Specjour
|
|
2
2
|
class Dispatcher
|
3
3
|
require 'dnssd'
|
4
4
|
Thread.abort_on_exception = true
|
5
|
+
include SocketHelpers
|
5
6
|
|
6
7
|
attr_reader :project_path, :managers, :manager_threads, :hosts
|
7
8
|
attr_accessor :worker_size
|
@@ -73,10 +74,6 @@ module Specjour
|
|
73
74
|
printer.worker_size = worker_size
|
74
75
|
end
|
75
76
|
|
76
|
-
def hostname
|
77
|
-
@hostname ||= Socket.gethostname
|
78
|
-
end
|
79
|
-
|
80
77
|
def printer
|
81
78
|
@printer ||= begin
|
82
79
|
p = Printer.new
|
@@ -95,7 +92,7 @@ module Specjour
|
|
95
92
|
|
96
93
|
def resolve_reply(reply)
|
97
94
|
DNSSD.resolve!(reply) do |resolved|
|
98
|
-
resolved_ip =
|
95
|
+
resolved_ip = ip_from_hostname(resolved.target)
|
99
96
|
uri = URI::Generic.build :scheme => reply.service_name, :host => resolved_ip, :port => resolved.port
|
100
97
|
fetch_manager(uri)
|
101
98
|
resolved.service.stop if resolved.service.started?
|
data/lib/specjour/manager.rb
CHANGED
@@ -2,6 +2,7 @@ module Specjour
|
|
2
2
|
class Manager
|
3
3
|
require 'dnssd'
|
4
4
|
include DRbUndumped
|
5
|
+
include SocketHelpers
|
5
6
|
|
6
7
|
attr_accessor :project_name, :specs_to_run
|
7
8
|
attr_reader :worker_size, :batch_size, :dispatcher_uri, :registered_projects, :bonjour_service, :worker_pids
|
@@ -26,7 +27,7 @@ module Specjour
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def dispatcher_uri=(uri)
|
29
|
-
uri.host =
|
30
|
+
uri.host = ip_from_hostname(uri.host)
|
30
31
|
@dispatcher_uri = uri
|
31
32
|
end
|
32
33
|
|
data/lib/specjour/worker.rb
CHANGED
data/lib/specjour.rb
CHANGED
@@ -21,9 +21,10 @@ module Specjour
|
|
21
21
|
autoload :MarshalableFailureFormatter, 'specjour/marshalable_failure_formatter'
|
22
22
|
autoload :Printer, 'specjour/printer'
|
23
23
|
autoload :RsyncDaemon, 'specjour/rsync_daemon'
|
24
|
+
autoload :SocketHelpers, 'specjour/socket_helpers'
|
24
25
|
autoload :Worker, 'specjour/worker'
|
25
26
|
|
26
|
-
VERSION = "0.1.
|
27
|
+
VERSION = "0.1.16".freeze
|
27
28
|
|
28
29
|
class Error < StandardError; end
|
29
30
|
|
@@ -40,8 +41,4 @@ module Specjour
|
|
40
41
|
def self.log?
|
41
42
|
logger.level != Logger::UNKNOWN
|
42
43
|
end
|
43
|
-
|
44
|
-
def self.ip_from_hostname(hostname)
|
45
|
-
Socket.getaddrinfo(hostname, nil, Socket::AF_INET, Socket::SOCK_STREAM).first.fetch(3)
|
46
|
-
end
|
47
44
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 16
|
9
|
+
version: 0.1.16
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Sandro Turriate
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/specjour/printer.rb
|
101
101
|
- lib/specjour/protocol.rb
|
102
102
|
- lib/specjour/rsync_daemon.rb
|
103
|
+
- lib/specjour/socket_helpers.rb
|
103
104
|
- lib/specjour/tasks/dispatch.rake
|
104
105
|
- lib/specjour/tasks/specjour.rb
|
105
106
|
- lib/specjour/worker.rb
|