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: 8b890de78eaa86da0b7f031887fff6b1e78be55c
4
- data.tar.gz: c2111b0d57f98d8df6baa28519ef5d8d87591fbb
3
+ metadata.gz: 6defa82d1b3604fae45f0018f645e582a3e0bf95
4
+ data.tar.gz: e27753fd82ffdf0b260e68ab22c7633f23203c85
5
5
  SHA512:
6
- metadata.gz: aeb65ad3c1439c36b2cb8d95593dbb2421691dbafd3470d8c639ccd7825e7623371f62384b2bf5e25bd4767e8c44398612ae8b1d128d7181a15ea1ea159d4968
7
- data.tar.gz: f64c7eb4f93583ecb303a429b18bc636990139675b7de6a058b0a1a697044f815f944673f8fa3ad0f0d09a9f4229c4acfa970ed9345fd75d6bee20c25dae8c55
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
- stderr.empty? ? stdout : render_error(stderr)
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
@@ -1,3 +1,3 @@
1
1
  module SprocketsIllusionist
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  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.8
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-25 00:00:00.000000000 Z
11
+ date: 2014-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler