Skip to content

Commit

Permalink
Convert boolean to :true & :false PR #152
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanstipl committed Jan 15, 2016
1 parent af4b3f2 commit 4b8336a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/puppet/type/ini_setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
def munge_boolean_md5(value)
case value
when true, :true, 'true', :yes, 'yes'
true
:true
when false, :false, 'false', :no, 'no'
false
:false
when :md5, 'md5'
:md5
else
Expand Down Expand Up @@ -72,7 +72,7 @@ def munge_boolean_md5(value)
desc 'The value of the setting to be defined.'

def should_to_s(newvalue)
if (@resource[:show_diff] == true && Puppet[:show_diff]) then
if (@resource[:show_diff] == :true && Puppet[:show_diff]) then
return newvalue
elsif (@resource[:show_diff] == :md5 && Puppet[:show_diff]) then
return '{md5}' + Digest::MD5.hexdigest(newvalue.to_s)
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/type/ini_subsetting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
def munge_boolean_md5(value)
case value
when true, :true, 'true', :yes, 'yes'
true
:true
when false, :false, 'false', :no, 'no'
false
:false
when :md5, 'md5'
:md5
else
Expand Down Expand Up @@ -91,7 +91,7 @@ def munge_boolean_md5(value)
desc 'The value of the subsetting to be defined.'

def should_to_s(newvalue)
if (@resource[:show_diff] == true && Puppet[:show_diff]) then
if (@resource[:show_diff] == :true && Puppet[:show_diff]) then
return newvalue
elsif (@resource[:show_diff] == :md5 && Puppet[:show_diff]) then
return '{md5}' + Digest::MD5.hexdigest(newvalue.to_s)
Expand Down

0 comments on commit 4b8336a

Please sign in to comment.