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)
1903
1903
# directory ~/.options, then the basename with '.options' suffix
1904
1904
# under XDG and Haiku standard places.
1905
1905
#
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 )
1907
1910
unless filename
1908
1911
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
1910
1913
basename << ".options"
1911
1914
return [
1912
1915
# XDG
@@ -1918,11 +1921,11 @@ def load(filename = nil)
1918
1921
'~/config/settings' ,
1919
1922
] . any? { |dir |
1920
1923
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
1922
1925
}
1923
1926
end
1924
1927
begin
1925
- parse ( *IO . readlines ( filename ) . each { |s | s . chomp! } )
1928
+ parse ( *IO . readlines ( filename ) . each { |s | s . chomp! } , into : into )
1926
1929
true
1927
1930
rescue Errno ::ENOENT , Errno ::ENOTDIR
1928
1931
false
You can’t perform that action at this time.
0 commit comments