lib/negroku/helpers.rb in negroku-1.1.4 vs lib/negroku/helpers.rb in negroku-1.1.5

- old
+ new

@@ -41,23 +41,23 @@ end end # Create the new deploy puts "[Negroku] => Writing new deploy.rb." - erb = File.read(File.join(File.dirname(__FILE__), 'templates', 'deploy.rb.erb')) + erb = getTemplate 'deploy.rb.erb' File.open(deployfile, 'w') do |f| f.write ERB.new(erb).result(binding) end # Create the new configuration stages puts "[Negroku] => Writing new deploy/staging.rb" - erb = File.read(File.join(File.dirname(__FILE__), 'templates', 'staging.rb.erb')) + erb = getTemplate 'staging.rb.erb' File.open(stagingfile, 'w') do |f| f.write ERB.new(erb).result(binding) end puts "[Negroku] => Writing new deploy/production.rb" - erb = File.read(File.join(File.dirname(__FILE__), 'templates', 'production.rb.erb')) + erb = getTemplate 'production.rb.erb' File.open(productionfile, 'w') do |f| f.write ERB.new(erb).result(binding) end # Prepares the Capfile for negroku @@ -71,9 +71,13 @@ def showConfig() # Load the yaml file config = getConfig puts config +end + +def getTemplate(template) + File.read(File.join(File.dirname(__FILE__), 'templates', template)) end ## # Helper Method that assists in loading in tasks from the tasks folder def load_tasks(tasks)