Skip to content

Commit c7100ef

Browse files
authored
Merge pull request #858 from tphoney/MODULES-6139
MODULES-6139 Revert to old ruby 1.X style of hash
2 parents e5dff2f + 5956bff commit c7100ef

File tree

281 files changed

+616
-614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+616
-614
lines changed

.rubocop.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ RSpec/BeforeAfterAll:
2525
RSpec/HookArgument:
2626
Description: Prefer explicit :each argument, matching existing module's style
2727
EnforcedStyle: each
28+
Style/HashSyntax:
29+
EnforcedStyle: hash_rockets
2830
Style/BlockDelimiters:
2931
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
3032
be consistent then.
@@ -97,4 +99,4 @@ Style/IfUnlessModifier:
9799
Style/SymbolProc:
98100
Enabled: false
99101
RSpec/NamedSubject:
100-
Enabled: false
102+
Enabled: false

lib/facter/facter_dot_d.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def cache_save!
119119
def cache_store(file, data)
120120
load_cache
121121

122-
@cache[file] = { data: data, stored: Time.now.to_i }
122+
@cache[file] = { :data => data, :stored => Time.now.to_i }
123123
rescue # rubocop:disable Lint/HandleExceptions - Is meant to be suppressed
124124
end
125125

lib/facter/package_provider.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
Facter.add(:package_provider) do
1414
setcode do
1515
if defined? Gem && Gem::Version.new(Facter.value(:puppetversion).split(' ')[0]) >= Gem::Version.new('3.6')
16-
Puppet::Type.type(:package).newpackage(name: 'dummy', allow_virtual: 'true')[:provider].to_s
16+
Puppet::Type.type(:package).newpackage(:name => 'dummy', :allow_virtual => 'true')[:provider].to_s
1717
else
18-
Puppet::Type.type(:package).newpackage(name: 'dummy')[:provider].to_s
18+
Puppet::Type.type(:package).newpackage(:name => 'dummy')[:provider].to_s
1919
end
2020
end
2121
end

lib/facter/pe_version.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
end
3232

3333
Facter.add('pe_major_version') do
34-
confine is_pe: true
34+
confine :is_pe => true
3535
setcode do
3636
pe_version = Facter.value(:pe_version)
3737
if pe_version
@@ -41,7 +41,7 @@
4141
end
4242

4343
Facter.add('pe_minor_version') do
44-
confine is_pe: true
44+
confine :is_pe => true
4545
setcode do
4646
pe_version = Facter.value(:pe_version)
4747
if pe_version
@@ -51,7 +51,7 @@
5151
end
5252

5353
Facter.add('pe_patch_version') do
54-
confine is_pe: true
54+
confine :is_pe => true
5555
setcode do
5656
pe_version = Facter.value(:pe_version)
5757
if pe_version

lib/facter/root_home.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def returnt_root_home
1818
end
1919

2020
Facter.add(:root_home) do
21-
confine kernel: :darwin
21+
confine :kernel => :darwin
2222
setcode do
2323
str = Facter::Util::Resolution.exec('dscacheutil -q user -a name root')
2424
hash = {}
@@ -31,7 +31,7 @@ def returnt_root_home
3131
end
3232

3333
Facter.add(:root_home) do
34-
confine kernel: :aix
34+
confine :kernel => :aix
3535
root_home = nil
3636
setcode do
3737
str = Facter::Util::Resolution.exec('lsuser -c -a home root')

lib/facter/service_provider.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
Facter.add(:service_provider) do
1414
setcode do
15-
Puppet::Type.type(:service).newservice(name: 'dummy')[:provider].to_s
15+
Puppet::Type.type(:service).newservice(:name => 'dummy')[:provider].to_s
1616
end
1717
end

lib/puppet/parser/functions/abs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# abs.rb
33
#
44
module Puppet::Parser::Functions
5-
newfunction(:abs, type: :rvalue, doc: <<-EOS
5+
newfunction(:abs, :type => :rvalue, :doc => <<-EOS
66
Returns the absolute value of a number, for example -34.56 becomes
77
34.56. Takes a single integer and float value as an argument.
88
EOS

lib/puppet/parser/functions/any2array.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# any2array.rb
33
#
44
module Puppet::Parser::Functions
5-
newfunction(:any2array, type: :rvalue, doc: <<-EOS
5+
newfunction(:any2array, :type => :rvalue, :doc => <<-EOS
66
This converts any object to an array containing that object. Empty argument
77
lists are converted to an empty array. Arrays are left untouched. Hashes are
88
converted to arrays of alternating keys and values.

lib/puppet/parser/functions/any2bool.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# any2bool.rb
33
#
44
module Puppet::Parser::Functions
5-
newfunction(:any2bool, type: :rvalue, doc: <<-EOS
5+
newfunction(:any2bool, :type => :rvalue, :doc => <<-EOS
66
This converts 'anything' to a boolean. In practise it does the following:
77
88
* Strings such as Y,y,1,T,t,TRUE,yes,'true' will return true

lib/puppet/parser/functions/assert_private.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# assert_private.rb
33
#
44
module Puppet::Parser::Functions
5-
newfunction(:assert_private, doc: <<-'EOS'
5+
newfunction(:assert_private, :doc => <<-'EOS'
66
Sets the current class or definition as private.
77
Calling the class or definition from outside the current module will fail.
88
EOS

0 commit comments

Comments
 (0)