Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactor

  • Loading branch information...
commit c095377b625dbbd2f7c0c4f940961042856c9dea 1 parent 95f604e
@hsbt authored
View
1  lib/heroku_scale_scheduler.rb
@@ -1,3 +1,2 @@
-require 'heroku_scale_scheduler/config'
require 'heroku_scale_scheduler/client'
require 'heroku_scale_scheduler/railtie'
View
6 lib/heroku_scale_scheduler/client.rb
@@ -2,9 +2,13 @@
module HerokuScaleScheduler
class Client
+ def config
+ path = Rails.root.join('config', 'heroku_ps.yml')
+ @config ||= File.exists?(path) ? YAML.load_file(path) : {}
+ end
+
def run(type = :ps)
client = Heroku::Client.new(*Heroku::Auth.read_credentials)
- config = HerokuScaleScheduler::Config.read_config
run_at = (Time.now.strftime('%H%M').to_i / 10) * 10
config.keys.each do |app|
View
11 lib/heroku_scale_scheduler/config.rb
@@ -1,11 +0,0 @@
-module HerokuScaleScheduler
- class Config
- def self.read_config
- if File.exists? Rails.root.join('config', 'heroku_ps.yml')
- YAML.load(File.read(Rails.root.join('config', 'heroku_ps.yml')))
- else
- {}
- end
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.