sprockets-exporters_pack 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e33a778f3d05da2627213ff45a03343396ce2d94
4
- data.tar.gz: 396a53a99d373de16262991092b059feb02749cb
3
+ metadata.gz: c9e98a822e69fbac9dc9ab55a2f65203858ab1a2
4
+ data.tar.gz: 7e4c8d69ad672f70df85f7b83932779ad8193837
5
5
  SHA512:
6
- metadata.gz: ac2eb8406e9662ecf347abcbc3bcc1a1be95b6471489feb2209ed84acc65c881212b8a31150d37f96d60e6e2f42c9bfd32d69e58f708c30d9f64d6ae581239fb
7
- data.tar.gz: 5dc14143f9ac7df3a8c175fc7bc2481cd7e898c9f71185c19496209e311fe4b0d243083e457536d44522d880307dfee79a1e53879daebef42ae2501a774428f5
6
+ metadata.gz: c68ab17815f5111d25f015a095eb94501e9827686ee31b803298e04e1fd60b19406c0ebae66857e79cf6e860a8801ec6f4cb0480d541f6170ac3517849710a5b
7
+ data.tar.gz: d3f3cda678688986d4a3701ce86cb254e75840944bfacaf7065b6e81a151b16e4c7b048ce79fb6628624491f26501b7c27809070b25d8b9a05dbbce2bec21c0f
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Sprockets::ExportersPack
2
2
 
3
- This gem aims to add some exporters to [sprockets][rails/sprockets], which are currently [under review][PR].
3
+ This gem aims to add some exporters to [sprockets][rails/sprockets].
4
4
 
5
5
  Currently, it has:
6
- - a Brotli exporter, which should be used with [ngx_brotli][google/ngx_brotli].
6
+ - a Brotli exporter, which can be used with [ngx_brotli][google/ngx_brotli].
7
7
 
8
8
  ## Installation
9
9
 
@@ -13,6 +13,13 @@ Add this line to your `Gemfile`:
13
13
  gem 'sprockets-exporters_pack'
14
14
  ```
15
15
 
16
+ You probably need these too, as sprockets hasn't been updated yet:
17
+
18
+ ```ruby
19
+ gem 'sprockets', '>= 4.0.0.beta3', github: 'rails/sprockets'
20
+ gem 'sprockets-rails', '>= 3.1.0'
21
+ ```
22
+
16
23
  ```bash
17
24
  $ bundle install
18
25
  ```
@@ -42,7 +49,6 @@ Yes please! Open an issue with exporters you want to see added.
42
49
 
43
50
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
44
51
 
45
- [PR]: https://github.com/rails/sprockets/pull/386
46
52
  [rails/sprockets]: https://github.com/rails/sprockets
47
53
  [rails/rails]: https://github.com/rails/rails
48
54
  [google/ngx_brotli]: https://github.com/google/ngx_brotli
@@ -20,9 +20,9 @@ module Sprockets
20
20
 
21
21
  def call
22
22
  data = File.binread(target)
23
- mode = if asset.content_type.match /font|otf/
23
+ mode = if asset.content_type.match self.class.font_regex
24
24
  :font
25
- elsif asset.content_type.match /text|(application\/(javascript|json|xml))/
25
+ elsif asset.content_type.match self.class.text_regex
26
26
  :text
27
27
  else
28
28
  :generic
@@ -37,10 +37,20 @@ module Sprockets
37
37
 
38
38
  class << self
39
39
  attr_writer :quality
40
+ attr_writer :font_regex
41
+ attr_writer :text_regex
40
42
 
41
43
  def quality
42
44
  @quality || 9
43
45
  end
46
+
47
+ def font_regex
48
+ @font_regex || /font|otf/
49
+ end
50
+
51
+ def text_regex
52
+ @text_regex || /text|(application\/(javascript|json|xml))/
53
+ end
44
54
  end
45
55
  end
46
56
  end
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module ExportersPack
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-exporters_pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hans Otto Wirtz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-04 00:00:00.000000000 Z
11
+ date: 2018-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.14'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.14'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: brotli
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.2
47
+ version: 0.2.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.2
54
+ version: 0.2.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sprockets
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 4.0.0.beta3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 4.0.0.beta3
69
69
  description:
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 2.6.8
101
+ rubygems_version: 2.5.2
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Adds multiple exporters to Sprockets