class Kurgan::Add

Public Instance Methods

add_component() click to toggle source
# File lib/kurgan/add.rb, line 26
def add_component
  insert_into_file @cfhighlander_template, "  Component name: '#{@name}', template: '#{@template}'\n\n", :before => /^end/
end
create_config() click to toggle source
# File lib/kurgan/add.rb, line 30
def create_config
  create_file "#{@name}.config.yaml"
end
get_cfhighlander_template() click to toggle source
# File lib/kurgan/add.rb, line 10
def get_cfhighlander_template
  @cfhighlander_template = Dir['*.cfhighlander.rb'][0]
  if @cfhighlander_template.nil?
    raise "No cfhighlander.rb file found in #{Dir.pwd}"
  end
end
get_component_name() click to toggle source
# File lib/kurgan/add.rb, line 17
def get_component_name
  @name = options[:name] || component
end
get_template_version() click to toggle source
# File lib/kurgan/add.rb, line 21
def get_template_version
  @template = options[:version] ? "#{component}@#{options[:version]}" : component
  say "adding #{@template} to the #{@cfhighlander_template.split('.')[0]} project"
end