isorun 0.1.4.pre → 0.1.5.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7064704882391bec9ca71e5065bcd1716c46bdf0cf59c8ecd3a64eff452b179f
4
- data.tar.gz: ce202b31bdc4ce1d6ee0cdebbe60e7620ed81e989e911860a76df3c3a897f395
3
+ metadata.gz: e525689a88829175e3854572ee1451e36531fcff32b9fc9f33bebdda4669b613
4
+ data.tar.gz: 72513156486eff7d6f42dc7b90b8195594603ce97aa9781d0c2a90ede82ed631
5
5
  SHA512:
6
- metadata.gz: 45195d3831b6c356a290a2fe83b69bfa8f0292e0a43ef5df20f3c70ac37b60cbd0c9e1caeb384898d074f27d3257ca1771708ae0858edf3d12530e8e5e7e9edb
7
- data.tar.gz: 552f4313bdd92d4ae8613f0baa54a264daef58c6ab431823b309e501b490f78c0c452599ed39dd4e4cbedf1b1cc41324abf32c0645f128d72163691ea624e5bf
6
+ metadata.gz: aba5188637695fd7f733103177eebb40700dd6f3d679c92027b33cf9741c77a41af62e873f48d563db078069b437aa6b02028443a80a11372b5d2d832ab309cf
7
+ data.tar.gz: 999c5c6eb516bd0046824de921e52eed6d00b8073ce6eed0c7b0098b21dc693a90c2a5ec1fbf0deac1913cfadbb2aedf374d147936f91357eeeb5e21cbade799
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "isorun"
3
- version = "0.1.4"
3
+ version = "0.1.5"
4
4
  edition = "2021"
5
5
  authors = ["Hannes Moser <box@hannesmoser.at>"]
6
6
  homepage = "https://github.com/eliias/isorun"
@@ -13,6 +13,7 @@ use magnus::{Error, Value};
13
13
  use std::borrow::BorrowMut;
14
14
  use std::cell::RefCell;
15
15
  use std::collections::{HashMap, HashSet};
16
+ use std::env;
16
17
  use std::path::Path;
17
18
  use std::rc::Rc;
18
19
  use std::string::ToString;
@@ -203,7 +204,18 @@ impl Default for Worker {
203
204
 
204
205
  // todo: we don't use the main module at all, but it could be used as an
205
206
  // entry point for "eval" JavaScript.
206
- let js_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("src/call.js");
207
+ let default_path = Path::new(env!("CARGO_MANIFEST_DIR"))
208
+ .join("../..")
209
+ .canonicalize()
210
+ .unwrap()
211
+ .into_os_string()
212
+ .into_string()
213
+ .unwrap();
214
+ let isorun_native_gem_path =
215
+ env::var("ISORUN_NATIVE_GEM_PATH").unwrap_or(default_path.clone());
216
+ let js_path = Path::new(isorun_native_gem_path.as_str())
217
+ .join("ext/isorun/src/call.js");
218
+
207
219
  let main_module =
208
220
  deno_core::resolve_path(&js_path.to_string_lossy()).unwrap();
209
221
  let permissions = Permissions::allow_all();
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Isorun
4
- VERSION = "0.1.4.pre"
4
+ VERSION = "0.1.5.pre"
5
5
  end
data/lib/isorun.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # set environment variable to isorun gem path, we use this to request the main
4
+ # module in the native extension
5
+ ENV["ISORUN_NATIVE_GEM_PATH"] = File.expand_path("..", __dir__)
6
+
3
7
  # load native extension
4
8
  begin
5
9
  ruby_version = /(\d+\.\d+)/.match(::RUBY_VERSION)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isorun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.pre
4
+ version: 0.1.5.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hannes Moser