class Kurgan::Extend

Public Class Methods

source_root() click to toggle source
# File lib/kurgan/extend.rb, line 10
def self.source_root
  File.dirname(__FILE__)
end

Public Instance Methods

add_component() click to toggle source
# File lib/kurgan/extend.rb, line 41
def add_component
  insert_into_file @cfhighlander_template, "\tComponent name: '#{@name}', template: '#{@name}'\n\n", :before => /^end/
end
create_cfhighlander_files() click to toggle source
# File lib/kurgan/extend.rb, line 34
def create_cfhighlander_files
  opts = {template: @template, name: @name}
  template('templates/cfhighlander.extend.rb.tt', "#{@name}/#{@name}.cfhighlander.rb", opts)
  template('templates/config.yaml.tt', "#{@name}/#{@name}.config.yaml")
  template('templates/cfndsl.rb.tt', "#{@name}/#{@name}.cfndsl.rb")
end
create_sub_dir_for_extended_component() click to toggle source
# File lib/kurgan/extend.rb, line 25
def create_sub_dir_for_extended_component
  empty_directory @name
end
get_cfhighlander_template() click to toggle source
# File lib/kurgan/extend.rb, line 14
def get_cfhighlander_template
  @cfhighlander_template = Dir['*.cfhighlander.rb'][0]
  if @cfhighlander_template.nil?
    raise "No cfhighlander.rb file found in #{Dir.pwd}, are you in a cfhighlander project folder?"
  end
end
get_component_name() click to toggle source
# File lib/kurgan/extend.rb, line 21
def get_component_name
  @name = options[:name] || component
end
get_template_version() click to toggle source
# File lib/kurgan/extend.rb, line 29
def get_template_version
  @template = options[:version] ? "#{component}@#{options[:version]}" : component
  say "extending #{@template} to the #{@cfhighlander_template.split('.')[0]} project"
end