freyr 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -36,7 +36,7 @@ module Freyr
36
36
  service = get_from_name(name).first
37
37
 
38
38
  if service
39
- if service.ping
39
+ if service.info.ping
40
40
  pinger = Pinger.new(service)
41
41
  resp = pinger.ping
42
42
  if pinger.success?
data/lib/freyr/command.rb CHANGED
@@ -3,7 +3,7 @@ module Freyr
3
3
  class Command
4
4
  extend Forwardable
5
5
 
6
- attr_reader :name, :service
6
+ attr_reader :service
7
7
 
8
8
  def initialize(service, command=nil, args = {})
9
9
  @service = service
@@ -17,7 +17,7 @@ module Freyr
17
17
  end
18
18
 
19
19
  def run!
20
- return unless command
20
+ raise "no start command found for service #{name}" unless command
21
21
  kill! if service.alive?
22
22
 
23
23
  require_admin
data/lib/freyr/pinger.rb CHANGED
@@ -47,6 +47,8 @@ module Freyr
47
47
  t = Time.now
48
48
  @response = Net::HTTP.get_response(uri)
49
49
  rescue Errno::ECONNREFUSED
50
+ rescue Exception => e
51
+ STDERR.puts "Error fetching #{@url}: #{e}"
50
52
  ensure
51
53
  @time = Time.now-t
52
54
  @response
data/lib/freyr/service.rb CHANGED
@@ -22,9 +22,9 @@ module Freyr
22
22
 
23
23
  def pid_file
24
24
  @pid_file ||= begin
25
- raise NoProcMatch, "please provide proc_match for service #{@info.name}" unless @info.proc_match
25
+ raise NoProcMatch, "please provide proc_match for service #{@info.name} defined in #{info.defined_in.join(",")}" unless @info.proc_match
26
26
  PidFile.new(@info.pid_file,@info.proc_match)
27
- end
27
+ end if info.start
28
28
  end
29
29
 
30
30
  def start!
@@ -44,7 +44,7 @@ module Freyr
44
44
  end
45
45
 
46
46
  def alive?
47
- pid_file.alive?
47
+ pid_file.alive? if pid_file
48
48
  end
49
49
 
50
50
  def call_graph
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freyr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tal Atlas