Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed a few bugs
  • Loading branch information
ohler55 committed Apr 23, 2013
1 parent 00f2666 commit 92944e9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -32,15 +32,15 @@ A fast JSON parser and Object marshaller as a Ruby gem.

## <a name="release">Release Notes</a>

### Release 2.0.10
### Release 2.0.11

- Tweaked dump calls by reducing preallocation. Speeds are now several times faster for smaller objects.
- Fixed mimic issue with Debian

- Fixed Windows compile error with Ruby 2.0.0.
- Added option to not cache classes when loading. This should be used when classes are dynamically unloaded and the redefined.

### Release 2.0.9
- Float rounding improved by limiting decimal places to 15 places.

- Fixed problem with INFINITY with CentOS and Ruby 2.0.0. There are some header file conflicts so a different INFINITY was used.
- Fixed xml time dumping test.

## <a name="description">Description</a>

Expand Down
2 changes: 1 addition & 1 deletion ext/oj/dump.c
Expand Up @@ -429,7 +429,7 @@ dump_float(VALUE obj, Out out) {
} else if (d == (double)(long long int)d) {
cnt = sprintf(buf, "%.1f", d); // used sprintf due to bug in snprintf
} else {
cnt = sprintf(buf, "%0.16g", d); // used sprintf due to bug in snprintf
cnt = sprintf(buf, "%0.15g", d); // used sprintf due to bug in snprintf
}
if (out->end - out->cur <= (long)cnt) {
grow(out, cnt);
Expand Down
2 changes: 1 addition & 1 deletion lib/oj/version.rb
@@ -1,5 +1,5 @@

module Oj
# Current version of the module.
VERSION = '2.0.10'
VERSION = '2.0.11'
end
5 changes: 0 additions & 5 deletions notes
Expand Up @@ -3,11 +3,6 @@
^c^d hide subtree
^c^s show subtree

+ fixed mimic issue with debian
+ add option to avoid class caching
- can dump be smarter about floats
- print for time when zulu


---------------------------
Tried a separate thread for the parser and the results were poor. The parsing is 10% to 15% of the total so splitting
Expand Down
3 changes: 2 additions & 1 deletion test/tests.rb
Expand Up @@ -183,6 +183,7 @@ def test_fixnum
def test_float
dump_and_load(0.0, false)
dump_and_load(12345.6789, false)
dump_and_load(70.35, false)
dump_and_load(-54321.012, false)
dump_and_load(2.48e16, false)
dump_and_load(2.48e100 * 1.0e10, false)
Expand Down Expand Up @@ -363,7 +364,7 @@ def test_xml_time_compat_precision_round
begin
t = Time.new(2012, 1, 5, 23, 58, 7.9996, 32400)
json = Oj.dump(t, :mode => :compat, :time_format => :xmlschema, :second_precision => 3)
assert_equal(%{"2012-01-05T23:58:08.000+09:00"}, json)
assert_equal(%{"2012-01-05T23:58:08+09:00"}, json)
rescue Exception
# some Rubies (1.8.7) do not allow the timezome to be set
t = Time.local(2012, 1, 5, 23, 58, 7, 999600)
Expand Down

0 comments on commit 92944e9

Please sign in to comment.