Skip to content
Browse files

refactor

  • Loading branch information...
1 parent 95f604e commit c095377b625dbbd2f7c0c4f940961042856c9dea @hsbt committed
Showing with 5 additions and 13 deletions.
  1. +0 −1 lib/heroku_scale_scheduler.rb
  2. +5 −1 lib/heroku_scale_scheduler/client.rb
  3. +0 −11 lib/heroku_scale_scheduler/config.rb
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

0 comments on commit c095377

Please sign in to comment.
Something went wrong with that request. Please try again.