File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,12 +27,7 @@ def prepare_environment
2727 # we use it to store the Secryst data we need. Otherwise, we try the following
2828 # paths:
2929
30- possible_paths = [
31- "/var/lib/secryst" ,
32- "/usr/local/share/secryst" ,
33- "/usr/share/secryst" ,
34- File . join ( Dir . home , ".local/share/secryst" )
35- ]
30+ possible_paths = candidate_paths
3631
3732 # We find the first writable path to become the primary one. The remaining
3833 # ones will be used read-only if they exist
@@ -95,6 +90,13 @@ def prepare_environment
9590 @preload_models . each { |i | locate ( i ) }
9691 end
9792
93+ def self . candidate_paths
94+ [
95+ File . join ( Dir . home , ".local/share/interscript-ml" ) ,
96+ File . join ( Dir . home , ".local/share/secryst" ) # legacy fallback
97+ ]
98+ end
99+
98100 def locate ( name )
99101 # Shortcut this if user gave a filename.
100102 return name if name =~ %r{[.\\ /]}
Original file line number Diff line number Diff line change 9393 expect ( described_class . name ) . to eq ( "Interscript::Stdlib::Functions::SecrystAdapter" )
9494 end
9595end
96+
97+ RSpec . describe Interscript ::ML ::Provisioning do
98+ describe "candidate paths" do
99+ it "prefers interscript-ml locations, keeping secryst paths as legacy fallbacks" do
100+ paths = described_class . candidate_paths
101+ expect ( paths . first ) . to eq ( File . join ( Dir . home , ".local/share/interscript-ml" ) )
102+ expect ( paths ) . to include ( File . join ( Dir . home , ".local/share/secryst" ) )
103+ expect ( paths . join ( " " ) ) . not_to match ( %r{/var/lib/secryst} )
104+ end
105+ end
106+ end
You can’t perform that action at this time.
0 commit comments