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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ 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: ubuntu-latest, ruby: 'jruby-10.0.2.0'}
- {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
13 changes: 13 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,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
Loading