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 +4 -4
- data/lib/everywhere/commands/build.rb +4 -3
- data/lib/everywhere/commands/dev.rb +2 -1
- data/lib/everywhere/paths.rb +13 -0
- data/lib/everywhere/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9bbeb5f84c4ec19197b0943357aab3392040876afe678f504f717acb22201d18
|
|
4
|
+
data.tar.gz: c48f81139c0aac8763b0c4fd9d04ace837e9131676a151d8d05fe964219ef79e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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(
|
|
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 #{
|
|
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
|
data/lib/everywhere/paths.rb
CHANGED
|
@@ -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
|
data/lib/everywhere/version.rb
CHANGED