execjs 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/execjs/external_runtime.rb +4 -4
  2. metadata +25 -10
@@ -1,4 +1,3 @@
1
- require "json"
2
1
  require "tempfile"
3
2
 
4
3
  module ExecJS
@@ -11,7 +10,7 @@ module ExecJS
11
10
 
12
11
  def eval(source, options = {})
13
12
  if /\S/ =~ source
14
- exec("return eval(#{"(#{source})".to_json})")
13
+ exec("return eval(#{MultiJson.encode("(#{source})")})")
15
14
  end
16
15
  end
17
16
 
@@ -22,7 +21,7 @@ module ExecJS
22
21
  end
23
22
 
24
23
  def call(identifier, *args)
25
- eval "#{identifier}.apply(this, #{args.to_json})"
24
+ eval "#{identifier}.apply(this, #{MultiJson.encode(args)})"
26
25
  end
27
26
 
28
27
  protected
@@ -47,7 +46,7 @@ module ExecJS
47
46
  end
48
47
 
49
48
  def extract_result(output)
50
- status, value = output.empty? ? [] : JSON.parse(output)
49
+ status, value = output.empty? ? [] : MultiJson.decode(output)
51
50
  if status == "ok"
52
51
  value
53
52
  else
@@ -83,6 +82,7 @@ module ExecJS
83
82
  end
84
83
 
85
84
  def available?
85
+ require "multi_json"
86
86
  @binary ? true : false
87
87
  end
88
88
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: execjs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 1
10
- version: 0.2.1
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sam Stephenson
@@ -20,9 +20,24 @@ date: 2011-04-26 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
- name: mustang
23
+ name: multi_json
24
24
  prerelease: false
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ hash: 15
31
+ segments:
32
+ - 1
33
+ - 0
34
+ version: "1.0"
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: mustang
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
26
41
  none: false
27
42
  requirements:
28
43
  - - ">="
@@ -32,11 +47,11 @@ dependencies:
32
47
  - 0
33
48
  version: "0"
34
49
  type: :development
35
- version_requirements: *id001
50
+ version_requirements: *id002
36
51
  - !ruby/object:Gem::Dependency
37
52
  name: therubyracer
38
53
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
54
+ requirement: &id003 !ruby/object:Gem::Requirement
40
55
  none: false
41
56
  requirements:
42
57
  - - ">="
@@ -46,11 +61,11 @@ dependencies:
46
61
  - 0
47
62
  version: "0"
48
63
  type: :development
49
- version_requirements: *id002
64
+ version_requirements: *id003
50
65
  - !ruby/object:Gem::Dependency
51
66
  name: therubyrhino
52
67
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
68
+ requirement: &id004 !ruby/object:Gem::Requirement
54
69
  none: false
55
70
  requirements:
56
71
  - - ">="
@@ -60,7 +75,7 @@ dependencies:
60
75
  - 0
61
76
  version: "0"
62
77
  type: :development
63
- version_requirements: *id003
78
+ version_requirements: *id004
64
79
  description: " ExecJS lets you run JavaScript code from Ruby.\n"
65
80
  email:
66
81
  - sstephenson@gmail.com