Skip to content

Commit

Permalink
Merge pull request #707 from jrafanie/ruby31
Browse files Browse the repository at this point in the history
Support ruby 3.1
  • Loading branch information
Fryguy authored Oct 16, 2023
2 parents 26c9501 + d38a7c6 commit 9a60db5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
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

0 comments on commit 9a60db5

Please sign in to comment.