Class: Fudge::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/fudge/generator.rb

Overview

Generator for default Fudgefile

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pwd) ⇒ Generator

Returns a new instance of Generator.



6
7
8
# File 'lib/fudge/generator.rb', line 6

def initialize(pwd)
  @pwd = pwd
end

Instance Attribute Details

#pwdObject (readonly)

Returns the value of attribute pwd.



4
5
6
# File 'lib/fudge/generator.rb', line 4

def pwd
  @pwd
end

Instance Method Details

#write_fudgefileObject

Writes the fudgefile to initialized directory unless on present



11
12
13
14
15
16
17
18
# File 'lib/fudge/generator.rb', line 11

def write_fudgefile
  if exists?
    "Fudgefile already exists."
  else
    writer { |file| file << build_templated }
    "Fudgefile created."
  end
end