Class: Lono::Importer
- Inherits:
-
Object
- Object
- Lono::Importer
- Defined in:
- lib/lono/importer.rb,
lib/lono/importer/dsl.rb,
lib/lono/importer/erb.rb,
lib/lono/importer/base.rb,
lib/lono/importer/params.rb,
lib/lono/importer/download.rb,
lib/lono/importer/converter.rb
Defined Under Namespace
Modules: Download Classes: Base, Converter, Dsl, Erb, Params
Instance Method Summary collapse
-
#initialize(options) ⇒ Importer
constructor
A new instance of Importer.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Importer
Returns a new instance of Importer.
3 4 5 6 7 8 9 10 |
# File 'lib/lono/importer.rb', line 3 def initialize() @options = Lono::ProjectChecker.check @blueprint = Lono::Conventions.new().blueprint # Dont use set_blueprint_root because it doesnt exist yet. The import creates it Lono.blueprint_root = "#{Lono.root}/app/blueprints/#{@blueprint}" end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/lono/importer.rb', line 12 def run # Examples: # Lono::Importer::Erb.new(source, options.clone).run # Lono::Importer::Dsl.new(source, options.clone).run type = @options[:type] || 'dsl' importer_class = "Lono::Importer::#{type.classify}" importer_class = Object.const_get(importer_class) importer_class.new(@options).run end |