heroku_dj_auto_scale 0.0.6 → 0.0.7

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/README.textile CHANGED
@@ -7,8 +7,6 @@ h2. Setup
7
7
  Add the following to the class that will have auto-scalling DJ workers
8
8
 
9
9
  <pre>
10
- require 'heroku_dj_auto_scale'
11
-
12
10
  class Mailer < ActionMailer::Base
13
11
  extend HerokuDjAutoScale
14
12
 
@@ -1,3 +1,3 @@
1
1
  module HerokuDjAutoScale
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -4,14 +4,19 @@ require 'delayed_job'
4
4
  module HerokuDjAutoScale
5
5
  module Scaler
6
6
  class << self
7
- @@heroku = Heroku::Client.new(ENV['HEROKU_USER'], ENV['HEROKU_PASS']) if ENV['USE_HEROKU_SCALING'] == 'true'
8
-
7
+
8
+ def get_heroku
9
+ @heroku = Heroku::Client.new(ENV['HEROKU_USER'], ENV['HEROKU_PASS']) if ENV['USE_HEROKU_SCALING'] == 'true'
10
+ end
11
+
9
12
  def workers
10
- ENV['USE_HEROKU_SCALING'] == 'true' ? @@heroku.info(ENV['HEROKU_APP'])[:workers].to_i : 1
13
+ get_heroku
14
+ ENV['USE_HEROKU_SCALING'] == 'true' ? @heroku.info(ENV['HEROKU_APP'])[:workers].to_i : 1
11
15
  end
12
16
 
13
17
  def workers=(qty)
14
- @@heroku.set_workers(ENV['HEROKU_APP'], qty) if ENV['USE_HEROKU_SCALING'] == 'true'
18
+ get_heroku
19
+ @heroku.set_workers(ENV['HEROKU_APP'], qty) if ENV['USE_HEROKU_SCALING'] == 'true'
15
20
  end
16
21
 
17
22
  def job_count
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_dj_auto_scale
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joel Basson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-14 00:00:00 +02:00
18
+ date: 2011-03-23 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency