Sha256: 75b863a13be3d89c0271a3032b5cdb4c92a3c2a639e89a938fac97cd34917c60

Contents?: true

Size: 1.11 KB

Versions: 264

Compression:

Stored size: 1.11 KB

Contents

# Hack to JRuby 1.8's YAML Parser Yecht
#
# This file is always loaded AFTER either syck or psych are already
# loaded. It then looks at what constants are available and creates
# a consistent view on all rubys.
#
# Taken from rubygems and modified.
# See https://github.com/rubygems/rubygems/blob/master/lib/rubygems/syck_hack.rb

module YAML
  # In newer 1.9.2, there is a Syck toplevel constant instead of it
  # being underneith YAML. If so, reference it back under YAML as
  # well.
  if defined? ::Syck
    # for tests that change YAML::ENGINE
    # 1.8 does not support the second argument to const_defined?
    remove_const :Syck rescue nil

    Syck = ::Syck

  # JRuby's "Syck" is called "Yecht"
  elsif defined? YAML::Yecht
    Syck = YAML::Yecht
  end
end

# Sometime in the 1.9 dev cycle, the Syck constant was moved from under YAML
# to be a toplevel constant. So gemspecs created under these versions of Syck
# will have references to Syck::DefaultKey.
#
# So we need to be sure that we reference Syck at the toplevel too so that
# we can always load these kind of gemspecs.
#
if !defined?(Syck)
  Syck = YAML::Syck
end

Version data entries

264 entries across 242 versions & 17 rubygems

Version Path
brakeman-6.1.1 bundle/ruby/3.0.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-6.1.0 bundle/ruby/3.1.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-6.0.1 bundle/ruby/3.1.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-6.0.0 bundle/ruby/3.0.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.4.1 bundle/ruby/3.1.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.4.0 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.3.1 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.3.0 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.2.3 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.2.2 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.2.1 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.2.0 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.1.2 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.1.1 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.1.0 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.0.4 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.0.2 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.0.1 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-5.0.0 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb
brakeman-4.10.1 bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb