lib/rbbt/persist.rb in rbbt-util-5.38.0 vs lib/rbbt/persist.rb in rbbt-util-5.38.1
- old
+ new
@@ -113,11 +113,11 @@
TRUE_STRINGS = Set.new ["true", "True", "TRUE", "t", "T", "1", "yes", "Yes", "YES", "y", "Y", "ON", "on"] unless defined? TRUE_STRINGS
def self.load_file(path, type)
begin
case (type || :marshal).to_sym
when :path
- path
+ Path.setup(Open.read(path).strip)
when :nil
nil
when :boolean
TRUE_STRINGS.include? Open.read(path).chomp.strip
when :annotations
@@ -170,10 +170,10 @@
return
end
case (type || :marshal).to_sym
when :path
- nil
+ Open.write(path, content)
when :nil
nil
when :boolean
Misc.sensiblewrite(path, content ? "true" : "false", :lock => lockfile)
when :fwt