squash_javascript 2.0.6 → 2.0.7

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: a9e35a0503ef448fa8f429d08cb40018c2517212
4
- data.tar.gz: 697f9aff6acb9315352be561122f69a103f6b4c7
3
+ metadata.gz: 68f1704dc23d354b114eab772f1959406ffa1087
4
+ data.tar.gz: 28e4307569359cc8a069c665e85746c6967be568
5
5
  SHA512:
6
- metadata.gz: d7e5d2d20a98a2fca3e9745776cd434d1b7059cd91378188a34e8f950872e0d87078a0e4898cf2993282cc60857b4d582f2f2895728f0757216fe974afd3b576
7
- data.tar.gz: 83e11c7ad7ae4cd6d7bed4d6006d98b8b767734914863be212e20ec4d8b96813d2959ccf9ceb9be57847c27f68057bd7d352ed5349791b760c766f7f604ad9fd
6
+ metadata.gz: 88a3ae10fdf148cea0aa4b05f7ef986de4710e372b3c92199eb51f49229911944589765f486f922a119863ae7273be88eb23b9c07702292159ff64f28bf9dbd8
7
+ data.tar.gz: ecab0f1059e9d3af1f0d2f0fd7aa382ddd485d39133ba91608886be0fc55a19e14c288241d0a8203f90ba01dfdaecec50c131fae6049dd2d471329741dc88bcc
@@ -4,6 +4,15 @@ require 'sprockets'
4
4
  # @private
5
5
  class Sprockets::Asset
6
6
  def sourcemap
7
+ resource_path = [Rails.application.config.assets.prefix, logical_path].join('/')
8
+
9
+ if included
10
+ return included.inject(SourceMap::Map.new([], resource_path)) do |map, path|
11
+ asset = @environment.load(path)
12
+ asset.sourcemap + map
13
+ end
14
+ end
15
+
7
16
  relative_path = if pathname.to_s.include?(Rails.root.to_s)
8
17
  pathname.relative_path_from(Rails.root)
9
18
  else
@@ -12,7 +21,6 @@ class Sprockets::Asset
12
21
  # any extensions after the ".js" can be removed, because they will have
13
22
  # already been processed
14
23
  relative_path.gsub! /(?<=\.js)\..*$/, ''
15
- resource_path = [Rails.application.config.assets.prefix, logical_path].join('/')
16
24
 
17
25
  mappings = Array.new
18
26
  to_s.lines.each_with_index do |_, index|
@@ -22,12 +30,3 @@ class Sprockets::Asset
22
30
  SourceMap::Map.new(mappings, resource_path)
23
31
  end
24
32
  end
25
-
26
- # @private
27
- class Sprockets::BundledAsset < Sprockets::Asset
28
- def sourcemap
29
- to_a.inject(SourceMap::Map.new) do |map, asset|
30
- map + asset.sourcemap
31
- end
32
- end
33
- end
@@ -34,7 +34,7 @@ namespace :sourcemaps do
34
34
  Rails.application.assets.each_logical_path(Rails.application.config.assets.precompile) do |path|
35
35
  next unless path.end_with?('.js')
36
36
  asset = Rails.application.assets.find_asset(path)
37
- next unless asset.kind_of?(Sprockets::BundledAsset)
37
+ next unless asset.included
38
38
  map = asset.sourcemap
39
39
  Squash::Uploader.new(Squash::Ruby.configuration(:api_host),
40
40
  skip_verification: Squash::Ruby.configuration(:skip_verification)
@@ -45,7 +45,7 @@ namespace :sourcemaps do
45
45
  'revision' => Squash::Ruby.current_revision,
46
46
  'sourcemap' => Base64.encode64(Zlib::Deflate.deflate(map.as_json.to_json)),
47
47
  'from' => 'concatenated',
48
- 'to' => 'compiled',
48
+ 'to' => 'compiled'
49
49
  }
50
50
  end
51
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squash_javascript
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.4.6
172
+ rubygems_version: 2.5.0
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: Squash client for JavaScript projects