Class: Fudge::Generator
- Inherits:
-
Object
- Object
- Fudge::Generator
- Defined in:
- lib/fudge/generator.rb
Overview
Generator for default Fudgefile
Instance Attribute Summary collapse
-
#pwd ⇒ Object
readonly
Returns the value of attribute pwd.
Instance Method Summary collapse
-
#initialize(pwd) ⇒ Generator
constructor
A new instance of Generator.
-
#write_fudgefile ⇒ Object
Writes the fudgefile to initialized directory unless on present.
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
#pwd ⇒ Object (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_fudgefile ⇒ Object
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 |