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