Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
enable rubocop "NewCops"
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Jan 28, 2022
1 parent 9e810da commit ee249e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require:
- rubocop-rspec

AllCops:
NewCops: enable
TargetRubyVersion: 2.5

Bundler/OrderedGems:
Expand Down
1 change: 1 addition & 0 deletions beaker-module_install_helper.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'beaker-puppet', '~> 1.0'

spec.required_ruby_version = '>= 2.5.0'
spec.metadata['rubygems_mfa_required'] = 'true'
end
6 changes: 3 additions & 3 deletions lib/beaker/module_install_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def install_module_dependencies(deps = nil)
def install_module_dependencies_on(hsts, deps = nil)
hsts = [hsts] if hsts.is_a?(Hash)
hsts = [hsts] unless hsts.respond_to?(:each)
deps = deps.nil? ? module_dependencies_from_metadata : deps
deps = module_dependencies_from_metadata if deps.nil?

fh = ENV['BEAKER_FORGE_HOST']

Expand Down Expand Up @@ -113,7 +113,7 @@ def module_version_from_requirement(mod_name, vr_str)
# returns an array of Gem::Dependency objects
# https://docs.puppet.com/puppet/latest/modules_metadata.html
def version_requirements_from_string(vr_str)
ops = vr_str.scan(/[(<|>|=)]{1,2}/i)
ops = vr_str.scan(/[(<|>=)]{1,2}/i)
vers = vr_str.scan(/[(0-9|.)]+/i)

raise 'Invalid version requirements' if ops.count != 0 &&
Expand Down Expand Up @@ -163,7 +163,7 @@ def module_metadata
# Use this property to store the module_source_dir, so we don't traverse
# the tree every time
def get_module_source_directory(call_stack)
matching_caller = call_stack.select { |i| i =~ /(spec_helper_acceptance|_spec)/i }
matching_caller = call_stack.grep(/(spec_helper_acceptance|_spec)/i)

raise 'Error finding module source directory' if matching_caller.empty?

Expand Down

0 comments on commit ee249e1

Please sign in to comment.