Skip to content
Open
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ jobs:
cfg:
- {os: ubuntu-latest, ruby: '2.7'}
- {os: ubuntu-22.04, ruby: '3.2'} # with openssl 3
- {os: ubuntu-22.04, ruby: 'jruby-9.3.14.0'}
- {os: ubuntu-latest, ruby: 'jruby-9.4.8.0'}
- {os: ubuntu-latest, ruby: 'jruby-9.4.12.1'}
- {os: windows-2022, ruby: '2.7'}
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 2.7
Exclude:
- acceptance/**/*
- vendor/**/*
Expand Down
25 changes: 14 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# Configuration parameters: EnforcedStyle, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns.
# SupportedStyles: snake_case, camelCase
# ForbiddenIdentifiers: __id__, __send__
Naming/MethodName:
Exclude:
- 'spec/mocks/win32ole.rb'
- 'spec/mocks/ffi.rb'
- 'spec/facter/util/windows/network_utils_spec.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
Performance/RegexpMatch:
Expand All @@ -35,7 +25,7 @@ Style/ClassVars:
- 'spec/custom_facts/puppetlabs_spec/files.rb'
- 'spec/framework/logging/logger_spec.rb'

# Offense count: 981
# Offense count: 982
# Configuration parameters: AllowedConstants.
Style/Documentation:
Enabled: false
Expand All @@ -46,3 +36,16 @@ Style/Documentation:
Style/OptionalBooleanParameter:
Exclude:
- 'lib/facter/util/resolvers/http.rb'

# Offense count: 13
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SlicingWithRange:
Exclude:
- 'install.rb'
- 'lib/facter/facts/solaris/ldom.rb'
- 'lib/facter/framework/cli/cli.rb'
- 'lib/facter/resolvers/aix/serialnumber.rb'
- 'lib/facter/resolvers/freebsd/swap_memory.rb'
- 'lib/facter/resolvers/networking.rb'
- 'lib/facter/resolvers/partitions.rb'
- 'lib/facter/util/api_debugger.rb'
6 changes: 1 addition & 5 deletions lib/docs/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ def format_facts(fact_hash)
facts: fact_hash
})

erb = if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
ERB.new(File.read(PATH_TO_TEMPLATE), trim_mode: '-')
else
ERB.new(File.read(PATH_TO_TEMPLATE), nil, '-')
end
erb = ERB.new(File.read(PATH_TO_TEMPLATE), trim_mode: '-')
erb.result(scope.instance_eval { binding })
end

Expand Down
2 changes: 1 addition & 1 deletion lib/facter/framework/cli/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def man(*args)
negate_options = %w[block cache custom_facts external_facts]

template = File.join(File.dirname(__FILE__), '..', '..', 'templates', 'man.erb')
erb = ERB.new(File.read(template), nil, '-')
erb = ERB.new(File.read(template), trim_mode: '-')
erb.filename = template
puts erb.result(binding)
end
Expand Down
2 changes: 1 addition & 1 deletion openfact.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
base = "#{__dir__}#{File::SEPARATOR}"
spec.files = dirs.map { |path| path.sub(base, '') }

spec.required_ruby_version = '>= 2.5', '< 5.0'
spec.required_ruby_version = '>= 2.7', '< 5.0'
spec.bindir = 'bin'
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ['lib']
Expand Down