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

use YAML.unsafe_load to support Ruby 3.1/Psych 4 #2541

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: ubuntu-ruby-${{ matrix.ruby-version }}
strategy:
matrix:
ruby-version: [3.0, 2.7, 2.6, 2.5]
ruby-version: [3.1, 3.0, 2.7, 2.6, 2.5]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand Down
2 changes: 1 addition & 1 deletion middleman-core/lib/middleman-core/util/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def build_regex(frontmatter_delims)
def parse_yaml(content, full_path)
c = begin
::Middleman::Util.instrument 'parse.yaml' do
::YAML.load(content)
::YAML.respond_to?(:unsafe_load) ? ::YAML.unsafe_load(content) : ::YAML.load(content)
end
rescue StandardError, ::Psych::SyntaxError => error
warn "YAML Exception parsing #{full_path}: #{error.message}"
Expand Down