sprockets-commoner 0.2.7 → 0.2.8
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sprockets/commoner/processor.rb +17 -8
- data/lib/sprockets/commoner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a2a4e5d2440a8ed522f71f4d7bcfd23e6a51b21
|
4
|
+
data.tar.gz: 935ba15297c44eb9b83bd00f829d185f5aa0363b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09d56047331034979a9ca533aab2e1efb4ad8602b3fdb71d6e5c0031dbcbf610df9b1214045e4919de597c6b3ada7d6498ae5117e655ccd9540e8da12b2ad502
|
7
|
+
data.tar.gz: 8b215f95572d7073e9e3b4e5d238dca06f6b0cb04fcfd8ed912b026045e9d3b2d998487e42f17537dcc57bac16d37fc438042f3a3ad91405b9213a1b64f9b24c
|
data/CHANGELOG.md
CHANGED
@@ -49,6 +49,7 @@ module Sprockets
|
|
49
49
|
|
50
50
|
attr_reader :include, :exclude, :babel_exclude
|
51
51
|
def initialize(root, include: [root], exclude: ['vendor/bundle'], babel_exclude: [/node_modules/])
|
52
|
+
@root = root
|
52
53
|
@include = include.map {|path| expand_to_root(path, root) }
|
53
54
|
@exclude = exclude.map {|path| expand_to_root(path, root) }
|
54
55
|
@babel_exclude = babel_exclude.map {|path| expand_to_root(path, root) }
|
@@ -56,14 +57,7 @@ module Sprockets
|
|
56
57
|
end
|
57
58
|
|
58
59
|
def cache_key
|
59
|
-
@cache_key ||=
|
60
|
-
self.class.name,
|
61
|
-
VERSION,
|
62
|
-
version,
|
63
|
-
@include.map(&:to_s),
|
64
|
-
@exclude.map(&:to_s),
|
65
|
-
@babel_exclude.map(&:to_s),
|
66
|
-
]
|
60
|
+
@cache_key ||= compute_cache_key
|
67
61
|
end
|
68
62
|
|
69
63
|
def call(input)
|
@@ -107,6 +101,21 @@ module Sprockets
|
|
107
101
|
end
|
108
102
|
|
109
103
|
private
|
104
|
+
def compute_cache_key
|
105
|
+
package_file = File.join(@root, 'node_modules', 'babel-core', 'package.json')
|
106
|
+
raise Schmooze::DependencyError, 'Cannot determine babel version as babel-core has not been installed' unless File.exist?(package_file)
|
107
|
+
package = JSON.parse(File.read(package_file))
|
108
|
+
|
109
|
+
[
|
110
|
+
self.class.name,
|
111
|
+
VERSION,
|
112
|
+
package['version'],
|
113
|
+
@include.map(&:to_s),
|
114
|
+
@exclude.map(&:to_s),
|
115
|
+
@babel_exclude.map(&:to_s),
|
116
|
+
]
|
117
|
+
end
|
118
|
+
|
110
119
|
def expand_to_root(path, root)
|
111
120
|
if path.is_a?(String)
|
112
121
|
File.expand_path(path, root)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-commoner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bouke van der Bijl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sprockets
|