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

Class Method Details

.bundled_shell_dirObject

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

.gem_rootObject

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.expand_path("../..", __dir__)
end

.shell_dirObject

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