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 later #337

Merged
merged 5 commits into from
Dec 4, 2024
Merged
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
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
require:
- chefstyle
- cookstyle/chefstyle

AllCops:
TargetRubyVersion: 3.1
Include:
- "**/*.rb"
Exclude:
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@test-kitchen/maintainers
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
source "https://rubygems.org"

# Specify your gem's dependencies in kitchen-dokken.gemspec
gemspec

group :test do
Expand All @@ -11,9 +10,8 @@ end

group :development do
gem "pry"
gem "pry-byebug"
end

group :chefstyle do
gem "chefstyle", "2.2.3"
group :linting do
gem "cookstyle", "7.32.8"
end
12 changes: 8 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
require "bundler/gem_tasks"
require "chefstyle"
require "rubocop/rake_task"

RuboCop::RakeTask.new(:style) do |task|
task.options += ["--display-cop-names", "--no-color"]
begin
require "cookstyle/chefstyle"
require "rubocop/rake_task"
RuboCop::RakeTask.new(:style) do |task|
task.options += ["--display-cop-names", "--no-color"]
end
rescue LoadError
puts "cookstyle/chefstyle is not available. (sudo) gem install cookstyle to do style checking."
end

task default: %i{style}
2 changes: 1 addition & 1 deletion kitchen-dokken.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
spec.files = %w{LICENSE kitchen-dokken.gemspec Gemfile Rakefile} + Dir.glob("lib/**/*")
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.7"
spec.required_ruby_version = ">= 3.1"

spec.add_dependency "docker-api", ">= 1.33", "< 3"
spec.add_dependency "lockfile", "~> 2.1"
Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/driver/dokken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def docker_config_creds
next if v["auth"].nil?

username, password = Base64.decode64(v["auth"]).split(":")
@docker_config_creds[k] = { serveraddress: k, username: username, password: password }
@docker_config_creds[k] = { serveraddress: k, username:, password: }
end
end

Expand Down
10 changes: 5 additions & 5 deletions lib/kitchen/transport/dokken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ def upload(locals, remote)
debug "Rsync is not installed. Falling back to SCP."
locals.each do |local|
Net::SCP.upload!(ssh_ip,
"root",
local,
remote,
recursive: true,
ssh: { port: ssh_port, keys: ["#{tmpdir}/id_rsa"] })
"root",
local,
remote,
recursive: true,
ssh: { port: ssh_port, keys: ["#{tmpdir}/id_rsa"] })
end
end
end
Expand Down
16 changes: 8 additions & 8 deletions test/cookbooks/dokken_test/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
user "notroot"
live_stream true
environment "PATH" => "/usr/bin:/usr/local/bin:/home/notroot/bin",
"HOME" => "/home/notroot",
"DOCKER_HOST" => "tcp://127.0.0.1:2375",
"CHEF_LICENSE" => "accept-no-persist"
"HOME" => "/home/notroot",
"DOCKER_HOST" => "tcp://127.0.0.1:2375",
"CHEF_LICENSE" => "accept-no-persist"
action :run
end

Expand All @@ -69,8 +69,8 @@
user "notroot"
live_stream true
environment "PATH" => "/usr/bin:/usr/local/bin:/home/notroot/bin",
"HOME" => "/home/notroot",
"DOCKER_HOST" => "tcp://127.0.0.1:2375"
"HOME" => "/home/notroot",
"DOCKER_HOST" => "tcp://127.0.0.1:2375"
action :run
end

Expand All @@ -87,8 +87,8 @@
user "notroot"
live_stream true
environment "PATH" => "/usr/bin:/usr/local/bin:/home/notroot/bin",
"HOME" => "/home/notroot",
"DOCKER_HOST" => "tcp://127.0.0.1:2375",
"CHEF_LICENSE" => "accept-no-persist"
"HOME" => "/home/notroot",
"DOCKER_HOST" => "tcp://127.0.0.1:2375",
"CHEF_LICENSE" => "accept-no-persist"
action :run
end
Loading