Class: Albacore::Asmver::Task

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/albacore/task_types/asmver.rb

Instance Method Summary collapse

Methods included from Logging

#debug, #err, #error, #fatal, #info, #puts, #trace, #warn

Constructor Details

#initialize(opts) ⇒ Task

Returns a new instance of Task.



133
134
135
# File 'lib/albacore/task_types/asmver.rb', line 133

def initialize opts
  @opts = opts
end

Instance Method Details

#executeObject



136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/albacore/task_types/asmver.rb', line 136

def execute
  lang  = @opts.get :language
  ns    = @opts.get :namespace
  attrs = @opts.get :attributes
  out   = @opts.get :out do
    trace { "asmver being written at '#{@opts.get :file_path}' [asmver-task #execute]" }
    File.open(@opts.get(:file_path), 'w')
  end
  ::Albacore::Asmver::FileGenerator.new(lang, ns, @opts).generate out, attrs
  trace { "asmver was written at '#{@opts.get :file_path}' [asmver-task #execute]" }
ensure
  out.close if out
end