fix issue where single characters settings were not being saved.
see https://github.com/boxen/puppet-git/issues/30
This commit is contained in:
parent
8aeddc8a8c
commit
681f5c0cb4
2 changed files with 3 additions and 1 deletions
|
@ -6,7 +6,7 @@ module Util
|
||||||
class IniFile
|
class IniFile
|
||||||
|
|
||||||
@@SECTION_REGEX = /^\s*\[([^\]]*)\]\s*$/
|
@@SECTION_REGEX = /^\s*\[([^\]]*)\]\s*$/
|
||||||
@@SETTING_REGEX = /^(\s*)([^\[#;][\w\d\.\\\/\-\s\[\]\']*[\w\d\.\\\/\-\]])([ \t]*=[ \t]*)([\S\s]*?)\s*$/
|
@@SETTING_REGEX = /^(\s*)([\w\d\.\\\/\-\s\[\]\']*[\w\d\.\\\/\-\]])([ \t]*=[ \t]*)([\S\s]*?)\s*$/
|
||||||
@@COMMENTED_SETTING_REGEX = /^(\s*)[#;]+(\s*)([^\[]*[\w\d\.\\\/\-]+[\w\d\.\\\/\-\[\]\']+)([ \t]*=[ \t]*)([\S\s]*?)\s*$/
|
@@COMMENTED_SETTING_REGEX = /^(\s*)[#;]+(\s*)([^\[]*[\w\d\.\\\/\-]+[\w\d\.\\\/\-\[\]\']+)([ \t]*=[ \t]*)([\S\s]*?)\s*$/
|
||||||
|
|
||||||
def initialize(path, key_val_separator = ' = ')
|
def initialize(path, key_val_separator = ' = ')
|
||||||
|
|
|
@ -30,6 +30,7 @@ baz=bazvalue
|
||||||
; yet another comment
|
; yet another comment
|
||||||
zot = multi word value
|
zot = multi word value
|
||||||
xyzzy['thing1']['thing2']=xyzzyvalue
|
xyzzy['thing1']['thing2']=xyzzyvalue
|
||||||
|
l=git log
|
||||||
EOS
|
EOS
|
||||||
template.split("\n")
|
template.split("\n")
|
||||||
}
|
}
|
||||||
|
@ -52,6 +53,7 @@ baz=bazvalue
|
||||||
subject.get_value("section2", "baz").should == "bazvalue"
|
subject.get_value("section2", "baz").should == "bazvalue"
|
||||||
subject.get_value("section2", "zot").should == "multi word value"
|
subject.get_value("section2", "zot").should == "multi word value"
|
||||||
subject.get_value("section2", "xyzzy['thing1']['thing2']").should == "xyzzyvalue"
|
subject.get_value("section2", "xyzzy['thing1']['thing2']").should == "xyzzyvalue"
|
||||||
|
subject.get_value("section2", "l").should == "git log"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue