lib/asset_hat/tasks/js.rb in asset_hat-0.3.0 vs lib/asset_hat/tasks/js.rb in asset_hat-0.3.1
- old
+ new
@@ -39,11 +39,11 @@
"minify_bundle[application]" and return
end
config = AssetHat.config[type]
report_format = ([ENV['FORMAT']] & %w[long short dot])[0] || 'long'
- $stdout.sync = true if report_format == 'dot'
+ $stdout.sync = true if report_format == 'dot' # Output immediately
min_options = {
:engine => config['engine']
}.reject { |k,v| v.blank? }
# Get bundle filenames
@@ -52,11 +52,11 @@
raise "No #{type.upcase} files are specified for the " +
"#{args.bundle} bundle in #{AssetHat::CONFIG_FILEPATH}." and return
end
filepaths = filenames.map do |filename|
parts = filename.split(File::SEPARATOR)
- parts.last << '.' << type
+ parts.last << '.' << type unless parts.last =~ /\.#{type}$/
File.join(
(parts.first.present? ?
AssetHat.assets_dir(type) : # Given path was relative
AssetHat::ASSETS_DIR), # Given path was absolute
parts
@@ -111,10 +111,10 @@
report_format = ENV['FORMAT']
if opts[:show_intro]
print "Minifying #{type.upcase}..."
if report_format == 'dot'
- $stdout.sync = true
+ $stdout.sync = true # Output immediately
else
puts
end
end