Skip to content

Commit

Permalink
[HFH-2454] Support multiple versions of ruby/psych (#3751)
Browse files Browse the repository at this point in the history
**What does this PR do?** A clear and concise description with your
runway ticket url.

Support Pysch 4 / Ruby 3.1+
  • Loading branch information
xjunior authored Oct 1, 2024
1 parent a506813 commit d978e0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions playbook/lib/playbook/pb_doc_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def pb_kits(type: "rails", limit_examples: false, dark_mode: false, method: get_

# rubocop:disable Naming/AccessorMethodName
def get_kits
menu = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))
menu = ActiveSupport::ConfigurationFile.parse(Playbook::Engine.root.join("dist/menu.yml"))
all_kits = []
menu["kits"].each do |kit|
kit_name = kit["name"]
Expand All @@ -61,7 +61,7 @@ def get_kits
end

def get_kits_pb_website
menu = YAML.load_file(Rails.root.join("config/menu.yml"))
menu = ActiveSupport::ConfigurationFile.parse(Rails.root.join("config/menu.yml"))
menu["kits"]
end
# rubocop:enable Naming/AccessorMethodName
Expand All @@ -84,9 +84,9 @@ def pb_doc_kit_path(kit, *args)
def pb_doc_kit_examples(kit, type)
example_file = pb_doc_kit_path(kit, "example.yml")
if File.exist?(example_file)
examples_list = YAML.load_file(example_file)
.inject({}) { |item, (k, v)| item[k.to_sym] = v; item }
examples_list.dig(:examples, type) || []
ActiveSupport::ConfigurationFile.parse(example_file)
.transform_keys(&:to_sym)
.dig(:examples, type) || []
else
[]
end
Expand Down

0 comments on commit d978e0f

Please sign in to comment.