sprockets-bumble_d 1.0.0 → 1.1.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: e344b1743d35a046b99bbc04c8e28345d7d41214
4
- data.tar.gz: 307b8f0365ae245ab881b5cff1f75d9163beaf9b
3
+ metadata.gz: 1c28bf102b37d7cd1d004921a300e84e6e5c061f
4
+ data.tar.gz: af0245aee73d77674416b5ea4e70154e7e726a87
5
5
  SHA512:
6
- metadata.gz: 6a751efa6deee7bb1b77e4acbf1acb7aee4d4063c91fd5746f184fe4ef58d51fe8329dedea49ff185997d62f355eb1bcce2e1551c2ca3616e4e235712f25e4d9
7
- data.tar.gz: a539c07de181232403dffc71c06f9b8c887e0b97a7c38d94757b40678e0ebed5f91201231ce2628dda3b78d646e23857d566d9850ed5dd93a754ad4c6b85d0c3
6
+ metadata.gz: def03f875401ec22cb73ef41579638cde4daf004cce6a62131d38b84273f50e3359750615aaf02c623e931d7b1ce7e8cdb205547f91069c993a296afd47f1b57
7
+ data.tar.gz: 18392c5d1e31ff6cc2fc769228fa2ba9d9fb7142731ad7a70da6d1468f6f76b8212855d2888c4237252c1f26563a3f35719f879e22dde9ee9e8a50b9a3effa6b
@@ -17,7 +17,7 @@ module Sprockets
17
17
 
18
18
  attr_reader :cache_key
19
19
 
20
- # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
20
+ # rubocop:disable Metrics/MethodLength
21
21
  def initialize(options)
22
22
  @options = options.dup
23
23
  @root_dir = @options.delete(:root_dir)
@@ -30,12 +30,7 @@ module Sprockets
30
30
  raise RootDirectoryDoesNotExistError, error_message
31
31
  end
32
32
 
33
- resolver = Resolver.new(babel)
34
- plugins = @options[:plugins]
35
- presets = @options[:presets]
36
- @options[:plugins] = resolver.resolve_plugins(plugins) if plugins.is_a?(Array)
37
- @options[:presets] = resolver.resolve_presets(presets) if presets.is_a?(Array)
38
-
33
+ @resolution_complete = false
39
34
  @cache_key = [
40
35
  self.class.name,
41
36
  VERSION,
@@ -43,7 +38,7 @@ module Sprockets
43
38
  @options
44
39
  ].freeze
45
40
  end
46
- # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
41
+ # rubocop:enable Metrics/MethodLength
47
42
 
48
43
  # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
49
44
  def call(input)
@@ -62,7 +57,7 @@ module Sprockets
62
57
  filename: input[:filename],
63
58
  filenameRelative: filename_relative,
64
59
  ast: false
65
- }.merge(@options)
60
+ }.merge(options_with_resolved_plugins_and_presets)
66
61
 
67
62
  if options[:moduleIds] && options[:moduleRoot]
68
63
  options[:moduleId] ||= File.join(options[:moduleRoot], input[:name])
@@ -84,6 +79,20 @@ module Sprockets
84
79
  def babel
85
80
  @babel ||= BabelBridge.new(@root_dir)
86
81
  end
82
+
83
+ private
84
+
85
+ def options_with_resolved_plugins_and_presets
86
+ unless @resolution_complete
87
+ resolver = Resolver.new(babel)
88
+ plugins = @options[:plugins]
89
+ presets = @options[:presets]
90
+ @options[:plugins] = resolver.resolve_plugins(plugins) if plugins.is_a?(Array)
91
+ @options[:presets] = resolver.resolve_presets(presets) if presets.is_a?(Array)
92
+ @resolution_complete = true
93
+ end
94
+ @options
95
+ end
87
96
  end
88
97
  end
89
98
  end
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module BumbleD
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.1.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-bumble_d
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Macklin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-30 00:00:00.000000000 Z
11
+ date: 2017-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties