sprockets-illusionist 0.0.8 → 0.0.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6defa82d1b3604fae45f0018f645e582a3e0bf95
|
4
|
+
data.tar.gz: e27753fd82ffdf0b260e68ab22c7633f23203c85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ad4aa170e1734ed0967140dde311eef8cfceddf66f1f80f260759170aff6415f577764ef4a053f906395d5605c4c6cde8c3313841d2b9f877190df899528605
|
7
|
+
data.tar.gz: db9b25cd20d5d3853a717e255f6d7b5ab3f8c208ec7c6fd69f4ca5663ee75435ec018f7d97877f539beb423c7232aff61de0b17b97bf0658adecf705362ec1a2
|
@@ -3,6 +3,8 @@ require 'open3'
|
|
3
3
|
require 'tilt'
|
4
4
|
|
5
5
|
module SprocketsIllusionist
|
6
|
+
TranspileError = Class.new(StandardError)
|
7
|
+
|
6
8
|
class IllusionistTemplate < Tilt::Template
|
7
9
|
self.default_mime_type = 'application/javascript'
|
8
10
|
|
@@ -11,7 +13,12 @@ module SprocketsIllusionist
|
|
11
13
|
|
12
14
|
def evaluate(scope, locals, &block)
|
13
15
|
stdout, stderr, _status = Open3.capture3("#{node_path} #{illusionist_path} #{option_string_from_config}", stdin_data: data)
|
14
|
-
|
16
|
+
|
17
|
+
if stderr.empty?
|
18
|
+
stdout
|
19
|
+
else
|
20
|
+
raise TranspileError, stderr
|
21
|
+
end
|
15
22
|
end
|
16
23
|
|
17
24
|
private
|
@@ -52,11 +59,5 @@ module SprocketsIllusionist
|
|
52
59
|
|
53
60
|
options.join(' ')
|
54
61
|
end
|
55
|
-
|
56
|
-
def render_error(error)
|
57
|
-
error = error.split("\n")[1].gsub('"', '\\"')
|
58
|
-
"// The file could not be compiled into JavaScript
|
59
|
-
document.getElementsByTagName('body')[0].innerHTML = \"<pre>#{file}<br />#{error}</pre>\";"
|
60
|
-
end
|
61
62
|
end
|
62
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-illusionist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Demers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|