execjs 0.2.0 → 0.2.1

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 +7 -3
  2. metadata +4 -4
@@ -112,15 +112,19 @@ module ExecJS
112
112
  end
113
113
 
114
114
  def which(command)
115
- Array(command).find do |name|
115
+ Array(command).each do |name|
116
116
  name = name.split(/\s+/).first
117
117
  result = if ExecJS.windows?
118
118
  `#{ExecJS.root}/support/which.bat #{name}`
119
119
  else
120
- `which #{name} 2>&1`
120
+ `which #{name} 2>/dev/null`
121
+ end
122
+
123
+ if path = result.strip.split("\n").first
124
+ return path
121
125
  end
122
- result.strip.split("\n").first
123
126
  end
127
+ nil
124
128
  end
125
129
 
126
130
  if "".respond_to?(:force_encoding)
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
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-04-12 00:00:00 -05:00
19
+ date: 2011-04-26 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency