Sha256: 6193161291517a1c54f337e75f91c79616aa9d9bcc652c5e70f3de4c509dc702

Contents?: true

Size: 688 Bytes

Versions: 18

Compression:

Stored size: 688 Bytes

Contents

#!/usr/bin/env ruby

#!/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

18 entries across 18 versions & 1 rubygems

Version Path
oj-2.12.13 test/bug.rb
oj-2.12.12 test/bug.rb
oj-2.12.10 test/bug.rb
oj-2.12.8 test/bug.rb
oj-2.12.7 test/bug.rb
oj-2.12.5 test/bug.rb
oj-2.12.4 test/bug.rb
oj-2.12.3 test/bug.rb
oj-2.12.2 test/bug.rb
oj-2.12.0 test/bug.rb
oj-2.11.3 test/bug.rb
oj-2.11.2 test/bug.rb
oj-2.11.1 test/bug.rb
oj-2.11.0 test/bug.rb
oj-2.10.3 test/bug.rb
oj-2.10.2 test/bug.rb
oj-2.10.1 test/bug.rb
oj-2.10.0 test/bug.rb