Skip to content

Commit

Permalink
(maint) Update Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcmaw committed Dec 19, 2023
1 parent 4e46ce2 commit dc2df47
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/pdk/cli/util/option_normalizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def self.report_formats(formats)
target = PDK::Report.default_target
end

{ method: "write_#{format}".to_sym, target: target }
{ method: :"write_#{format}", target: target }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/config/namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def include_in_parent?
# @api private
def read_only!
@read_only = true
@mounts.each { |_, child| child.read_only! }
@mounts.each_value(&:read_only!)
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def write_text(target = self.class.default_target)
coverage_report = nil
report = []

events.each do |_tool, tool_events|
events.each_value do |tool_events|
tool_events.each do |event|
if event.rspec_puppet_coverage?
coverage_report = event.to_text
Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/report/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Event
# @raise [ArgumentError] (see #sanitise_data)
def initialize(data)
sanitise_data(data).each do |key, value|
instance_variable_set("@#{key}", value)
instance_variable_set(:"@#{key}", value)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def package_install?
def development_mode?
require 'pdk/util/version'

(!PDK::Util::Version.git_ref.nil? || PDK::VERSION.end_with?('.pre'))
!PDK::Util::Version.git_ref.nil? || PDK::VERSION.end_with?('.pre')
end
module_function :development_mode?

Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/util/puppet_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def find_in_rubygems(requirement)
def find_in_package_cache(requirement)
require 'pdk/util/ruby_version'

PDK::Util::RubyVersion.versions.each do |ruby_version, _|
PDK::Util::RubyVersion.versions.each_key do |ruby_version|
PDK::Util::RubyVersion.use(ruby_version)
version = PDK::Util::RubyVersion.available_puppet_versions.find { |r| requirement.satisfied_by?(r) }
return { gem_version: version, ruby_version: ruby_version } unless version.nil?
Expand Down
2 changes: 1 addition & 1 deletion spec/support/file_based_namespaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

it 'does not add or lose any data when round tripping the serialization' do
# Force the file to be loaded
expected_settings.each { |k, _| subject[k] }
expected_settings.each_key { |k| subject[k] }
# Force a setting to be saved by setting a single known value
expect(PDK::Util::Filesystem).to receive(:write_file).with(subject.file, content)
key = expected_settings.keys[0]
Expand Down
2 changes: 1 addition & 1 deletion spec/support/validators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def invoke(report)
RSpec::Matchers.define :have_number_of_events do |state, expected_count|
def get_event_count(report, state)
count = 0
report.events.each do |_source, events|
report.events.each_value do |events|
count += events.count { |event| event.state == state }
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/pdk/report/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@

methods.each do |method|
if method == state_method
it { is_expected.to send("be_#{method}") }
it { is_expected.to send(:"be_#{method}") }
else
it { is_expected.not_to send("be_#{method}") }
it { is_expected.not_to send(:"be_#{method}") }
end
end
end
Expand Down

0 comments on commit dc2df47

Please sign in to comment.