oj 3.13.0 → 3.13.4

Sign up to get free protection for your applications and to get access to all the features.
data/test/bar.rb DELETED
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $: << File.dirname(__FILE__)
4
- $oj_dir = File.dirname(File.expand_path(File.dirname(__FILE__)))
5
- %w(lib ext).each do |dir|
6
- $: << File.join($oj_dir, dir)
7
- end
8
-
9
- require 'active_support'
10
- require "active_support/json"
11
-
12
- $s = "\u2014 & \n \u{1F618}"
13
-
14
- =begin
15
- def check(label)
16
- puts "\n--- #{label} --------------------"
17
-
18
- ActiveSupport::JSON::Encoding.use_standard_json_time_format = true
19
- puts "with standard_json == true: t.to_json - #{$t.to_json}"
20
- ActiveSupport::JSON::Encoding.use_standard_json_time_format = false
21
- puts "with standard_json == false: t.to_json - #{$t.to_json}"
22
- end
23
-
24
- check('Before Oj')
25
- =end
26
-
27
- require 'oj'
28
-
29
- ActiveSupport::JSON::Encoding.escape_html_entities_in_json = false
30
- puts "ActiveSupport.encode(s) - #{ActiveSupport::JSON.encode($s)}"
31
-
32
- Oj.optimize_rails
33
- Oj.default_options = { mode: :rails }
34
-
35
- puts "Oj.dump(s) - #{Oj.dump($s)}"
data/test/baz.rb DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $: << File.dirname(__FILE__)
4
- $oj_dir = File.dirname(File.expand_path(File.dirname(__FILE__)))
5
- %w(lib ext).each do |dir|
6
- $: << File.join($oj_dir, dir)
7
- end
8
-
9
- require 'oj'
10
- Oj.mimic_JSON()
11
-
12
- begin
13
- ::JSON.load('name=&email=&subject=&comment=&submit=Send+Message')
14
- rescue ::JSON::ParserError
15
- puts "*** Pass"
16
- end
data/test/prec.rb DELETED
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'oj'
4
-
5
- extras = {"locationLng" => -97.14690769100295}
6
-
7
- Oj.default_options = {float_precision: 17}
8
-
9
- encoded = Oj.dump(extras)
10
- puts encoded
11
- puts Oj.load(encoded)
12
-
13
- require "active_record"
14
-
15
- Oj::Rails.set_encoder()
16
- Oj::Rails.set_decoder()
17
-
18
- Oj.default_options = {float_precision: 17}
19
- # Using Oj rails encoder, gets the correct value: {"locationLng":-97.14690769100295}
20
- encoded = ActiveSupport::JSON.encode(extras)
21
- puts encoded
22
- puts ActiveSupport::JSON.decode(encoded)
23
- puts Oj.load(encoded)
data/test/zoo.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- #require 'json'
4
-
5
- $: << File.dirname(__FILE__)
6
- require 'helper'
7
- require 'oj'
8
-
9
- Oj.mimic_JSON
10
- puts "\u3074"
11
-
12
- puts JSON.dump(["\u3074"])
13
- puts JSON.generate(["\u3074"])