Sha256: 7aa1d2eaf6624c49f95c3f3d104c2b39f973e749fcfac7345a86535247eb15c0

Contents?: true

Size: 690 Bytes

Versions: 165

Compression:

Stored size: 690 Bytes

Contents

module SafeYAML
  class SafeToRubyVisitor < Psych::Visitors::ToRuby
    INITIALIZE_ARITY = superclass.instance_method(:initialize).arity

    def initialize(resolver)
      case INITIALIZE_ARITY
      when 2
        # https://github.com/tenderlove/psych/blob/v2.0.0/lib/psych/visitors/to_ruby.rb#L14-L28
        loader  = Psych::ClassLoader.new
        scanner = Psych::ScalarScanner.new(loader)
        super(scanner, loader)

      else
        super()
      end

      @resolver = resolver
    end

    def accept(node)
      if node.tag
        SafeYAML.tag_safety_check!(node.tag, @resolver.options)
        return super
      end

      @resolver.resolve_node(node)
    end
  end
end

Version data entries

165 entries across 143 versions & 15 rubygems

Version Path
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
dadapush_client-1.0.1 vendor/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb
brakeman-4.6.1 bundle/ruby/2.6.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
brakeman-4.6.0 bundle/ruby/2.6.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
brakeman-4.5.1 bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
brakeman-4.5.0 bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb
safe_yaml-1.0.5 lib/safe_yaml/safe_to_ruby_visitor.rb
brakeman-4.4.0 bundle/ruby/2.5.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb
vagrant-unbundled-2.2.0.0 vendor/bundle/ruby/2.5.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb
vagrant-unbundled-2.1.4.0 vendor/bundle/ruby/2.5.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb
vagrant-unbundled-2.1.2.0 vendor/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb