Class: Appifier::Actors::Retriever
- Inherits:
-
Object
- Object
- Appifier::Actors::Retriever
- Extended by:
- Carioca::Injector
- Defined in:
- lib/appifier/actors/retriever.rb
Constant Summary collapse
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(origin:, type: :archive, destination: File.expand_path(Appifier::DEFAULT_TEMPLATES_PATH)) ⇒ Retriever
constructor
A new instance of Retriever.
Constructor Details
#initialize(origin:, type: :archive, destination: File.expand_path(Appifier::DEFAULT_TEMPLATES_PATH)) ⇒ Retriever
Returns a new instance of Retriever.
35 36 37 38 39 40 |
# File 'lib/appifier/actors/retriever.rb', line 35 def initialize(origin:, type: :archive, destination: File.(Appifier::DEFAULT_TEMPLATES_PATH)) @origin = origin @type = type @destination = destination output.info "Retrieving template from #{origin}" end |
Instance Method Details
#get ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/appifier/actors/retriever.rb', line 42 def get template = TYPE[@type].get origin: @origin, destination: @destination result = Appifier::Components::Template.validate!(template: template) unless result[:error].empty? output.ko "Template #{template} retrieving cancelled" Appifier::Components::Template.rm(template) unless result[:error].empty? end return result end |