Class: Climine::Command::Config
- Defined in:
- lib/climine/command/config.rb
Constant Summary collapse
- CONFIG =
"climine.yml"- TEMPLATE =
"url: <%= options[:url] %>\napikey: <%= options[:key] %>\n<% if options[:editor] -%>\neditor: <%= options[:editor] %>\n<% end -%>\n"
Instance Method Summary collapse
Instance Method Details
#init ⇒ Object
20 21 22 23 24 25 |
# File 'lib/climine/command/config.rb', line 20 def init return if File.exist?(CONFIG) and !yes?("Overwrite? [#{CONFIG}] (y/n)", :green) open(CONFIG, 'w'){|file| file.write(ERB.new(TEMPLATE, nil, "-").result(binding)) } puts "create [ #{File.expand_path(CONFIG)} ]" end |