sprockets-rollup 0.4.0 → 0.4.1

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: cfc9dd84ce9de59f600f3e989d3ea6b68857ea6c
4
- data.tar.gz: a518ac4cebc28ac4a070025c8c103f6b7bfb3fb8
3
+ metadata.gz: 4343247a5bc44c2e35166aa0c59c2ebba5b8a4a7
4
+ data.tar.gz: 96fd180d20c93540bc0ca1d0f2dbd8e6a898e240
5
5
  SHA512:
6
- metadata.gz: def1ca4c7d1028f415c2e083ede1a80403f92f57f19525fab6af1c711b80dd072d5aa31c0a29b9805c1934805c19d78a51925ab756e18678c1b63e6dedbd094d
7
- data.tar.gz: 87ab32a95cf4b5816c35d95b1d516e86b500b1b9b1f3d48fcca4ac37f151535f7c744dd3fe2c91346f2cb6b43c77a1222161e2f80f8e5d9f510df236706dd7c6
6
+ metadata.gz: e8d95ccd55f46b6d0b38be8518140dfb991e8f0ed521629226a65235b1cc9d4d17c6bb5f296e2d4910203e010f724fcfdd9aa47c42b9e7f49d6fe9bb68a09258
7
+ data.tar.gz: bfafcf479c385ccb0f5e6f3cba69bf19c0063f138b1f39c42578a3e7825a6deedeaf1db29dbc72c249777308b53a048a7c08b4b2f9f643936e9ba940cd63db16
@@ -11901,5 +11901,8 @@ function readStdin() {
11901
11901
  };
11902
11902
 
11903
11903
  readStdin().then(string => {
11904
- console.log(transform(string).code)
11904
+ console.log(transform(string).code);
11905
+ }).catch(e => {
11906
+ console.log(e.stack);
11907
+ process.exit(1);
11905
11908
  });
@@ -9247,9 +9247,10 @@ exports.VERSION = VERSION;
9247
9247
  exports.rollup = rollup;
9248
9248
  //# sourceMappingURL=rollup.js.map
9249
9249
 
9250
- rollup({entry: process.argv[2]})
9251
- .then(function (bundle) {
9252
- var result = bundle.generate({format: 'iife'});
9253
-
9254
- console.log(result.code);
9255
- })
9250
+ rollup({entry: process.argv[2]}).then(bundle => {
9251
+ var result = bundle.generate({format: 'iife'});
9252
+ console.log(result.code);
9253
+ }).catch(e => {
9254
+ console.log(e.stack);
9255
+ process.exit(1);
9256
+ });
@@ -54,9 +54,28 @@ module Sprockets
54
54
  end
55
55
 
56
56
  def transform(input)
57
+ compile(rollup(input))
58
+ end
59
+
60
+ def rollup(input)
57
61
  path_to_rollup = File.join File.dirname(__FILE__), "rollup.js"
62
+ output = `node #{path_to_rollup} #{input[:filename].shellescape}`
63
+ raise ArgumentError, output if $? != 0
64
+ output
65
+ end
66
+
67
+ def compile(input)
58
68
  path_to_buble = File.join File.dirname(__FILE__), "buble.js"
59
- `node #{path_to_rollup} #{input[:filename].shellescape} | node #{path_to_buble}`
69
+ output = nil
70
+
71
+ IO.popen(['node', path_to_buble], 'r+') do |pipe|
72
+ pipe.write(input)
73
+ pipe.close_write
74
+ output = pipe.read
75
+ end
76
+
77
+ raise ArgumentError, output if $? != 0
78
+ output
60
79
  end
61
80
 
62
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-rollup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liam P. White