lib/negroku/helpers.rb in negroku-1.1.2 vs lib/negroku/helpers.rb in negroku-1.1.3

- old
+ new

@@ -13,11 +13,10 @@ if Dir.entries(target_path).include?("Capfile") puts "[Negroku] => Found Capfile!" else puts "[Negroku] => Capifying!" `capify #{target_path}` - `rm ` end # Find or create config folder unless File.directory?(config_path) puts "[Negroku] => Could not find the \"config\" folder. Creating it now!" @@ -59,21 +58,16 @@ erb = File.read(File.join(File.dirname(__FILE__), 'templates', 'production.rb.erb')) File.open(productionfile, 'w') do |f| f.write ERB.new(erb).result(binding) end - # checks for both require "negroku" and require "negroku/initializer" - unless File.open(File.join('Capfile'), 'r').read.include?('require "negroku"') - puts "[Negroku] => Adding Negroku Loader inside #{capfile}." - File.open(capfile, "a") do |cfile| - cfile << <<-capfile - \n - load 'deploy/assets' - require "negroku" - load negroku - capfile - end - end + # Prepares the Capfile for negroku + cfile = Capfile.new(capfile) + cfile.assets() + puts "[Negroku] => Enabling assets tasks." + cfile.negroku() + puts "[Negroku] => Adding Negroku Loader inside #{capfile}." + end def showConfig() # Load the yaml file config = getConfig