Sha256: 505ce0a28e60d14170a619306236b97b0e931f4c0e3056433cc938987c430a23
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
class Lono::Importer class Base < Lono::CLI::Base include Download include Thor::Actions include Thor::Base def initialize(options) super @source = options[:source] @tmp_path = "/tmp/lono/import/template.yml" self.destination_root = Dir.pwd # Thor::Actions require destination_root to be set end private def summarize return unless @options[:summary] logger.info "Template Summary:" Lono::Inspector::Summary.new(@options).run end def create_params(template_path) create_params_file(template_path, "development") create_params_file(template_path, "production") end def create_params_file(template_path, env) params_path = if @blueprint.name != @template "config/#{@blueprint.name}/params/#{env}/#{@template}.txt" else "config/#{@blueprint.name}/params/#{env}.txt" end params = Params.new(template_path, params_path) params.create end # removes the ./ at the beginning if it's there in the path def pretty_path(path) path.sub("#{Lono.root}/",'') end def blueprint_name return @options[:name] if @options[:name] # Else infer name from the original source. name = File.basename(@source, ".*") @options[:casing] == "camelcase" ? name.camelize : name.underscore.dasherize end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lono-8.0.0.pre.rc3 | lib/lono/importer/base.rb |