Class: MetaBuild::Parser::ParserFactory
- Inherits:
-
Object
- Object
- MetaBuild::Parser::ParserFactory
- Defined in:
- lib/meta_build/parser/parser_factory.rb
Class Method Summary collapse
Class Method Details
.build(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/meta_build/parser/parser_factory.rb', line 7 def build( = {}) ext = File.extname([:file]).sub /\A\./, '' case ext when 'ear' then EarParser.new when 'war' then WarParser.new when 'jar' then JarParser.new else raise MetaBuild::Exceptions::MetaBuildException.new "Could not find suitable parser to '#{ext.upcase}' type." end end |