./lib/lux_assets/asset.rb in lux_assets-0.2.23 vs ./lib/lux_assets/asset.rb in lux_assets-0.2.24
- old
+ new
@@ -67,9 +67,12 @@
@asset_path.write data
end
def save_data data
+ # BOM (Byte order mark) remove
+ data.gsub!("\xEF\xBB\xBF".force_encoding("UTF-8"), '')
+
@asset_file = '/assets/%s' % (@target.sub('/', '-') + '-' + Digest::SHA1.hexdigest(data) + '.' + @ext.to_s)
@asset_path = Pathname.new "./public#{@asset_file}"
if LuxAssets::Manifest.add(@target, @asset_file)
@asset_path.write data
\ No newline at end of file