lib/tools.rb in capucine-0.1.2 vs lib/tools.rb in capucine-0.1.5

- old
+ new

@@ -6,11 +6,10 @@ require 'fileutils' require 'erb' require "compass-sass.rb" require "coffeescript.rb" require "incloudr.rb" - require "templates.rb" def self.new_project name = nil if name new_project_name = name @@ -25,27 +24,17 @@ self.init files = true end def self.init all = nil - files = [] - content_files = [] - self.archive_file File.join Capucine.settings.working_dir, 'capucine.yaml' if all - content_files = Dir.glob("#{Capucine.settings.gem_content_dir}/shared/**") - content_files.each do |file| - relative_path = file.gsub(File.join(Capucine.settings.gem_content_dir, 'shared', '/'),'') - destination = File.join Capucine.settings.working_dir, relative_path - self.archive_file destination - end + files = Dir.glob File.join(Capucine.settings.gem_content_dir, 'shared', '**') + self.archive_file Capucine.settings.working_dir + FileUtils.cp_r files, Capucine.settings.working_dir end - files << File.join(Capucine.settings.gem_content_dir, 'templates', 'capucine.yaml') - content_files.each {|file| files << file} - - FileUtils.cp_r files, Capucine.settings.working_dir Capucine::Watchr.compile if all Capucine.settings.reset_working_dir end def self.render_template template_file, content = nil