Sha256: 1a56c6c0bd63a0266745df9e9ab1dd9d5ff0cbb53cb368409c99deea54bde0a2

Contents?: true

Size: 653 Bytes

Versions: 26

Compression:

Stored size: 653 Bytes

Contents

require 'yajl' unless defined?(Yajl::Parser)

module JSON
  class JSONError < StandardError; end unless defined?(JSON::JSONError)
  class ParserError < JSONError; end unless defined?(JSON::ParserError)

  def self.default_options
    @default_options ||= {:symbolize_keys => false}
  end

  def self.parse(str, opts=JSON.default_options)
    begin
      Yajl::Parser.parse(str, opts)
    rescue Yajl::ParseError => e
      raise JSON::ParserError, e.message
    end
  end

  def self.load(input, *args)
    begin
      Yajl::Parser.parse(input, default_options)
    rescue Yajl::ParseError => e
      raise JSON::ParserError, e.message
    end
  end
end

Version data entries

26 entries across 26 versions & 9 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/lib/yajl/json_gem/parsing.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/lib/yajl/json_gem/parsing.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/lib/yajl/json_gem/parsing.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/lib/yajl/json_gem/parsing.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/yajl-ruby-1.4.3/lib/yajl/json_gem/parsing.rb
yajl-ruby-1.4.3 lib/yajl/json_gem/parsing.rb
yajl-ruby-1.4.2 lib/yajl/json_gem/parsing.rb
yajl-ruby-1.4.1 lib/yajl/json_gem/parsing.rb
yajl-ruby-1.4.0 lib/yajl/json_gem/parsing.rb
yajl-ruby-1.2.3 lib/yajl/json_gem/parsing.rb
yajl-ruby-1.3.1 lib/yajl/json_gem/parsing.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/yajl-ruby-1.3.0/lib/yajl/json_gem/parsing.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/yajl-ruby-1.3.0/lib/yajl/json_gem/parsing.rb
yajl-ruby-1.2.2 lib/yajl/json_gem/parsing.rb
yajl-ruby-1.3.0 lib/yajl/json_gem/parsing.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/yajl-ruby-1.2.1/lib/yajl/json_gem/parsing.rb
yajl-ruby-1.2.1 lib/yajl/json_gem/parsing.rb
yajl-ruby-1.2.0 lib/yajl/json_gem/parsing.rb
yajl-ruby-zenjoy-1.1.0 lib/yajl/json_gem/parsing.rb
yajl-ruby-maglev--1.1.0 lib/yajl/json_gem/parsing.rb