Welcome to mirror list, hosted at ThFree Co, Russian Federation.

0_1_yaml_safe_load_file_patch.rb « initializers « config - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f43712900eb2f3a966627b03efcf7b2c3789e211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

# TODO: Remove this once we're on Ruby 3
# https://gitlab.com/gitlab-org/gitlab/-/issues/393651
unless YAML.respond_to?(:safe_load_file)
  module YAML
    # Temporary Ruby 2 back-compat workaround.
    #
    # This method only exists as of stdlib 3.0.0:
    # https://ruby-doc.org/stdlib-3.0.0/libdoc/psych/rdoc/Psych.html
    def self.safe_load_file(path, **options)
      YAML.safe_load(File.read(path), **options)
    end
  end
end