execjs 1.2.11 → 1.2.12

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.
@@ -121,12 +121,11 @@ module ExecJS
121
121
  @binary ||= locate_binary
122
122
  end
123
123
 
124
- def which_windows(name)
125
- result = `#{shell_escape("#{ExecJS.root}/support/which.bat", name)}`
126
- result.strip.split("\n").first
127
- end
124
+ def locate_executable(cmd)
125
+ if ExecJS.windows? && File.extname(cmd) == ""
126
+ cmd << ".exe"
127
+ end
128
128
 
129
- def which_unix(cmd)
130
129
  if File.executable? cmd
131
130
  cmd
132
131
  else
@@ -165,7 +164,7 @@ module ExecJS
165
164
  def which(command)
166
165
  Array(command).find do |name|
167
166
  name, args = name.split(/\s+/, 2)
168
- path = ExecJS.windows? ? which_windows(name) : which_unix(name)
167
+ path = locate_executable(name)
169
168
 
170
169
  next unless path
171
170
 
@@ -1,3 +1,3 @@
1
1
  module ExecJS
2
- VERSION = "1.2.11"
2
+ VERSION = "1.2.12"
3
3
  end
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: 9
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 11
10
- version: 1.2.11
9
+ - 12
10
+ version: 1.2.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sam Stephenson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-12-05 00:00:00 -06:00
19
+ date: 2011-12-08 00:00:00 -06:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -129,7 +129,6 @@ files:
129
129
  - lib/execjs/support/json2.js
130
130
  - lib/execjs/support/node_runner.js
131
131
  - lib/execjs/support/spidermonkey_runner.js
132
- - lib/execjs/support/which.bat
133
132
  - lib/execjs/version.rb
134
133
  - lib/execjs.rb
135
134
  has_rdoc: true
@@ -1,2 +0,0 @@
1
- @rem Taken from http://blogs.msdn.com/b/oldnewthing/archive/2005/01/20/357225.aspx
2
- @for %%e in (%PATHEXT%) do @for %%i in (%1%%e) do @if NOT "%%~$PATH:i"=="" @echo %%~$PATH:i