Class: Albacore::Tools::FluentMigrator::MigrateCmdFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/albacore/tools/fluent_migrator.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMigrateCmdFactory

Returns a new instance of MigrateCmdFactory.



160
161
162
# File 'lib/albacore/tools/fluent_migrator.rb', line 160

def initialize
  raise "don't create this class"
end

Class Method Details

.create(*args) ⇒ Object



163
164
165
166
167
168
169
170
171
172
173
# File 'lib/albacore/tools/fluent_migrator.rb', line 163

def self.create *args
  ::Albacore.application.logger.debug "in create"
  
  opts = Map.options args
  opts.apply :file => ENV['FILE']
  return ::Albacore::Tools::FluentMigrator::Cmd.new(*args) unless opts.get( :file )

  ::Albacore.application.logger.debug "Found FILE environment var: #{opts.get :file}"
  args = args.push(:file => opts.get(:file))
  return ::Albacore::Tools::FluentMigrator::BatchMigrateTask.new(*args)
end