Class: Hyrb::Tasks::DigitalOcean::Init

Inherits:
Hyrb::Task
  • Object
show all
Defined in:
lib/hyrb/tasks/digital_ocean.rb

Instance Attribute Summary

Attributes inherited from Hyrb::Task

#env, #pipeline

Instance Method Summary collapse

Methods inherited from Hyrb::Task

depends, #initialize, prompt, prompts, #run_before

Constructor Details

This class inherits a constructor from Hyrb::Task

Instance Method Details

#run(env) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/hyrb/tasks/digital_ocean.rb', line 25

def run(env)
  # TODO: allow cache referesh to be forced
  env.digital_ocean_cache = Hyrb::Models::Cache::DigitalOcean.new
  env.digital_ocean_cache.class.keys.each do |key|
    env.digital_ocean_cache[key] ||= env.digital_ocean_client.send(key).map(&:attributes)
  end
  env.digital_ocean_cache.save!
end