henry-container 0.1.65 → 0.1.66
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/henry/container/version.rb +1 -1
- data/lib/henry/environment.rb +6 -3
- data/lib/henry/logger_service.rb +17 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b07994fc2dc774f0744a594ae7a6df0835cdbd64
|
4
|
+
data.tar.gz: df34abb88a16cbbbbae388c40bb12d3ac3b92b7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aa249b651843a24f25eec2be145a87424af83f6ebc108464a49386a0150b75cfcb5cf969e403f11c35314ec6bb9b857c0a20d0d05b1f1998d75dbf904c36ffc
|
7
|
+
data.tar.gz: 446276a373f437c3235ac372b5a09970858f593529ae7865bd69a3280fc9ec880a382b85a229c7dd70a272eac6a5c93f465f6ea19c0b018ef53b0f72a2dfb0e5
|
data/lib/henry/environment.rb
CHANGED
@@ -33,8 +33,11 @@ module Henry
|
|
33
33
|
#
|
34
34
|
# @return [Logger] the Task Logger instance.
|
35
35
|
def self.logger
|
36
|
-
|
37
|
-
|
36
|
+
if ENV['DRB_LOGGER_URI']
|
37
|
+
return @@logger ||= DRbObject.new_with_uri(ENV['DRB_LOGGER_URI'])
|
38
|
+
end
|
39
|
+
|
40
|
+
return @@logger ||= Logger.new
|
38
41
|
end
|
39
42
|
|
40
43
|
# Copies the file from the given path to the default export directory
|
@@ -49,7 +52,7 @@ module Henry
|
|
49
52
|
#
|
50
53
|
# @param [String] the attachments path.
|
51
54
|
def self.output_path
|
52
|
-
"#{Henry::Environment.config['output_directory']}/output" || DEFAULT_OUTPUT_DIRECTORY
|
55
|
+
File.path("#{Henry::Environment.config['output_directory']}/output" || DEFAULT_OUTPUT_DIRECTORY)
|
53
56
|
end
|
54
57
|
|
55
58
|
end
|
data/lib/henry/logger_service.rb
CHANGED
@@ -2,19 +2,33 @@ module Henry
|
|
2
2
|
|
3
3
|
class LoggerService
|
4
4
|
|
5
|
-
# Uri where the service will
|
5
|
+
# Uri where the service will be listening.
|
6
6
|
DRB_URI = 'druby://localhost:8787'
|
7
7
|
|
8
|
+
# Range of ports to be used.
|
9
|
+
DRB_PORTS = (8787..8800)
|
10
|
+
|
8
11
|
# Starts the logger service sharing the given Logger.
|
9
12
|
#
|
10
13
|
# @param [Logger] logger the Logger isntance to be shared.
|
11
14
|
def self.start(logger)
|
12
|
-
|
15
|
+
10.times do
|
16
|
+
begin
|
17
|
+
drb_uri = "#{DRB_URI}:#{rand(DRB_PORTS)}"
|
18
|
+
DRb.start_service("#{DRB_URI}:#{port}", logger)
|
19
|
+
ENV['DRB_LOGGER_URI'] = drb_uri
|
20
|
+
rescue Errno::EADDRINUSE
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
return false
|
13
25
|
end
|
14
26
|
|
15
27
|
# Stops the logger service.
|
16
28
|
def self.stop
|
17
|
-
|
29
|
+
DRb.stop_service
|
30
|
+
rescue
|
31
|
+
return false
|
18
32
|
end
|
19
33
|
|
20
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: henry-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.66
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Decurnex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|