Package not found. Please check the package name and try again.

execjs 2.9.1 → 2.10.1

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
  SHA256:
3
- metadata.gz: 2cff0ab13dcd1bc38d12b1ca38d99773ba123ad75573c8b8f4789232677df308
4
- data.tar.gz: a84d80b533fa677491bdb26d28bfedd44443deb5ff772d9eeb7db7e9e0d0ab36
3
+ metadata.gz: ca8fbffb11f9291f96946f05b1ea83be53c5882779a5b9d273bffd0cdfc81d2d
4
+ data.tar.gz: 9b3f12cf4b5662ea6c596323e932ff65c30350a982861b4818c2c36c989fa55d
5
5
  SHA512:
6
- metadata.gz: fbac63f192c113786e7df0bce663a0e40a241b54534e01f18047d356d7ccb1514e4aeb8a610a336f85271def9b5956404091caccf6f0c984a20a723f67a364ce
7
- data.tar.gz: 2f6dfe9ff9154500ea26a0c94a829eacb8b63ac84744791eff8f0b8643182f30118b1f1ed42f08486a4cc05c4e61c0cb8d800df53dcbccdbba5dadb786027b7a
6
+ metadata.gz: 6512ebadf69bce38417f1d6ab482c0724cad647a98a286d0ef76bdf07bad89bf76f5b1aa6b6db602f51b80304aeb4052a7bda15dd8b795206a38dbb32e590582
7
+ data.tar.gz: 41e1b872791ba893c8ab5786e3e105af4ff7b639c703e07f3e5b6f5822298e5a56c6b16c584586ec97b94ec9fad9b8dfa3f204c312807d12a0ecd020a3ea33dd
data/README.md CHANGED
@@ -31,8 +31,8 @@ A longer example, demonstrating how to invoke the CoffeeScript compiler:
31
31
 
32
32
  ``` ruby
33
33
  require "execjs"
34
- require "open-uri"
35
- source = open("http://coffeescript.org/extras/coffee-script.js").read
34
+ require "net/http"
35
+ source = Net::HTTP.get(URI("https://coffeescript.org/browser-compiler-legacy/coffeescript.js"))
36
36
 
37
37
  context = ExecJS.compile(source)
38
38
  context.call("CoffeeScript.compile", "square = (x) -> x * x", bare: true)
@@ -41,7 +41,7 @@ context.call("CoffeeScript.compile", "square = (x) -> x * x", bare: true)
41
41
 
42
42
  # Forcing a specific runtime
43
43
 
44
- If you'd like to use a specific runtime rather than the autodected one, you can assign `ExecJS.runtime`:
44
+ If you'd like to use a specific runtime rather than the autodetected one, you can assign `ExecJS.runtime`:
45
45
 
46
46
  ```ruby
47
47
  ExecJS.runtime = ExecJS::Runtimes::Node
@@ -65,7 +65,7 @@ $ gem install execjs
65
65
 
66
66
  **Why can't I use CommonJS `require()` inside ExecJS?**
67
67
 
68
- ExecJS provides a lowest common denominator interface to any JavaScript runtime.
68
+ ExecJS provides the lowest common denominator interface to any JavaScript runtime.
69
69
  Use ExecJS when it doesn't matter which JavaScript interpreter your code runs
70
70
  in. If you want to access the Node API, you should check another library like
71
71
  [commonjs.rb](https://github.com/cowboyd/commonjs.rb) designed to provide a
@@ -92,7 +92,7 @@ You shouldn't use `ExecJS.eval` on any inputs you wouldn't feel comfortable Ruby
92
92
 
93
93
  ## Contributing to ExecJS
94
94
 
95
- ExecJS is work of dozens of contributors. You're encouraged to submit pull requests, propose
95
+ ExecJS is the work of dozens of contributors. You're encouraged to submit pull requests, propose
96
96
  features and discuss issues.
97
97
 
98
98
  See [CONTRIBUTING](CONTRIBUTING.md).
@@ -136,8 +136,7 @@ module ExecJS
136
136
 
137
137
  unless Polyglot.languages.include? "js"
138
138
  warn "The language 'js' is not available, you likely need to `export TRUFFLERUBYOPT='--jvm --polyglot'`", uplevel: 0 if $VERBOSE
139
- warn "You also need to install the 'js' component with 'gu install js' on GraalVM 22.2+", uplevel: 0 if $VERBOSE
140
- warn "Note that you need TruffleRuby+GraalVM and not just the TruffleRuby standalone to use #{self.class}", uplevel: 0 if $VERBOSE
139
+ warn "You also need to install the 'js' component, see https://github.com/oracle/truffleruby/blob/master/doc/user/polyglot.md#installing-other-languages", uplevel: 0 if $VERBOSE
141
140
  return @available = false
142
141
  end
143
142
 
data/lib/execjs/module.rb CHANGED
@@ -8,8 +8,6 @@ module ExecJS
8
8
  class RuntimeUnavailable < RuntimeError; end
9
9
 
10
10
  class << self
11
- attr_reader :runtime
12
-
13
11
  def runtime=(runtime)
14
12
  raise RuntimeUnavailable, "#{runtime.name} is unavailable on this system" unless runtime.available?
15
13
  @runtime = runtime
@@ -1,17 +1,17 @@
1
- (function(program, execJS) { (function() {execJS(program) }).call({}); })(function(self, global, process, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source}
2
- }, function(program) {
1
+ (function(program, execJS) { (function() {execJS(program) }).call({}); })(async function(self, global, process, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source}
2
+ }, async function(program) {
3
3
  // Force BunJS to use sloppy mode see https://github.com/oven-sh/bun/issues/4527#issuecomment-1709520894
4
4
  exports.abc = function(){}
5
5
  var __process__ = process;
6
6
  var printFinal = function(string) {
7
- process.stdout.write('' + string, function() {
7
+ Bun.write(Bun.stdout, '' + string).then(function() {
8
8
  __process__.exit(0);
9
9
  });
10
10
  };
11
11
  try {
12
12
  delete this.process;
13
13
  delete this.console;
14
- result = program();
14
+ result = await program();
15
15
  process = __process__;
16
16
  if (typeof result == 'undefined' && result !== null) {
17
17
  printFinal('["ok"]');
@@ -1,3 +1,3 @@
1
1
  module ExecJS
2
- VERSION = "2.9.1"
2
+ VERSION = "2.10.1"
3
3
  end
data/lib/execjs.rb CHANGED
@@ -2,5 +2,7 @@ require "execjs/module"
2
2
  require "execjs/runtimes"
3
3
 
4
4
  module ExecJS
5
- self.runtime ||= Runtimes.autodetect
5
+ def self.runtime
6
+ @runtime ||= Runtimes.autodetect
7
+ end
6
8
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: execjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.1
4
+ version: 2.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson
8
8
  - Josh Peek
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2023-09-16 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
@@ -57,7 +56,6 @@ homepage: https://github.com/rails/execjs
57
56
  licenses:
58
57
  - MIT
59
58
  metadata: {}
60
- post_install_message:
61
59
  rdoc_options: []
62
60
  require_paths:
63
61
  - lib
@@ -72,8 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
70
  - !ruby/object:Gem::Version
73
71
  version: '0'
74
72
  requirements: []
75
- rubygems_version: 3.3.7
76
- signing_key:
73
+ rubygems_version: 4.0.6
77
74
  specification_version: 4
78
75
  summary: Run JavaScript code from Ruby
79
76
  test_files: []