fate 0.2.16 → 0.2.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,7 @@ class Fate
22
22
  @spec = spec
23
23
  @logger = @service.logger["Fate Control"]
24
24
 
25
- @manager = ProcessManager.new(@service)
25
+ @manager = ProcessManager.new(@service, options)
26
26
  end
27
27
 
28
28
  def log(*args, &block)
@@ -7,7 +7,8 @@ class Fate
7
7
  class ProcessManager
8
8
 
9
9
  attr_reader :logger, :output_handlers
10
- def initialize(service)
10
+ def initialize(service, options={})
11
+ @directory = options[:directory]
11
12
  @mutex = Mutex.new
12
13
  @service = service
13
14
  @output_handlers = @service.output_handlers
@@ -74,7 +75,13 @@ class Fate
74
75
  pid = nil
75
76
  @mutex.synchronize do
76
77
  unless @down_in_flames
77
- pipe = IO.popen(command, "r", :err => :out)
78
+ if @directory
79
+ Dir.chdir @directory do
80
+ pipe = IO.popen(command, "r", :err => :out)
81
+ end
82
+ else
83
+ pipe = IO.popen(command, "r", :err => :out)
84
+ end
78
85
  pid = pipe.pid
79
86
  logger.info "Starting '#{name}' (pid #{pid})"
80
87
 
@@ -38,6 +38,7 @@ class Fate
38
38
 
39
39
  attr_reader :names, :commands, :completions, :specification
40
40
  attr_reader :output_handlers, :logger
41
+
41
42
  def initialize(specification, options)
42
43
  stringify(specification)
43
44
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-21 00:00:00.000000000 Z
12
+ date: 2013-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json