Sha256: 5a09c21d31a8a4d6078985e2d398c8d5a594b0819bede85d5604c28af85d133f

Contents?: true

Size: 668 Bytes

Versions: 41

Compression:

Stored size: 668 Bytes

Contents

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

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

require 'stringio'
require 'oj'


filename = File.join(File.dirname(__FILE__), 'day.json')
File.open(filename, "w") do |f|
  w = Oj::StreamWriter.new(f, :indent => -1)
  390.times do |i|
    w.push_object()
    w.push_value(12, 'msgType')
    w.push_value(1, 'version')
    w.push_value(1_400_074_200 + i * 60, 'bar')
    w.push_value('TBC', 'source')
    w.push_array('timebars')
    w.push_object()
    w.push_value('aapl_24', 'asset')
    w.push_value(91.87, 'close')
    w.pop()
    w.pop()
    w.pop()
  end
  f.write("\n")
end

Version data entries

41 entries across 41 versions & 1 rubygems

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