isorun 0.1.3.pre-arm64-darwin → 0.1.5.pre-arm64-darwin

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: 1bd1ddc811fdc407578a3a53a21a2d05ae33a53b6302c86cad63123637f6f26f
4
- data.tar.gz: 97195d73eb26ca935a633bde9bf487b018bedad77dfafe29ce56046b785ed298
3
+ metadata.gz: 784cdfe7f6a96087e5bff4d2634df6d240e950fb8f907213f214ed774a1c37df
4
+ data.tar.gz: 6d2a73b9d22b7b4b56a93437494350e18dace034b9a552b8ae24a2f1584a2433
5
5
  SHA512:
6
- metadata.gz: 74a69d85a65c99e965e64050d571428f6014d5acd26d4980934d475aa9a15feb14ea2d0b4bceef7cdf2bc637d54a191f8336090e6c1b860ec989e6630eb33e0a
7
- data.tar.gz: 01ece88b925c636ba233745a76ec411f7d640fb281a7e90792bb259248c57536209271235bdbab247abb631ab7e097c78e2fc3124dfaafb8a93192293e261ce2
6
+ metadata.gz: 5fae6b98a01469fb078652090f320fc8d58a72ae0b2f4ca08acc41f1aed37c64595a5e1199c1833e80e0e1c99cd6f1d5d8753ae639ffbb83055754403bcdbce7
7
+ data.tar.gz: 1cf60ca5af5dccdd72c0681c30b0a5a94eca108f4fff901437522ecb078b3bc5143fc698a322e55701e911f1793dd0b0eb3ffe16ed6347843b26453f31a62606
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "isorun"
3
- version = "0.1.3"
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();
Binary file
Binary file
Binary file
@@ -6,7 +6,7 @@ module Isorun
6
6
  if Rails.env.development?
7
7
  Rails.root.join("app", "assets", "builds", "#{bundle_id}-server.js").to_s
8
8
  else
9
- asset_path("#{bundle_id}-server")
9
+ Isorun::Resolver.module_path("#{bundle_id}-server")
10
10
  end
11
11
  }
12
12
 
@@ -14,15 +14,13 @@ module Isorun
14
14
  if Rails.env.development?
15
15
  Rails.root.join("app", "assets", "builds", "#{bundle_id}.js").to_s
16
16
  else
17
- asset_path(bundle_id)
17
+ Isorun::Resolver.module_path(bundle_id)
18
18
  end
19
19
  }
20
20
 
21
- private
22
-
23
- def asset_path(asset)
24
- asset_path = Rails.application.assets_manifest.assets["#{asset}.js"]
25
- "#{Rails.application.assets_manifest.directory}/#{asset_path}"
21
+ def self.module_path(asset)
22
+ file = Rails.application.assets_manifest.assets["#{asset}.js"]
23
+ "#{Rails.application.assets_manifest.directory}/#{file}"
26
24
  end
27
25
  end
28
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Isorun
4
- VERSION = "0.1.3.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.3.pre
4
+ version: 0.1.5.pre
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Hannes Moser