Sha256: 7a4c30229a302385d20bd6aa7a2c40d197a0ad851417facc9e49b2ed36d12e5d

Contents?: true

Size: 270 Bytes

Versions: 268

Compression:

Stored size: 270 Bytes

Contents

module SafeYAML
  class Parse
    class Hexadecimal
      MATCHER = /\A[-+]?0x[0-9a-fA-F_]+\Z/.freeze

      def self.value(value)
        # This is safe to do since we already validated the value.
        return Integer(value.gsub(/_/, ""))
      end
    end
  end
end

Version data entries

268 entries across 246 versions & 17 rubygems

Version Path
puppet-3.8.2-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/hexadecimal.rb
puppet-retrospec-0.7.3 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/hexadecimal.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/hexadecimal.rb
puppet-retrospec-0.7.2 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.8.1 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.8.1-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.8.1-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.5 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.5-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.5-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.4 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.4-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.4-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.3 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.3-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.3-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.2 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb
puppet-3.7.2-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb