Sha256: 860230d8411847a2c5d9f03821c9202c73bbe7d1ec5af7668d56b9c07f42dc97

Contents?: true

Size: 667 Bytes

Versions: 23

Compression:

Stored size: 667 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

$: << File.dirname(__FILE__)

require 'helper'

class Handler
  def initialize
    @state = []
  end

  def hash_start
    @state << {}
    @state.last
  end

  def hash_end
    @state.pop
  end

  def hash_set(h,k,v)
    h.store(k,v)
  end

  def array_start
    @state << []
    @state.last
  end


  def array_end
    @state.pop
  end

  def array_append(a,v)
    a << v
  end

  def add_value(v)
    p v
  end

  def error(message, line, column); p "ERROR: #{message}" end
end

$handler = Handler.new

IO.popen("cat tst") { |p| puts Oj.sc_parse($handler, p) }

#File.open('tst', 'r') { |file|  Oj.sc_parse($handler, file) }

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
oj-3.7.6 test/bug.rb
oj-2.18.5 test/bug.rb
oj-2.18.4 test/bug.rb
oj-2.18.3 test/bug.rb
oj-2.18.2 test/bug.rb
oj-2.18.1 test/bug.rb
oj-2.18.0 test/bug.rb
oj-2.17.5 test/bug.rb
oj-2.17.3 test/bug.rb
oj-2.17.2 test/bug.rb
oj-2.17.1 test/bug.rb
oj-2.17.0 test/bug.rb
oj-2.16.1 test/bug.rb
oj-2.14.6 test/bug.rb
oj-2.14.5 test/bug.rb
oj-2.14.4 test/bug.rb
oj-2.14.3 test/bug.rb
oj-2.14.2 test/bug.rb
oj-2.14.1 test/bug.rb
oj-2.14.0 test/bug.rb