Class: SafeYAML::LibyamlChecker

### Home Classes Methods

### In Files

- lib/safe_yaml/libyaml_checker.rb

### Parent

Object

### Methods

- ::libyaml_patched?
- ::libyaml_version_ok?

### Class/Module Index

Quicksearch

- SafeYAML
- SafeYAML::Deep
- SafeYAML::LibyamlChecker
- SafeYAML::Parse
- SafeYAML::Parse::Date
- SafeYAML::Parse::Hexadecimal
- SafeYAML::Parse::Sexagesimal
- SafeYAML::PsychHandler
- SafeYAML::PsychResolver
- SafeYAML::Resolver
- SafeYAML::SafeToRubyVisitor
- SafeYAML::SyckResolver
- SafeYAML::Transform
- SafeYAML::Transform::ToBoolean
- SafeYAML::Transform::ToDate
- SafeYAML::Transform::ToFloat
- SafeYAML::Transform::ToInteger
- SafeYAML::Transform::ToNil
- SafeYAML::Transform::ToSymbol
- SafeYAML::Transform::TransformationMap
- SafeYAML::Transform::TransformationMap::CaseAgnosticMap
- SafeYAML::Transform::TransformationMap::ClassMethods
- Object
- YAML

No matching classes.

# SafeYAML::LibyamlChecker

### Constants

KNOWN_PATCHED_LIBYAML_VERSIONS
LIBYAML_VERSION
SAFE_LIBYAML_VERSION

  Do proper version comparison (e.g. so 0.1.10 is >= 0.1.6)

### Public Class Methods

libyaml_patched?() click to toggle source

    # File lib/safe_yaml/libyaml_checker.rb, line 29
    def self.libyaml_patched?
      return false if (`which dpkg` rescue '').empty?
      libyaml_version = `dpkg -s libyaml-0-2`.match(/^Version: (.*)$/)
      return false if libyaml_version.nil?
      KNOWN_PATCHED_LIBYAML_VERSIONS.include?(libyaml_version[1])
    end

libyaml_version_ok?() click to toggle source

    # File lib/safe_yaml/libyaml_checker.rb, line 23
    def self.libyaml_version_ok?
      return true if YAML_ENGINE != "psych" || defined?(JRUBY_VERSION)
      return true if Gem::Version.new(LIBYAML_VERSION || "0") >= SAFE_LIBYAML_VERSION
      return libyaml_patched?
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.