Method: ALib::ConfigFile.gen_template
- Defined in:
- lib/alib-0.5.1/configfile.rb
.gen_template(port = nil) ⇒ Object
–}}}
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/alib-0.5.1/configfile.rb', line 23 def gen_template port = nil #--{{{ port ||= STDOUT buf = @default_text || @config.to_yaml if port.respond_to? 'write' port.write buf port.write "\n" else open("#{ port }", 'w'){|f| f.puts buf} end #--}}} end |