1
0
Fork 0
mirror of https://github.com/rails/execjs synced 2023-03-27 23:21:20 -04:00

Merge branch 'master' into duktape

This commit is contained in:
Joshua Peek 2015-04-06 09:59:55 -07:00
commit cecfb3c76a
6 changed files with 16 additions and 5 deletions

View file

@ -5,7 +5,7 @@
Clone the repository from GitHub.
```
$ git clone https://github.com/sstephenson/execjs
$ git clone https://github.com/rails/execjs
```
Now just cd into the directory and run `bundle install` to install the

View file

@ -9,7 +9,7 @@ version "2.x.x" bump is in order.
### Make a release commit
To prepare the release commit, edit the
[lib/execjs/version.rb](https://github.com/sstephenson/execjs/blob/master/lib/execjs/version.rb)
[lib/execjs/version.rb](https://github.com/rails/execjs/blob/master/lib/execjs/version.rb)
`VERSION` value. Then make a single commit with the description as
"ExecJS 2.x.x". Finally, tag the commit with `v2.x.x`.

View file

@ -5,7 +5,7 @@ Gem::Specification.new do |s|
s.name = "execjs"
s.version = ExecJS::VERSION
s.homepage = "https://github.com/sstephenson/execjs"
s.homepage = "https://github.com/rails/execjs"
s.summary = "Run JavaScript code from Ruby"
s.description = "ExecJS lets you run JavaScript code from Ruby."

View file

@ -28,8 +28,15 @@ module ExecJS
source = @runtime.compile_source(source)
tmpfile = write_to_tempfile(source)
if ExecJS.cygwin?
filepath = `cygpath -m #{tmpfile.path}`.rstrip
else
filepath = tmpfile.path
end
begin
extract_result(@runtime.exec_runtime(tmpfile.path), tmpfile.path)
extract_result(@runtime.exec_runtime(filepath), filepath)
ensure
File.unlink(tmpfile)
end

View file

@ -34,5 +34,9 @@ module ExecJS
def windows?
@windows ||= RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
end
def cygwin?
@cygwin ||= RbConfig::CONFIG["host_os"] =~ /cygwin/
end
end
end

View file

@ -46,7 +46,7 @@ module ExecJS
def self.autodetect
from_environment || best_available ||
raise(RuntimeUnavailable, "Could not find a JavaScript runtime. " +
"See https://github.com/sstephenson/execjs for a list of available runtimes.")
"See https://github.com/rails/execjs for a list of available runtimes.")
end
def self.best_available