Class: Greg::FileTemplate

Inherits:
DefaultTemplate show all
Defined in:
lib/greg/templates/file_template.rb

Direct Known Subclasses

FromTemplate, GemfileTemplate

Instance Method Summary collapse

Methods inherited from DefaultTemplate

#app_class_name, #app_name

Instance Method Details

#create!Object



7
8
9
10
11
12
13
# File 'lib/greg/templates/file_template.rb', line 7

def create!
  Greg.generator.inside_dir do
    current_file = Pathname(destination).expand_path
    current_file.dirname.mkdir unless current_file.dirname.exist?
    current_file.write(contents)
  end
end

#msgObject



15
16
17
# File 'lib/greg/templates/file_template.rb', line 15

def msg
  "    [create] #{destination}"
end