execjs 1.4.0 → 2.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f4dc71e89b01c1335680209ad2e9cd1adc2564df
4
+ data.tar.gz: 8f0fa816bc85914127a1ccddf15595025311ad41
5
+ SHA512:
6
+ metadata.gz: c43fe65595fdb4867941286a8293f256bee306d302c5a0ee9a9263902054c9d42831aad75b2a2a2ec932cad55ae7180bd801c51de203d1605b831c05a29ddd2b
7
+ data.tar.gz: 4a878ca1119bcdab94a4d66989e50683fcb296bb1137e26659d1517b9ed36f97ab6655e03f0b5c0270907610f54260622e225fde5daedfd4595ffaa616ad4f8c
data/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
- Copyright (c) 2011 Sam Stephenson
2
- Copyright (c) 2011 Josh Peek
1
+ Copyright (c) 2013 Sam Stephenson
2
+ Copyright (c) 2013 Josh Peek
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
5
5
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -37,6 +37,6 @@ A longer example, demonstrating how to invoke the CoffeeScript compiler:
37
37
 
38
38
  # License
39
39
 
40
- Copyright (c) 2011 Sam Stephenson and Josh Peek.
40
+ Copyright (c) 2013 Sam Stephenson and Josh Peek.
41
41
 
42
42
  Released under the MIT license. See `LICENSE` for details.
@@ -16,7 +16,7 @@ module ExecJS
16
16
  source = encode(source)
17
17
 
18
18
  if /\S/ =~ source
19
- exec("return eval(#{JSON.encode("(#{source})")})")
19
+ exec("return eval(#{::JSON.dump("(#{source})")})")
20
20
  end
21
21
  end
22
22
 
@@ -30,7 +30,7 @@ module ExecJS
30
30
  end
31
31
 
32
32
  def call(identifier, *args)
33
- eval "#{identifier}.apply(this, #{JSON.encode(args)})"
33
+ eval "#{identifier}.apply(this, #{::JSON.dump(args)})"
34
34
  end
35
35
 
36
36
  protected
@@ -50,7 +50,7 @@ module ExecJS
50
50
  end
51
51
  output.sub!('#{encoded_source}') do
52
52
  encoded_source = encode_unicode_codepoints(source)
53
- JSON.encode("(function(){ #{encoded_source} })()")
53
+ ::JSON.dump("(function(){ #{encoded_source} })()")
54
54
  end
55
55
  output.sub!('#{json2_source}') do
56
56
  IO.read(ExecJS.root + "/support/json2.js")
@@ -59,7 +59,7 @@ module ExecJS
59
59
  end
60
60
 
61
61
  def extract_result(output)
62
- status, value = output.empty? ? [] : JSON.decode(output)
62
+ status, value = output.empty? ? [] : ::JSON.load(output)
63
63
  if status == "ok"
64
64
  value
65
65
  elsif value =~ /SyntaxError:/
@@ -100,7 +100,7 @@ module ExecJS
100
100
  end
101
101
 
102
102
  def available?
103
- require "execjs/json"
103
+ require 'json'
104
104
  binary ? true : false
105
105
  end
106
106
 
@@ -1,3 +1,3 @@
1
1
  module ExecJS
2
- VERSION = "1.4.0"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,70 +1,44 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: execjs
3
- version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease:
6
- segments:
7
- - 1
8
- - 4
9
- - 0
10
- version: 1.4.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Sam Stephenson
14
8
  - Josh Peek
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2012-05-20 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: multi_json
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 15
30
- segments:
31
- - 1
32
- - 0
33
- version: "1.0"
34
- type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
12
+ date: 2013-08-21 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
37
15
  name: rake
38
- prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
48
21
  type: :development
49
- version_requirements: *id002
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
50
28
  description: ExecJS lets you run JavaScript code from Ruby.
51
- email:
29
+ email:
52
30
  - sstephenson@gmail.com
53
31
  - josh@joshpeek.com
54
32
  executables: []
55
-
56
33
  extensions: []
57
-
58
34
  extra_rdoc_files: []
59
-
60
- files:
35
+ files:
61
36
  - README.md
62
37
  - LICENSE
63
38
  - lib/execjs/disabled_runtime.rb
64
39
  - lib/execjs/encoding.rb
65
40
  - lib/execjs/external_runtime.rb
66
41
  - lib/execjs/johnson_runtime.rb
67
- - lib/execjs/json.rb
68
42
  - lib/execjs/module.rb
69
43
  - lib/execjs/mustang_runtime.rb
70
44
  - lib/execjs/ruby_racer_runtime.rb
@@ -79,37 +53,27 @@ files:
79
53
  - lib/execjs/version.rb
80
54
  - lib/execjs.rb
81
55
  homepage: https://github.com/sstephenson/execjs
82
- licenses: []
83
-
56
+ licenses:
57
+ - MIT
58
+ metadata: {}
84
59
  post_install_message:
85
60
  rdoc_options: []
86
-
87
- require_paths:
61
+ require_paths:
88
62
  - lib
89
- required_ruby_version: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- hash: 3
95
- segments:
96
- - 0
97
- version: "0"
98
- required_rubygems_version: !ruby/object:Gem::Requirement
99
- none: false
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
- version: "0"
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
107
73
  requirements: []
108
-
109
74
  rubyforge_project:
110
- rubygems_version: 1.8.15
75
+ rubygems_version: 2.0.2
111
76
  signing_key:
112
- specification_version: 3
77
+ specification_version: 4
113
78
  summary: Run JavaScript code from Ruby
114
79
  test_files: []
115
-
data/lib/execjs/json.rb DELETED
@@ -1,23 +0,0 @@
1
- require "multi_json"
2
-
3
- module ExecJS
4
- module JSON
5
- if MultiJson.respond_to?(:dump)
6
- def self.decode(obj)
7
- MultiJson.load(obj)
8
- end
9
-
10
- def self.encode(obj)
11
- MultiJson.dump(obj)
12
- end
13
- else
14
- def self.decode(obj)
15
- MultiJson.decode(obj)
16
- end
17
-
18
- def self.encode(obj)
19
- MultiJson.encode(obj)
20
- end
21
- end
22
- end
23
- end