Class: BaseChip::GeneratorMenu

Inherits:
Menu
  • Object
show all
Includes:
Cli
Defined in:
lib/base_chip/generator_menu.rb

Instance Method Summary collapse

Methods included from Cli

included

Methods inherited from Menu

#list_line, #smart_print

Methods included from Reporting

included

Instance Method Details

#block(name) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/base_chip/generator_menu.rb', line 24

def block(name)
  BaseChip.load_environment
  BaseChip.find_root(dir = nil)
  @block_name = name
  BaseChip.build_directory_structure(name,BaseChip.block_directories)
  BaseChip.erb_template "#{BaseChip::GEM_DIR}/collateral/block/block.rb.erb", "#{BaseChip.root}/#{name}/base_chip/block.rb"
  FileUtils.cd BaseChip.root
  puts "block '#{name}' generation complete"

  if options.git
    system "git add ./#{name}"
    system "git commit -m 'Initial automated block build of '#{name}' BaseChip.' ./#{name}"

    normal "block '#{name}' has been created."
  end
end

#configuration(block_name, configuration_name) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/base_chip/generator_menu.rb', line 42

def configuration(block_name, configuration_name)
  BaseChip.load_environment
  BaseChip.find_root(dir = nil)
  @configuration_name = configuration_name
  BaseChip.build_directory_structure("#{block_name}/#{configuration_name}",BaseChip.configuration_directories)
  BaseChip.erb_template "#{BaseChip::GEM_DIR}/collateral/configuration/configuration.rb.erb", "#{BaseChip.root}/#{block_name}/#{configuration_name}/base_chip/configuration.rb"
  FileUtils.cd BaseChip.root
  puts "configuration '#{block_name}:#{configuration_name}' generation complete"

  if options.git
    system "git add ./#{block_name}/#{configuration_name}"
    system "git commit -m 'Initial automated configuration build of '#{configuration_name}' BaseChip.' ./#{block_name}/#{configuration_name}"

    normal "configuration '#{configuration_name}' has been created."
  end
end

#tool(name) ⇒ Object



60
61
62
# File 'lib/base_chip/generator_menu.rb', line 60

def tool(name)
  puts "tool generation complete"
end