Module: Everywhere::Paths
- Defined in:
- lib/everywhere/paths.rb
Overview
Filesystem locations the CLI resolves relative to the gem itself, so
every dev/build/release work in any project the gem is installed into.
Class Method Summary collapse
-
.bundled_shell_dir ⇒ Object
The generic Tauri shell bundled inside the gem: support/shell/ holds the src-tauri app and the splash/ dir it serves.
-
.cache_dir ⇒ Object
Per-user cache dir.
-
.cargo_target_dir ⇒ Object
Where cargo writes the shell's build output (CARGO_TARGET_DIR).
-
.gem_root ⇒ Object
The gem's own root — the dir holding lib/, exe/, support/.
-
.shell_dir ⇒ Object
Absolute path to the shell's src-tauri directory, or nil if the bundled copy is missing (a corrupt/partial install).
-
.shell_dir! ⇒ Object
Like #shell_dir but aborts with a helpful message when the shell is missing.
Class Method Details
.bundled_shell_dir ⇒ Object
The generic Tauri shell bundled inside the gem: support/shell/ holds the
src-tauri app and the splash/ dir it serves. This is the CANONICAL copy of
the shell — external consumers (e.g. the build-runner repo) resolve it via
every shell-dir. The CLI uses it unless the caller passes --shell-dir.
19 20 21 |
# File 'lib/everywhere/paths.rb', line 19 def bundled_shell_dir File.join(gem_root, "support", "shell", "src-tauri") end |
.cache_dir ⇒ Object
Per-user cache dir. Keeps heavy build state out of the gem and the app.
37 38 39 |
# File 'lib/everywhere/paths.rb', line 37 def cache_dir File.(ENV["RUBYEVERYWHERE_HOME"] || "~/.rubyeverywhere") end |
.cargo_target_dir ⇒ Object
Where cargo writes the shell's build output (CARGO_TARGET_DIR). Redirected here so cargo never dumps a multi-GB target/ into the installed gem, and so the shell compiles warm across projects — the shell source is identical for everyone, so one shared target dir is safe to reuse.
45 46 47 |
# File 'lib/everywhere/paths.rb', line 45 def cargo_target_dir File.join(cache_dir, "shell-target") end |
.gem_root ⇒ Object
The gem's own root — the dir holding lib/, exe/, support/. Correct whether the code runs from a git checkout or an installed gem.
11 12 13 |
# File 'lib/everywhere/paths.rb', line 11 def gem_root File.("../..", __dir__) end |
.shell_dir ⇒ Object
Absolute path to the shell's src-tauri directory, or nil if the bundled copy is missing (a corrupt/partial install).
25 26 27 |
# File 'lib/everywhere/paths.rb', line 25 def shell_dir bundled_shell_dir if File.exist?(File.join(bundled_shell_dir, "tauri.conf.json")) end |
.shell_dir! ⇒ Object
Like #shell_dir but aborts with a helpful message when the shell is missing. The --shell-dir hint covers dev on a modified shell checkout.
31 32 33 34 |
# File 'lib/everywhere/paths.rb', line 31 def shell_dir! shell_dir or UI.die!("couldn't find the bundled shell at #{bundled_shell_dir}; " \ "reinstall ruby_everywhere or pass --shell-dir") end |