Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Ruby 3.1 or newer #99

Closed
wants to merge 2 commits into from
Closed
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
29 changes: 17 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ jobs:
fail-fast: false
matrix:
ruby_version:
- "2.7"
- "3.3"
- "3.2"
include:
- ruby-version: '2.7'
puppet_gem_version: '~> 7.0'
- ruby_version: '3.2'
puppet_gem_version: '~> 8.0' # puppet8'
- "3.1"
puppet_gem_version:
- '~> 8.0'
runs_on:
- "ubuntu-latest"
- "windows-latest"
include:
- ruby_version: '3.1'
puppet_gem_version: '~> 7.0'
runs_on: 'ubuntu-latest'
name: "spec (${{ matrix.runs_on }} ruby ${{ matrix.ruby_version }} | puppet ${{matrix.puppet_gem_version}})"
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
secrets: "inherit"
Expand All @@ -42,16 +44,19 @@ jobs:
strategy:
matrix:
ruby_version:
- "2.7"
- "3.3"
- "3.2"
include:
- ruby-version: '2.7'
puppet_gem_version: '~> 7.0'
- ruby_version: '3.2'
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8'
- "3.1"
puppet_gem_version:
- '~> 8.0'
- 'https://github.com/puppetlabs/puppet'
runs_on:
- "ubuntu-latest"
- "windows-latest"
include:
- ruby_version: '3.1'
puppet_gem_version: '~> 7.0'
runs_on: 'ubuntu-latest'
name: "acceptance (${{ matrix.runs_on }} ruby ${{ matrix.ruby_version }} | puppet ${{matrix.puppet_gem_version}})"
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main"
secrets: "inherit"
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ inherit_gem:
# Disabled
Style/ClassAndModuleChildren:
Enabled: false

AllCops:
TargetRubyVersion: '3.1'
8 changes: 4 additions & 4 deletions lib/puppet/modulebuilder/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def validate_path_encoding!(path)
return unless /[^\x00-\x7F]/.match?(path)

raise ArgumentError, format("'%<path>s' can only include ASCII characters in its path or " \
'filename in order to be compatible with a wide range of hosts.', path: path)
'filename in order to be compatible with a wide range of hosts.', path:)
end

# Creates a gzip compressed tarball of the build directory.
Expand Down Expand Up @@ -235,7 +235,7 @@ def build_package
entry_meta[:mode] = orig_mode | min_mode

if entry_meta[:mode] != orig_mode
logger.debug(format('Updated permissions of packaged \'%<entry>s\' to %<new_mode>s', entry: entry,
logger.debug(format('Updated permissions of packaged \'%<entry>s\' to %<new_mode>s', entry:,
new_mode: (entry_meta[:mode] & 0o7777).to_s(8)))
end

Expand Down Expand Up @@ -355,7 +355,7 @@ def release_name
#
# @return [nil]
def validate_ustar_path!(path)
raise ArgumentError, format("The path '%<path>s' is longer than 256 bytes.", path: path) if path.bytesize > 256
raise ArgumentError, format("The path '%<path>s' is longer than 256 bytes.", path:) if path.bytesize > 256

if path.bytesize <= 100
prefix = ''
Expand All @@ -380,7 +380,7 @@ def validate_ustar_path!(path)
raise ArgumentError, \
format("'%<path>s' could not be split at a directory separator into two " \
'parts, the first having a maximum length of 155 bytes and the ' \
'second having a maximum length of 100 bytes.', path: path)
'second having a maximum length of 100 bytes.', path:)
end

private
Expand Down
5 changes: 2 additions & 3 deletions puppet-modulebuilder.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']
# minitar and pathspec is required for building Puppet modules
spec.add_runtime_dependency 'minitar', '~> 0.9'
spec.add_runtime_dependency 'pathspec', '>= 0.2.1', '< 3.0.0'
spec.add_runtime_dependency 'pathspec', '~> 2.1'

spec.add_development_dependency 'voxpupuli-rubocop', '~> 2.8.0'

spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
spec.required_ruby_version = '>= 3.1'
end
Loading