Sha256: 532f15d6dd1a1d550e4582876bbebbb3b26738b702064f2fdf7cb06d6e874702

Contents?: true

Size: 716 Bytes

Versions: 30

Compression:

Stored size: 716 Bytes

Contents

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

%w(lib ext test).each do |dir|
  $LOAD_PATH.unshift File.expand_path("../../#{dir}", __FILE__)
end

require 'oj'

def create_item(doc)
  #puts "#{doc.fetch('/id')}: #{doc.fetch('/labels/it/value')} - #{doc.fetch('/descriptions/it/value')}"
  doc.fetch('/id')
  doc.fetch('/labels/it/value')
  doc.fetch('/descriptions/it/value')
end

100.times { |i|
  File.open('dump_10k.json') { |f|
    f.each { |line|
      #Oj::Doc.open(line) { |doc|
      doc = Oj::Doc.open(line)
        begin
          create_item(doc) if doc.fetch('/type') == 'item'
        rescue Exception => e
          puts "*** #{e.class}: #{e.message}"
        end
      doc.close
      #}
    }
  }
  puts i
}

Version data entries

30 entries across 30 versions & 1 rubygems

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