Skip to content

Commit

Permalink
Keep compatibility with Ruby 1.8.7 (necessary while claiming compatib…
Browse files Browse the repository at this point in the history
…ility with 2.7/3.8)
  • Loading branch information
jairojunior committed Feb 19, 2017
1 parent 88c49f9 commit 96ffe1e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# History

## 1.2.7

- Keep compatibility with Ruby 1.8.7 (necessary while claiming compatibility with 2.7/3.8)

## 1.2.6

- Major wildfly_resource refactor
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/wildfly_deployment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
desc 'Operation timeout. Defaults to 120'
defaultto 300

munge(&:to_i)
munge { |value| value.to_i }
end

newparam(:operation_headers) do
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/wildfly_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
desc 'Management port. Defaults to 9990'
defaultto 9990

munge(&:to_i)
munge { |value| value.to_i }

isnamevar
end
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/type/wildfly_restart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
desc 'Number of times it will check if server is running after a restart'
defaultto 3

munge(&:to_i)
munge { |value| value.to_i }
end

newparam(:wait) do
desc 'Amount of time (in seconds) that it will wait before next attempt'
defaultto 10

munge(&:to_i)
munge { |value| value.to_i }
end

newparam(:reload) do
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet_x/wildfly/hash.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class Hash
def deep_stringify_values
deep_transform_values(&:to_s)
deep_transform_values { |value| value.to_s }
end

def deep_obfuscate_sensitive_values
_deep_transform_values_in_object(self, true, &:to_s)
_deep_transform_values_in_object(self, true) { |value| value.to_s }
end

def deep_transform_values(&block)
Expand All @@ -15,7 +15,7 @@ def _deep_transform_values_in_object(object, obfuscate, &block)
case object
when Hash
object.inject({}) do |result, (key, value)|
actual_block = obfuscate && key.include?('password') ? proc { |_| '******' } : block
actual_block = obfuscate && key.to_s.include?('password') ? proc { |_| '******' } : block
result[key] = _deep_transform_values_in_object(value, obfuscate, &actual_block)
result
end
Expand Down

0 comments on commit 96ffe1e

Please sign in to comment.