execjs 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -134,12 +134,33 @@ module ExecJS
134
134
  @runner_source ||= IO.read(@runner_path)
135
135
  end
136
136
 
137
- def exec_runtime(filename)
138
- output = sh("#{shell_escape(*(binary.split(' ') << filename))} 2>&1")
139
- if $?.success?
140
- output
141
- else
142
- raise RuntimeError, output
137
+ if ExecJS.windows?
138
+ def exec_runtime(filename)
139
+ path = Dir::Tmpname.create(['execjs', 'json']) {}
140
+ begin
141
+ `#{shell_escape(*(binary.split(' ') << filename))} 2>&1 > #{path}`
142
+ options = {}
143
+ options[:external_encoding] = @encoding if @encoding
144
+ options[:internal_encoding] = ::Encoding.default_internal || 'UTF-8'
145
+ output = File.open(path, 'rb', options) { |f| f.read }
146
+ ensure
147
+ File.unlink(path) if path
148
+ end
149
+
150
+ if $?.success?
151
+ output
152
+ else
153
+ raise RuntimeError, output
154
+ end
155
+ end
156
+ else
157
+ def exec_runtime(filename)
158
+ output = sh("#{shell_escape(*(binary.split(' ') << filename))} 2>&1")
159
+ if $?.success?
160
+ output
161
+ else
162
+ raise RuntimeError, output
163
+ end
143
164
  end
144
165
  end
145
166
 
@@ -1,3 +1,3 @@
1
1
  module ExecJS
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
metadata CHANGED
@@ -1,63 +1,57 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: execjs
3
- version: !ruby/object:Gem::Version
4
- hash: 7
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.1
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 4
9
- - 0
10
- version: 1.4.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Sam Stephenson
14
9
  - Josh Peek
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2012-05-20 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
13
+ date: 2014-10-14 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: multi_json
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
25
18
  none: false
26
- requirements:
19
+ requirements:
27
20
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 15
30
- segments:
31
- - 1
32
- - 0
33
- version: "1.0"
21
+ - !ruby/object:Gem::Version
22
+ version: '1.0'
34
23
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: rake
38
24
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: !ruby/object:Gem::Requirement
40
26
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: '1.0'
31
+ - !ruby/object:Gem::Dependency
32
+ name: rake
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
48
39
  type: :development
49
- version_requirements: *id002
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
50
47
  description: ExecJS lets you run JavaScript code from Ruby.
51
- email:
48
+ email:
52
49
  - sstephenson@gmail.com
53
50
  - josh@joshpeek.com
54
51
  executables: []
55
-
56
52
  extensions: []
57
-
58
53
  extra_rdoc_files: []
59
-
60
- files:
54
+ files:
61
55
  - README.md
62
56
  - LICENSE
63
57
  - lib/execjs/disabled_runtime.rb
@@ -80,36 +74,26 @@ files:
80
74
  - lib/execjs.rb
81
75
  homepage: https://github.com/sstephenson/execjs
82
76
  licenses: []
83
-
84
77
  post_install_message:
85
78
  rdoc_options: []
86
-
87
- require_paths:
79
+ require_paths:
88
80
  - lib
89
- required_ruby_version: !ruby/object:Gem::Requirement
81
+ required_ruby_version: !ruby/object:Gem::Requirement
90
82
  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
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
88
  none: false
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
- version: "0"
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
107
93
  requirements: []
108
-
109
94
  rubyforge_project:
110
- rubygems_version: 1.8.15
95
+ rubygems_version: 1.8.23
111
96
  signing_key:
112
97
  specification_version: 3
113
98
  summary: Run JavaScript code from Ruby
114
99
  test_files: []
115
-