Class: Kurgan::Add
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Kurgan::Add
- Includes:
- Thor::Actions
- Defined in:
- lib/kurgan/add.rb
Instance Method Summary collapse
- #add_component ⇒ Object
- #create_config ⇒ Object
- #get_cfhighlander_template ⇒ Object
- #get_component_name ⇒ Object
- #get_template_version ⇒ Object
Instance Method Details
#add_component ⇒ Object
26 27 28 |
# 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 ⇒ Object
30 31 32 |
# File 'lib/kurgan/add.rb', line 30 def create_config create_file "#{@name}.config.yaml" end |
#get_cfhighlander_template ⇒ Object
10 11 12 13 14 15 |
# 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 ⇒ Object
17 18 19 |
# File 'lib/kurgan/add.rb', line 17 def get_component_name @name = [:name] || component end |
#get_template_version ⇒ Object
21 22 23 24 |
# File 'lib/kurgan/add.rb', line 21 def get_template_version @template = [:version] ? "#{component}@#{[:version]}" : component say "adding #{@template} to the #{@cfhighlander_template.split('.')[0]} project" end |