execjs 0.4.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,8 @@
1
1
  require "rbconfig"
2
2
 
3
3
  module ExecJS
4
+ VERSION = "1.0.0"
5
+
4
6
  class Error < ::StandardError; end
5
7
  class RuntimeError < Error; end
6
8
  class ProgramError < Error; end
@@ -134,6 +134,7 @@ module ExecJS
134
134
  if "".respond_to?(:force_encoding)
135
135
  def sh(command)
136
136
  output, options = nil, {}
137
+ options[:external_encoding] = 'UTF-8'
137
138
  options[:internal_encoding] = @conversion[:from] if @conversion
138
139
  IO.popen(command, options) { |f| output = f.read }
139
140
  output.force_encoding(@conversion[:to]) if @conversion
@@ -22,9 +22,9 @@ module ExecJS
22
22
  end
23
23
  rescue ::V8::JSError => e
24
24
  if e.value["name"] == "SyntaxError"
25
- raise RuntimeError, e
25
+ raise RuntimeError, e.message
26
26
  else
27
- raise ProgramError, e
27
+ raise ProgramError, e.message
28
28
  end
29
29
  end
30
30
 
@@ -32,9 +32,9 @@ module ExecJS
32
32
  unbox @v8_context.eval(properties).call(*args)
33
33
  rescue ::V8::JSError => e
34
34
  if e.value["name"] == "SyntaxError"
35
- raise RuntimeError, e
35
+ raise RuntimeError, e.message
36
36
  else
37
- raise ProgramError, e
37
+ raise ProgramError, e.message
38
38
  end
39
39
  end
40
40
 
@@ -22,9 +22,9 @@ module ExecJS
22
22
  end
23
23
  rescue ::Rhino::JavascriptError => e
24
24
  if e.message == "syntax error"
25
- raise RuntimeError, e
25
+ raise RuntimeError, e.message
26
26
  else
27
- raise ProgramError, e
27
+ raise ProgramError, e.message
28
28
  end
29
29
  end
30
30
 
@@ -32,9 +32,9 @@ module ExecJS
32
32
  unbox @rhino_context.eval(properties).call(*args)
33
33
  rescue ::Rhino::JavascriptError => e
34
34
  if e.message == "syntax error"
35
- raise RuntimeError, e
35
+ raise RuntimeError, e.message
36
36
  else
37
- raise ProgramError, e
37
+ raise ProgramError, e.message
38
38
  end
39
39
  end
40
40
 
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: execjs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 4
9
- - 0
10
- version: 0.4.0
5
+ version: 1.0.0
11
6
  platform: ruby
12
7
  authors:
13
8
  - Sam Stephenson
@@ -16,7 +11,7 @@ autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
13
 
19
- date: 2011-05-17 00:00:00 -05:00
14
+ date: 2011-05-18 00:00:00 -05:00
20
15
  default_executable:
21
16
  dependencies:
22
17
  - !ruby/object:Gem::Dependency
@@ -27,10 +22,6 @@ dependencies:
27
22
  requirements:
28
23
  - - ~>
29
24
  - !ruby/object:Gem::Version
30
- hash: 15
31
- segments:
32
- - 1
33
- - 0
34
25
  version: "1.0"
35
26
  type: :runtime
36
27
  version_requirements: *id001
@@ -42,9 +33,6 @@ dependencies:
42
33
  requirements:
43
34
  - - ">="
44
35
  - !ruby/object:Gem::Version
45
- hash: 3
46
- segments:
47
- - 0
48
36
  version: "0"
49
37
  type: :development
50
38
  version_requirements: *id002
@@ -56,9 +44,6 @@ dependencies:
56
44
  requirements:
57
45
  - - ">="
58
46
  - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
47
  version: "0"
63
48
  type: :development
64
49
  version_requirements: *id003
@@ -70,9 +55,6 @@ dependencies:
70
55
  requirements:
71
56
  - - ">="
72
57
  - !ruby/object:Gem::Version
73
- hash: 3
74
- segments:
75
- - 0
76
58
  version: "0"
77
59
  type: :development
78
60
  version_requirements: *id004
@@ -114,18 +96,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
96
  requirements:
115
97
  - - ">="
116
98
  - !ruby/object:Gem::Version
117
- hash: 3
118
- segments:
119
- - 0
120
99
  version: "0"
121
100
  required_rubygems_version: !ruby/object:Gem::Requirement
122
101
  none: false
123
102
  requirements:
124
103
  - - ">="
125
104
  - !ruby/object:Gem::Version
126
- hash: 3
127
- segments:
128
- - 0
129
105
  version: "0"
130
106
  requirements: []
131
107