Class: Jackchop::InitGenerator

Inherits:
BaseGenerator show all
Defined in:
lib/jackchop/generators/init_generator.rb

Instance Method Summary collapse

Methods inherited from BaseGenerator

source_root

Instance Method Details

#chef_specObject



17
18
19
20
21
22
23
24
# File 'lib/jackchop/generators/init_generator.rb', line 17

def chef_spec
  require 'chef/knife'
  require 'chef/knife/cookbook_create_specs'
  chef_spec = ChefSpec::Knife::CookbookCreateSpecs.new
  chef_spec.config[:cookbook_path] = File.dirname(target)
  chef_spec.name_args[0] = File.basename(target)
  chef_spec.run
end

#generateObject



8
9
10
11
12
13
14
15
# File 'lib/jackchop/generators/init_generator.rb', line 8

def generate
	template "kitchen.yml.erb", target.join('.kitchen.yml')
	template "travis.yml.erb", target.join('.travis.yml')
	template "Rakefile.erb", target.join("Rakefile")
	template "Strainerfile.erb", target.join("Strainerfile")
    template "Gemfile.erb", target.join("Gemfile"), :force => true
    template "gitignore.erb", target.join(".gitignore"), :force => true
end