class MetaBuild::Extractor::ExtractorFactory

Public Class Methods

build(options = {}) click to toggle source
# File lib/meta_build/extractor/extractor_factory.rb, line 7
def build(options = {})
  ext = File.extname(options[:file]).sub /\A\./, ''
  case ext
    when 'ear' then EarExtractor.new options
    when 'war' then WarExtractor.new options
    when 'jar' then JarExtractor.new options
    else raise MetaBuild::Exceptions::MetaBuildException.new "Could not find suitable extractor to '#{ext.upcase}' type."
  end
end