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

Support ruby 3.1 #707

Merged
merged 2 commits into from
Oct 16, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def up
update_authentications
end

def self.read_token(file)
File.read(file)
end

private

def containerized?
Expand Down Expand Up @@ -88,7 +92,7 @@ def update_or_create_authentication!(find_args, update_args)
def request_params
{
'Accept' => "application/json",
'Authorization' => "Bearer #{File.read(TOKEN_FILE)}",
'Authorization' => "Bearer #{self.class.read_token(TOKEN_FILE)}",
:ssl_ca_cert => CA_CERT_FILE,
:ssl_verify_mode => OpenSSL::SSL::VERIFY_PEER
}
Expand Down
2 changes: 1 addition & 1 deletion manageiq-schema.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "ancestry"
spec.add_dependency "activerecord-id_regions", "~> 0.3.2"
spec.add_dependency "linux_admin", "~> 2.0"
spec.add_dependency "manageiq-password", "< 2"
spec.add_dependency "manageiq-password", ">= 1.2.0", "< 2"
spec.add_dependency "more_core_extensions", ">= 3.5", "< 5"
spec.add_dependency "pg"
spec.add_dependency "rails", ">=6.0.4", "<7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
end

def expect_request
expect(File).to receive(:read).with(token_path).and_return("totally-a-token")
expect(described_class).to receive(:read_token).with(token_path).and_return("totally-a-token")
response = double("RequestIO", :read => secret_json)
expect(uri_stub).to receive(:open).with({
'Accept' => "application/json",
Expand Down
4 changes: 4 additions & 0 deletions spec/support/yaml_alias_load_as_unsafe_load.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if Psych::VERSION >= "4.0"
require 'yaml'
YAML.singleton_class.alias_method :load, :unsafe_load
end