Module: TemplateBuilder::App::ConfWriter

Defined in:
lib/template_builder/app/conf_writer.rb

Class Method Summary collapse

Class Method Details

.write_new_framework(name, priority) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/template_builder/app/conf_writer.rb', line 2

def self.write_new_framework(name,priority)
  #raise Exception, "Framework #{name} already exists." if test ?e, TemplateBuilder::PATH+"/conf/"+name+".yml"
  File.open(File.join(TemplateBuilder::PATH+"/conf/",name+".yml"),"w")
  File.open(File.join(TemplateBuilder::PATH+"/conf/","param.yml"),"a+") do |out|
    out.write "\n#{name} : \n\t help : set the #{name} framework you want use\n\tpriority : #{priority}"
  end
end

.write_new_plugin(framework_name, plugin) ⇒ Object



10
11
12
13
14
# File 'lib/template_builder/app/conf_writer.rb', line 10

def self.write_new_plugin(framework_name, plugin)
  File.open(File.join(TemplateBuilder::PATH+"/conf/",framework_name+".yml"),"a+") do |out|
    out.write plugin
  end
end