Skip to content

Commit

Permalink
Merge pull request #4092 from envato/ruby-3-preparation
Browse files Browse the repository at this point in the history
Ruby 3 preparation
  • Loading branch information
grosser authored Feb 11, 2024
2 parents a370be7 + 589a829 commit 5b372e5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/channels/deploy_notifications_channel.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class DeployNotificationsChannel < ActionCable::Channel::Base
def self.broadcast(count)
ActionCable.server.broadcast channel_name, count: count
ActionCable.server.broadcast(channel_name, {count: count})
end

# called when using javascript App.cable.subscriptions.create
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/csv_exports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def new
case params[:type]
when "users"
options = user_filter
send_data UserCsvPresenter.to_csv(options), type: :csv, filename: "Users_#{options[:datetime]}.csv"
send_data UserCsvPresenter.to_csv(**options), type: :csv, filename: "Users_#{options[:datetime]}.csv"
when "deploy_group_usage"
date_time_now = Time.now.strftime "%Y%m%d_%H%M"
send_data DeployGroupUsageCsvPresenter.to_csv, type: :csv, filename: "DeployGroupUsage_#{date_time_now}.csv"
Expand Down
13 changes: 6 additions & 7 deletions lib/samson/secrets/vault_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ def sync!(other)

def create_client
VaultClientWrapper.new(
DEFAULT_CLIENT_OPTIONS.merge(
address: address,
ssl_cert_store: cert_store,
ssl_verify: tls_verify,
token: token,
versioned_kv: versioned_kv?
)
**DEFAULT_CLIENT_OPTIONS,
address: address,
ssl_cert_store: cert_store,
ssl_verify: tls_verify,
token: token,
versioned_kv: versioned_kv?
)
end

Expand Down
8 changes: 4 additions & 4 deletions plugins/kubernetes/app/models/kubernetes/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ class Pod < Immutable
end

class PodDisruptionBudget < VersionedUpdate
def initialize(*)
super
def initialize(...)
super(...)
@delete_resource ||= @template[:delete] # allow deletion through release_doc logic
end
end
Expand All @@ -427,9 +427,9 @@ def template_for_update
end
end

def self.build(*args)
def self.build(*args, **kwargs)
klass = "Kubernetes::Resource::#{args.first.fetch(:kind)}".safe_constantize || VersionedUpdate
klass.new(*args)
klass.new(*args, **kwargs)
end
end
end
2 changes: 1 addition & 1 deletion plugins/sentry/lib/samson_sentry/samson_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ class SamsonPlugin < Rails::Engine

Samson::Hooks.callback :error do |exception, **options|
sentry_options = options.slice(:contexts, :extra, :tags, :user, :level, :fingerprint)
Sentry.capture_exception(exception, sentry_options)
Sentry.capture_exception(exception, **sentry_options)
end

0 comments on commit 5b372e5

Please sign in to comment.