ruby_everywhere 0.1.1 → 0.1.2

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: 19938d7ab43425ebeb6a729c9dff31fa1c301aea0b72b08638483a1e2e1e5313
4
- data.tar.gz: b493f9396d3b2f7b84d2b9434ab232ef21294df373b8c432d2c1aac811c9ac98
3
+ metadata.gz: 9bbeb5f84c4ec19197b0943357aab3392040876afe678f504f717acb22201d18
4
+ data.tar.gz: c48f81139c0aac8763b0c4fd9d04ace837e9131676a151d8d05fe964219ef79e
5
5
  SHA512:
6
- metadata.gz: fd4d9e03d266ee568170e60b663034c519db76941e2f91057dcc88cbb2250f71dae01668049a0af35edbd7464d468903c0027d97664da150b67529d62f7974a7
7
- data.tar.gz: 6bb5a9afbe5d330f6a5bf7be303e728626b8df04476c9b5f3931ef0ed2d71ba9bf5507a1c54b99f0e11d7305c1acdbb2cb68f7bb43d7f46967dbf6746c5400e0
6
+ metadata.gz: 4d144af27b9eaaa9ea2c11c847b41956021ea92d94929d12764f80d1b06dbfa2b43d9fbc43b18e0697c782866a1f46b9a5c5229ed8287ce086aab4c86832d83a
7
+ data.tar.gz: ff6f45ab57847acd8897cf0548e3d6b076289f67524863067f1f581a48af5131b34c6da0a4ac82bcdde269c60aa9d809e93f15710395eeae49b61bc46d6fea67
@@ -138,17 +138,18 @@ module Everywhere
138
138
  end
139
139
 
140
140
  UI.step("building shell #{UI.dim("(cargo release)")}")
141
+ target_dir = Everywhere::Paths.cargo_target_dir
141
142
  begin
142
- Shellout.run!({}, "cargo", "build", "--release", chdir: shell_dir)
143
+ Shellout.run!({ "CARGO_TARGET_DIR" => target_dir }, "cargo", "build", "--release", chdir: shell_dir)
143
144
  ensure
144
145
  if icon_source && File.exist?(placeholder_backup)
145
146
  FileUtils.mv(placeholder_backup, shell_icon)
146
147
  FileUtils.touch(File.join(shell_dir, "build.rs"))
147
148
  end
148
149
  end
149
- shell_bin = Dir[File.join(shell_dir, "target/release/*")]
150
+ shell_bin = Dir[File.join(target_dir, "release/*")]
150
151
  .find { |f| File.file?(f) && File.executable?(f) && !f.end_with?(".d") }
151
- UI.die!("couldn't find release shell binary in #{shell_dir}/target/release") unless shell_bin
152
+ UI.die!("couldn't find release shell binary in #{target_dir}/release") unless shell_bin
152
153
 
153
154
  app_dir = File.join(dist_dir, "#{app_name}.app")
154
155
  macos = File.join(app_dir, "Contents", "MacOS")
@@ -33,7 +33,8 @@ module Everywhere
33
33
 
34
34
  dev_url = "http://127.0.0.1:#{port}#{config.entry_path}"
35
35
  UI.step("opening desktop shell → #{UI.cyan(dev_url)}")
36
- Shellout.run!({ "NATIVE_DEV_URL" => dev_url, "NATIVE_CONFIG" => config.to_shell_json },
36
+ Shellout.run!({ "NATIVE_DEV_URL" => dev_url, "NATIVE_CONFIG" => config.to_shell_json,
37
+ "CARGO_TARGET_DIR" => Everywhere::Paths.cargo_target_dir },
37
38
  "cargo", "run", chdir: shell_dir)
38
39
  ensure
39
40
  if server_pid
@@ -31,5 +31,18 @@ module Everywhere
31
31
  shell_dir or UI.die!("couldn't find the bundled shell at #{bundled_shell_dir}; " \
32
32
  "reinstall ruby_everywhere or pass --shell-dir")
33
33
  end
34
+
35
+ # Per-user cache dir. Keeps heavy build state out of the gem and the app.
36
+ def cache_dir
37
+ File.expand_path(ENV["RUBYEVERYWHERE_HOME"] || "~/.rubyeverywhere")
38
+ end
39
+
40
+ # Where cargo writes the shell's build output (CARGO_TARGET_DIR). Redirected
41
+ # here so cargo never dumps a multi-GB target/ into the installed gem, and so
42
+ # the shell compiles warm across projects — the shell source is identical for
43
+ # everyone, so one shared target dir is safe to reuse.
44
+ def cargo_target_dir
45
+ File.join(cache_dir, "shell-target")
46
+ end
34
47
  end
35
48
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Everywhere
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
 
6
6
  # Version of the vendored @rubyeverywhere/bridge JS this gem ships. Tracks
7
7
  # bridge/package.json — bump it whenever lib/everywhere/javascript/bridge.js is
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_everywhere
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Fomera