lib/marv/builder.rb in marv-0.2.2 vs lib/marv/builder.rb in marv-0.2.3
- old
+ new
@@ -65,10 +65,13 @@
File.delete(temp_filename)
end
# Empty out the build directory
def clean_build_directory
+ # create build path if it does not exist
+ FileUtils.mkdir_p(@project.build_path) unless File.exists?(@project.build_path)
+ # Empty the build path
FileUtils.rm_rf Dir.glob(File.join(@project.build_path, '*'))
end
def clean_templates
# TODO: cleaner way of removing templates only?
@@ -113,11 +116,11 @@
functions_paths = Dir.glob(File.join(@functions_path, '*')).reject do |filename|
[functions_erb_path, functions_php_path].include?(filename)
end
unless functions_paths.empty?
- # Create the includes folder in the build directory
+ # Create the functions folder in the build directory
FileUtils.mkdir_p(File.join(@project.build_path, 'functions'))
# Iterate over all files in source/functions, skipping the actual functions.php file
paths = Dir.glob(File.join(@functions_path, '**', '*')).reject {|filename| [functions_erb_path, functions_php_path].include?(filename) }
@@ -152,11 +155,11 @@
def clean_images
FileUtils.rm_rf File.join(@project.build_path, 'images')
end
def build_assets
- [['style.css'], ['ie.css'], ['javascripts', 'theme.js'], ['javascripts', 'admin.js']].each do |asset|
+ [['style.css'], ['admin.css'], ['javascripts', 'theme.js'], ['javascripts', 'admin.js']].each do |asset|
destination = File.join(@project.build_path, asset)
sprocket = @sprockets.find_asset(asset.last)
# Catch any sprockets errors and continue the process
@@ -224,10 +227,10 @@
end
def init_sprockets
@sprockets = Sprockets::Environment.new
- ['javascripts', 'stylesheets', 'lib'].each do |dir|
+ ['javascripts', 'stylesheets'].each do |dir|
@sprockets.append_path File.join(@assets_path, dir)
end
# Add assets/styleshets to load path for Less Engine
Tilt::LessTemplateWithPaths.load_path = File.join(@assets_path, 'stylesheets')