heroku-scalr 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- heroku-scalr (0.1.0)
4
+ heroku-scalr (0.2.1)
5
5
  heroku-api (~> 0.3.8)
6
6
  timers
7
7
 
@@ -11,9 +11,9 @@ GEM
11
11
  addressable (2.3.4)
12
12
  crack (0.3.2)
13
13
  diff-lcs (1.2.4)
14
- excon (0.20.1)
15
- heroku-api (0.3.9)
16
- excon (~> 0.20.1)
14
+ excon (0.21.0)
15
+ heroku-api (0.3.10)
16
+ excon (~> 0.21.0)
17
17
  rake (10.0.4)
18
18
  rspec (2.13.0)
19
19
  rspec-core (~> 2.13.0)
data/heroku-scalr.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.name = File.basename(__FILE__, '.gemspec')
8
8
  s.summary = "Watch and scale your dynos!"
9
9
  s.description = "Issues recurring 'pings' to your Heroku apps and scales dynos up or down depending on pre-defined rules"
10
- s.version = "0.2.0"
10
+ s.version = "0.2.1"
11
11
 
12
12
  s.authors = ["Black Square Media"]
13
13
  s.email = "info@blacksquaremedia.com"
@@ -65,6 +65,11 @@ class Heroku::Scalr::App
65
65
  end
66
66
 
67
67
  do_scale(metric.by)
68
+ rescue => e
69
+ msg = "#{e.class}: #{e.to_s}"
70
+ msg << "\n\t" << e.backtrace.join("\n\t") if e.backtrace
71
+ log :error, msg
72
+ nil
68
73
  end
69
74
 
70
75
  # @param [Symbol] level
@@ -23,6 +23,7 @@ class Heroku::Scalr::Runner
23
23
  SIGNALS.each do |sig|
24
24
  Signal.trap(sig) { stop! }
25
25
  end
26
+
26
27
  loop { timers.wait }
27
28
  end
28
29
 
@@ -53,6 +53,12 @@ describe Heroku::Scalr::App do
53
53
  subject.scale!.should be_nil
54
54
  end
55
55
 
56
+ it "should log errors" do
57
+ subject.api.should_receive(:get_app).and_raise(RuntimeError, "API Error")
58
+ Heroku::Scalr.logger.should_receive(:error)
59
+ subject.scale!.should be_nil
60
+ end
61
+
56
62
  it "should determine scale through metric" do
57
63
  subject.metric.should_receive(:by).and_return(-1)
58
64
  subject.scale!.should == 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-scalr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: