Class: Souschef::Template::Rakefile

Inherits:
Base
  • Object
show all
Defined in:
lib/souschef/template/rakefile.rb

Overview

Add Rakefile for testing support

Instance Attribute Summary

Attributes inherited from Base

#ots, #path

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Rakefile

Returns a new instance of Rakefile.



5
6
7
# File 'lib/souschef/template/rakefile.rb', line 5

def initialize(opts)
  super(opts)
end

Instance Method Details

#createObject

Public - Create a Rakefile from our Template

cookbook - String Cookbook name

Returns nil



14
15
16
17
18
19
20
# File 'lib/souschef/template/rakefile.rb', line 14

def create
  tmpl = ERB.new(load_erb_file('rakefile.erb'))
  data = tmpl.result(binding)

  info 'Setting up Rakefile'
  write_file(cookbook_file_path('Rakefile'), data)
end