Sha256: fe5975147d3b0ca560f574680c6787cc8bc4fd991cbd5b4223ac4e968c610427
Contents?: true
Size: 1.41 KB
Versions: 23
Compression:
Stored size: 1.41 KB
Contents
class Lono::Importer class Base < Lono::AbstractBase include Download include Thor::Actions include Thor::Base def initialize(options) reinitialize(options) @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] puts "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 != @template "configs/#{@blueprint}/params/#{env}/#{@template}.txt" else "configs/#{@blueprint}/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
23 entries across 23 versions & 1 rubygems