File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1903,10 +1903,13 @@ def candidate(word)
19031903 # directory ~/.options, then the basename with '.options' suffix
19041904 # under XDG and Haiku standard places.
19051905 #
1906- def load ( filename = nil )
1906+ # The optional +into+ keyword argument works exactly like that accepted in
1907+ # method #parse.
1908+ #
1909+ def load ( filename = nil , into : nil )
19071910 unless filename
19081911 basename = File . basename ( $0, '.*' )
1909- return true if load ( File . expand_path ( basename , '~/.options' ) ) rescue nil
1912+ return true if load ( File . expand_path ( basename , '~/.options' ) , into : into ) rescue nil
19101913 basename << ".options"
19111914 return [
19121915 # XDG
@@ -1918,11 +1921,11 @@ def load(filename = nil)
19181921 '~/config/settings' ,
19191922 ] . any? { |dir |
19201923 next if !dir or dir . empty?
1921- load ( File . expand_path ( basename , dir ) ) rescue nil
1924+ load ( File . expand_path ( basename , dir ) , into : into ) rescue nil
19221925 }
19231926 end
19241927 begin
1925- parse ( *IO . readlines ( filename ) . each { |s | s . chomp! } )
1928+ parse ( *IO . readlines ( filename ) . each { |s | s . chomp! } , into : into )
19261929 true
19271930 rescue Errno ::ENOENT , Errno ::ENOTDIR
19281931 false
You can’t perform that action at this time.
0 commit comments