execjs 2.5.2 → 2.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff1e76a0b04b0709b9e703a51640e373f99616d4
4
- data.tar.gz: dcb947f263e5f14d917913e490ae6f52e729f79c
3
+ metadata.gz: fcd62eb19c4e6aea5d447da64320e784832ee043
4
+ data.tar.gz: 687511bf72f60e9bc628beb0ff96b5ee0b69cee1
5
5
  SHA512:
6
- metadata.gz: d43cebabe981825b7f2c7f95719fb6d5c8dc411eec367c1b4c8f502e8a45bd644d97c77b53305f9df0ae354db02701caefdb4875795aef8815416277d34e5c87
7
- data.tar.gz: d1e5dc19e4cc71334274c094017843b5cd35ae126c6a0077b9e16adf157568311d5e0c2683ce4ed0b20c22bf5ea1426b8bd4fea6991061e2bff6ba5b9e0feacd
6
+ metadata.gz: ccc7750f0aa82f25d94eec847a4316c3a2ede069e26dd9dc312fceae32661ca44ca71e6f84f7db51e3bd0036d4d6b6d30700c115f56f2a92483506664617a929
7
+ data.tar.gz: 6a8890a15c433afc9f5de23b70852e0947b0bd694b8c195c6f2e573bcd57832b628f97a5e68ecf818a4972e438969e7fec1d0d826e3ae342d3805b0c9a7a750c
@@ -120,20 +120,25 @@ module ExecJS
120
120
  @binary ||= which(@command)
121
121
  end
122
122
 
123
- def locate_executable(cmd)
124
- if ExecJS.windows? && File.extname(cmd) == ""
125
- cmd << ".exe"
126
- end
127
-
128
- if File.executable? cmd
129
- cmd
130
- else
131
- path = ENV['PATH'].split(File::PATH_SEPARATOR).find { |p|
132
- full_path = File.join(p, cmd)
133
- File.executable?(full_path) && File.file?(full_path)
123
+ def locate_executable(command)
124
+ commands = Array(command)
125
+ if ExecJS.windows? && File.extname(command) == ""
126
+ ENV['PATHEXT'].split(File::PATH_SEPARATOR).each { |p|
127
+ commands << (command + p)
134
128
  }
135
- path && File.expand_path(cmd, path)
136
129
  end
130
+
131
+ commands.find { |cmd|
132
+ if File.executable? cmd
133
+ cmd
134
+ else
135
+ path = ENV['PATH'].split(File::PATH_SEPARATOR).find { |p|
136
+ full_path = File.join(p, cmd)
137
+ File.executable?(full_path) && File.file?(full_path)
138
+ }
139
+ path && File.expand_path(cmd, path)
140
+ end
141
+ }
137
142
  end
138
143
 
139
144
  protected
@@ -57,7 +57,7 @@ module ExecJS
57
57
  if name = ENV["EXECJS_RUNTIME"]
58
58
  raise RuntimeUnavailable, "#{name} runtime is not defined" unless const_defined?(name)
59
59
  runtime = const_get(name)
60
-
60
+
61
61
  raise RuntimeUnavailable, "#{runtime.name} runtime is not available on this system" unless runtime.available?
62
62
  runtime
63
63
  end
@@ -72,8 +72,8 @@ module ExecJS
72
72
  RubyRacer,
73
73
  RubyRhino,
74
74
  Duktape,
75
- JavaScriptCore,
76
75
  Node,
76
+ JavaScriptCore,
77
77
  SpiderMonkey,
78
78
  JScript
79
79
  ]
@@ -1,3 +1,3 @@
1
1
  module ExecJS
2
- VERSION = "2.5.2"
2
+ VERSION = "2.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: execjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-09 00:00:00.000000000 Z
12
+ date: 2015-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -71,8 +71,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  version: '0'
72
72
  requirements: []
73
73
  rubyforge_project:
74
- rubygems_version: 2.4.5
74
+ rubygems_version: 2.4.7
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: Run JavaScript code from Ruby
78
78
  test_files: []
79
+ has_rdoc: