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 vendored 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 vendored 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 vendored inside the gem: support/shell/ holds the src-tauri app and the splash/ dir it serves. This is the shell the CLI uses unless the caller overrides it with --shell-dir.
18 19 20 |
# File 'lib/everywhere/paths.rb', line 18 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.
36 37 38 |
# File 'lib/everywhere/paths.rb', line 36 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.
44 45 46 |
# File 'lib/everywhere/paths.rb', line 44 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 vendored copy is missing (a corrupt/partial install).
24 25 26 |
# File 'lib/everywhere/paths.rb', line 24 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 monorepo dev pointed at build-runner.
30 31 32 33 |
# File 'lib/everywhere/paths.rb', line 30 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 |