Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Naming/MethodName:
Naming/MethodParameterName:
Enabled: false

Naming/PredicateName:
Naming/PredicatePrefix:
ForbiddenPrefixes: []

Naming/RescuedExceptionsVariableName:
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/feature/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module WindowsSymlink
require 'ffi'
extend FFI::Library

def self.is_implemented # rubocop:disable Naming/PredicateName
def self.is_implemented # rubocop:disable Naming/PredicatePrefix
ffi_lib :kernel32
attach_function :CreateSymbolicLinkW, [:lpwstr, :lpwstr, :dword], :boolean

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/functions/defined.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
required_repeated_param 'Variant[String, Type[CatalogEntry], Type[Type[CatalogEntry]]]', :vals
end

def is_defined(scope, *vals) # rubocop:disable Naming/PredicateName
def is_defined(scope, *vals) # rubocop:disable Naming/PredicatePrefix
vals.any? do |val|
case val
when String
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/parameter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ def defaultto(value = nil, &block)
end
end

# rubocop:disable Naming/PredicateName
# rubocop:disable Naming/PredicatePrefix
def sensitive(value = nil, &block)
if block
define_method(:is_sensitive, &block)
else
define_method(:is_sensitive) do value end
end
end
# rubocop:enable Naming/PredicateName
# rubocop:enable Naming/PredicatePrefix

# Produces a documentation string.
# If an enumeration of _valid values_ has been defined, it is appended to the documentation
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/property.rb
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def property_matches?(current, desired)
# are not already in suitable form.
# @param value [Object] the value to format as a string
# @return [String] a pretty printing string
def is_to_s(value) # rubocop:disable Naming/PredicateName
def is_to_s(value) # rubocop:disable Naming/PredicatePrefix
self.class.format_value_for_display(value)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/property/keyvalue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def should_to_s(should_value)
hash_to_key_value_s(should_value)
end

def is_to_s(current_value) # rubocop:disable Naming/PredicateName
def is_to_s(current_value) # rubocop:disable Naming/PredicatePrefix
hash_to_key_value_s(current_value)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/property/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Property
# For an ordered list see {Puppet::Property::OrderedList}.
#
class List < Property
def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName
def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix
currentvalue == :absent ? super(currentvalue) : currentvalue.join(delimiter)
end

Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def self.optional_commands(hash)
# @note the name ´has_command´ looks odd in an API context, but makes more sense when seen in the internal
# DSL context where a Provider is declaratively defined.
# @api public
# rubocop:disable Naming/PredicateName
# rubocop:disable Naming/PredicatePrefix
def self.has_command(name, path, &block)
name = name.intern
command = CommandDefiner.define(name, path, self, &block)
Expand All @@ -211,7 +211,7 @@ def self.has_command(name, path, &block)
return command.execute(*args)
end
end
# rubocop:enable Naming/PredicateName
# rubocop:enable Naming/PredicatePrefix

# Internal helper class when creating commands - undocumented.
# @api private
Expand All @@ -232,7 +232,7 @@ def initialize(name, path, confiner)
@custom_environment = {}
end

def is_optional # rubocop:disable Naming/PredicateName
def is_optional # rubocop:disable Naming/PredicatePrefix
@optional = true
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/file/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def insync?(current)
end

# We want to print names, not numbers
def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName
def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix
super(provider.gid2name(currentvalue) || currentvalue)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/file/mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def should_to_s(should_value)
"'#{should_value.rjust(4, '0')}'"
end

def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName
def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix
if currentvalue == :absent
# This can occur during audits---if a file is transitioning from
# present to absent the mode will have a value of `:absent`.
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/file/owner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def insync?(current)
end

# We want to print names, not numbers
def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName
def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix
super(provider.uid2name(currentvalue) || currentvalue)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def insync?(current)
super(current)
end

def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName
def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix
if provider.respond_to?(:members_to_s)
currentvalue = '' if currentvalue.nil?
currentvalue = currentvalue.is_a?(Array) ? currentvalue : currentvalue.split(',')
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def should_to_s(newvalue)
end
end

def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName
def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix
if provider.respond_to?(:package_settings_is_to_s)
provider.package_settings_is_to_s(should, currentvalue)
else
Expand Down
Loading