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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a0a7707bd15eb0597e29a15e01772476f27884a
4
- data.tar.gz: 08ce3f51a6cd48d552f5c7cf0a2c3c160ff55704
3
+ metadata.gz: b07994fc2dc774f0744a594ae7a6df0835cdbd64
4
+ data.tar.gz: df34abb88a16cbbbbae388c40bb12d3ac3b92b7c
5
5
  SHA512:
6
- metadata.gz: efd4e048662b41d021ec2f490a452c40e7c0cbb04d6dc702a4d031e7eb4723448d8ab5351224f434a5e14f501ced85ee212deb60b8d20c4550278d3f4cf812d0
7
- data.tar.gz: 193a97e3d33637162bd89d15e46573eb8f8d8ad0e5449e78ee072e836b17910e6373c89599a647f9ed90f4d0aabafd8d7779d37c0966db6d26696926ece3a66e
6
+ metadata.gz: 4aa249b651843a24f25eec2be145a87424af83f6ebc108464a49386a0150b75cfcb5cf969e403f11c35314ec6bb9b857c0a20d0d05b1f1998d75dbf904c36ffc
7
+ data.tar.gz: 446276a373f437c3235ac372b5a09970858f593529ae7865bd69a3280fc9ec880a382b85a229c7dd70a272eac6a5c93f465f6ea19c0b018ef53b0f72a2dfb0e5
@@ -3,7 +3,7 @@ module Henry
3
3
  class Container
4
4
 
5
5
  # Current Gem version
6
- VERSION = ENV['gem_version'] || '0.1.65'
6
+ VERSION = ENV['gem_version'] || '0.1.66'
7
7
 
8
8
  end
9
9
 
@@ -33,8 +33,11 @@ module Henry
33
33
  #
34
34
  # @return [Logger] the Task Logger instance.
35
35
  def self.logger
36
- Logger.new
37
- #return DRbObject.new_with_uri(LoggerService::DRB_URI)
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
@@ -2,19 +2,33 @@ module Henry
2
2
 
3
3
  class LoggerService
4
4
 
5
- # Uri where the service will e listening.
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
- #DRb.start_service(DRB_URI, logger)
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
- #DRb.stop_service
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.65
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-12 00:00:00.000000000 Z
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake