diff options
author | Bobosila Victor <vbobosila1@gmail.com> | 2021-09-24 13:26:47 +0300 |
---|---|---|
committer | Bobosila Victor <vbobosila1@gmail.com> | 2021-09-30 14:30:05 +0300 |
commit | 855f3bba8bb1c29ea1ec2dae471c90bec7786f01 (patch) | |
tree | 5ff1f5bbd08e7d556439df0f18756f10aeb34bf3 /lib/puppet | |
parent | ec516a229afbedb0eefe401a8eefecc27004f6ac (diff) | |
download | puppet-augeas_core-855f3bba8bb1c29ea1ec2dae471c90bec7786f01.tar.gz puppet-augeas_core-855f3bba8bb1c29ea1ec2dae471c90bec7786f01.tar.bz2 |
(MODULES-11197) Rubocop fixes
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/provider/augeas/augeas.rb | 16 | ||||
-rw-r--r-- | lib/puppet/type/augeas.rb | 3 |
2 files changed, 10 insertions, 9 deletions
diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb index 8ab6e7a..8a306db 100644 --- a/lib/puppet/provider/augeas/augeas.rb +++ b/lib/puppet/provider/augeas/augeas.rb @@ -95,17 +95,17 @@ Puppet::Type.type(:augeas).provide(:augeas) do if f == :path start = sc.pos nbracket = 0 - inSingleTick = false - inDoubleTick = false + in_single_tick = false + in_double_tick = false loop do sc.skip(%r{([^\]\[\s\\'"]|\\.)+}) ch = sc.getch nbracket += 1 if ch == '[' nbracket -= 1 if ch == ']' - inSingleTick = !inSingleTick if ch == "'" - inDoubleTick = !inDoubleTick if ch == '"' + in_single_tick = !in_single_tick if ch == "'" + in_double_tick = !in_double_tick if ch == '"' raise(_('unmatched [')) if nbracket < 0 - break if (nbracket == 0 && !inSingleTick && !inDoubleTick && (ch =~ %r{\s})) || sc.eos? + break if (nbracket == 0 && !in_single_tick && !in_double_tick && (ch =~ %r{\s})) || sc.eos? end len = sc.pos - start len -= 1 unless sc.eos? @@ -209,7 +209,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do @aug = nil end - def is_numeric?(s) + def numeric?(s) case s when Integer true @@ -236,8 +236,8 @@ Puppet::Type.type(:augeas).provide(:augeas) do # check the value in augeas result = @aug.get(path) || '' - if ['<', '<=', '>=', '>'].include?(comparator) && is_numeric?(result) && - is_numeric?(arg) + if ['<', '<=', '>=', '>'].include?(comparator) && numeric?(result) && + numeric?(arg) resultf = result.to_f argf = arg.to_f return_value = resultf.send(comparator, argf) diff --git a/lib/puppet/type/augeas.rb b/lib/puppet/type/augeas.rb index 37683a2..2303fdc 100644 --- a/lib/puppet/type/augeas.rb +++ b/lib/puppet/type/augeas.rb @@ -129,7 +129,8 @@ Puppet::Type.newtype(:augeas) do end newparam(:load_path) do - desc "Optional colon-separated list or array of directories; these directories are searched for schema definitions. The agent's `$libdir/augeas/lenses` path will always be added to support pluginsync." + desc "Optional colon-separated list or array of directories; these directories are searched for schema definitions. + The agent's `$libdir/augeas/lenses` path will always be added to support pluginsync." defaultto '' end |