asset_bom_removal-rails 0.0.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f59301107c46145d4c017052fe4d35ddf67e91db
4
- data.tar.gz: 185fba902717de245bdd7ab9399a70b92fe85984
3
+ metadata.gz: a279fa505b26ae133d589793a3e8dbaa44a15f70
4
+ data.tar.gz: f8fff0e413f923bda7b32cd4f70c66c47b156fc5
5
5
  SHA512:
6
- metadata.gz: 7becb82d56a30be368f6d4ca288e4ae012484d715607a05edb8acdb7f17013f9d05d0dec4950c55b56920e668b6bc6cd2302a82876fb1259bc0e62692d197f0f
7
- data.tar.gz: 2682457fadeac5509561b443a469b18eedce056ad22683ebcb2c59acbbed8d15e192bf17b66532b76941e3637b3cbfc1f6d545f9a0e14bd29619c1b63b4a1fbd
6
+ metadata.gz: 52ad807c5ea9ad11d25f735f6ca24dc1069914e876560d49004b454caf332e4b1f46419f00980e0663cb7781b21f898ca4cb01aadda7763276f92b13cfb6d0d8
7
+ data.tar.gz: a80d661216b619a5f4cb34069528f8de38b0f24743ccd6eadef36cae605abc4b5b148835f6039b7af72dc28d8e7df559034d182fb18625384f58db1422c6c091
data/CHANGELOG.md CHANGED
@@ -0,0 +1,3 @@
1
+ # 1.0.0
2
+
3
+ * Hooks into Rails Asset Pipeline as a custom Sass Compressor that strips the utf-8 BOM from compressed css
data/README.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  This gem hooks into [Rails `assets:precompile` task](http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets) and removes the BOM from any CSS files (and their gzipped versions) in the asset root.
4
4
 
5
- We do this because we want to use [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) on our assets, but [a bug in Firefox versions < 52](https://bugzilla.mozilla.org/show_bug.cgi?id=1269241) means it calculates the hash incorrectly when the CSS asset has a [BOM](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) and refuses to load the asset. The BOM is [generated by SASS versions > 3.4](https://github.com/sass/sass/blob/3.4.0/lib/sass/tree/visitors/to_css.rb#L131-L140) and in the versions of rails, sass, sprockets, sass-rails, and sprockets-rails we use it is impossible to configure SASS to stop doing this (as mentioned [in the sass-rails readme](https://github.com/rails/sass-rails/blob/v4.0.0/README.md#configuration) from version 4.0+).
5
+ We do this because we want to use [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) on our assets, but [a bug in Firefox versions < 52](https://bugzilla.mozilla.org/show_bug.cgi?id=1269241) means it calculates the hash incorrectly when the CSS asset has a [UTF-8 BOM](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) and refuses to load the asset. The BOM is [generated by SASS versions > 3.4](https://github.com/sass/sass/blob/3.4.0/lib/sass/tree/visitors/to_css.rb#L131-L140) when the CSS file includes utf-8 characters and in the versions of rails, sass, sprockets, sass-rails, and sprockets-rails we use it is impossible to configure SASS to stop doing this (as mentioned [in the sass-rails readme](https://github.com/rails/sass-rails/blob/v4.0.0/README.md#configuration) from version 4.0+).
6
6
 
7
7
  ## Installation
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'asset-bom-removal-rails'
12
+ gem 'asset_bom_removal-rails'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -34,7 +34,7 @@ After checking out the repo, run `bundle install` to install dependencies. Then,
34
34
 
35
35
  ## Contributing
36
36
 
37
- Bug reports and pull requests are welcome on GitHub at https://github.com/alphagov/asset-bom-removal-rails.
37
+ Bug reports and pull requests are welcome on GitHub at https://github.com/alphagov/asset_bom_removal-rails.
38
38
 
39
39
  ## License
40
40
 
@@ -1,5 +1,5 @@
1
1
  module AssetBomRemoval
2
2
  module Rails
3
- VERSION = '0.0.0'.freeze
3
+ VERSION = '1.0.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asset_bom_removal-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Government Digital Service