Sha256: cb2b74b01dc48d654ba9f48ac93306371bb28e800b02dc8cf2246835da094094

Contents?: true

Size: 971 Bytes

Versions: 21

Compression:

Stored size: 971 Bytes

Contents

#!/usr/bin/env ruby

$: << File.dirname(__FILE__)
$oj_dir = File.dirname(File.expand_path(File.dirname(__FILE__)))
%w(lib ext).each do |dir|
  $: << File.join($oj_dir, dir)
end

require 'json'

t = [Time.now.utc]

puts "t.to_json - #{t.to_json}"

puts "--- active support"

require 'active_support'
require "active_support/json"

ActiveSupport::JSON::Encoding.use_standard_json_time_format = false

puts "t.as_json - #{t.as_json}"
puts "t.to_json - #{t.to_json}"

require 'oj'

t = [Time.now.utc]

puts "-----------------------"

#puts "t.as_json - #{t.as_json}"
puts "t.to_json - #{t.to_json}"

#Oj.mimic_JSON

#puts "Oj - t.as_json - #{t.as_json}"

puts "--- active support"

require 'active_support'
require "active_support/json"

ActiveSupport::JSON::Encoding.use_standard_json_time_format = false

puts "t.as_json - #{t.as_json}"
puts "t.to_json - #{t.to_json}"

puts "--- optimize"
Oj.optimize_rails

puts "t.as_json - #{t.as_json}"
puts "t.to_json - #{t.to_json}"

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
oj-3.11.3 test/foo.rb
oj-3.11.2 test/foo.rb
oj-3.11.1 test/foo.rb
oj-3.11.0 test/foo.rb
oj-3.10.18 test/foo.rb
oj-3.10.17 test/foo.rb
oj-3.10.16 test/foo.rb
oj-3.10.15 test/foo.rb
oj-3.10.14 test/foo.rb
oj-3.10.13 test/foo.rb
oj-3.10.12 test/foo.rb
oj-3.10.11 test/foo.rb
oj-3.10.10 test/foo.rb
oj-3.10.9 test/foo.rb
oj-3.10.8 test/foo.rb
oj-3.10.7 test/foo.rb
oj-3.10.6 test/foo.rb
oj-3.10.5 test/foo.rb
oj-3.10.3 test/foo.rb
oj-3.10.2 test/foo.rb