Skip to content

Commit

Permalink
Merge pull request #565 from jrafanie/ruby31_support
Browse files Browse the repository at this point in the history
Ruby 3.1 - net/ftp was moved from stdlib to a gem
  • Loading branch information
agrare committed Sep 14, 2023
2 parents 943bd66 + 1e7a75d commit 3fd390e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions manageiq-gems-pending.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "bundler", "~> 2.1", ">= 2.1.4", "!= 2.2.10"
s.add_runtime_dependency "fog-openstack", "~> 1.0"
s.add_runtime_dependency "more_core_extensions", "~> 4.4"
s.add_runtime_dependency "net-ftp", "~> 0.1.2"
s.add_runtime_dependency "nokogiri", "~> 1.14", ">= 1.14.3"
s.add_runtime_dependency "sys-proctable", "~> 1.2.5"
s.add_runtime_dependency "sys-uname", "~> 1.2.1"
Expand Down
9 changes: 8 additions & 1 deletion spec/util/miq-hash_struct_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@
let (:orig) { described_class.new("a" => 1, "b" => 2) }

it("Marshal") { expect(Marshal.load(Marshal.dump(orig))).to eq(orig) }
it("YAML") { expect(YAML.load(YAML.dump(orig))).to eq(orig) }
it("YAML") do
dump = YAML.dump(orig)
# Ruby 3.1 via psych 4.0 changed to default YAML.load to safe_load.
# Ruby 2.7 doesn't accept permitted_classes on load and doesn't respond to unsafe_load.
# Once 2.7 is dropped, we can safely use unsafe_load or load with a list of permitted_classes.
loaded = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(dump) : YAML.load(dump)
expect(loaded).to eq(orig)
end
end
end

0 comments on commit 3fd390e

Please sign in to comment.