brianmario-yajl-ruby 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/CHANGELOG.rdoc +12 -6
  2. data/VERSION.yml +1 -1
  3. data/ext/extconf.rb +6 -2
  4. data/ext/yajl.c +9 -2
  5. metadata +1 -1
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,12 @@
1
1
  = Changelog
2
2
 
3
+ 0.3.4 (April 24th, 2009)
4
+ * turned Unicode checks back on in the Yajl parser now that it's fixed (thanks Lloyd!)
5
+ ** this also bumps the yajl version dependency requirement to 1.0.4
6
+ * better guessing of Integer/Float from number found instead of just trying to create a BigNum no matter what
7
+ * changed extconf.rb to fail Makefile creation if yajl isn't found
8
+ * added a test to check for parsing Infinity due to a Float overflow
9
+
3
10
  0.3.3 (April 24th, 2009)
4
11
  * 1.9 compatibility
5
12
 
@@ -16,13 +23,12 @@
16
23
  * added some initial spec tests
17
24
  ** ported some from ActiveSupport to ensure proper compatibility
18
25
  ** included 57 JSON fixtures to test against, all of which pass
19
- * changed parser config to not check for invalid unicode characters as Ruby is
20
- going to do this anyway (?). This resolves the remaining test failures around unicode.
26
+ * changed parser config to not check for invalid unicode characters as Ruby is going to do this anyway (?).
27
+ This resolves the remaining test failures around unicode.
21
28
  * changed how the parser was dealing with numbers to prevent overflows
22
- * added an exception class Yajl::ParseError which is now used in place of simply
23
- printing to STDERR upon a parsing error
24
- * renamed a couple of JSON test files in the benchmark folder to better represent their
25
- contents
29
+ * added an exception class Yajl::ParseError which is now used in place of simply printing to STDERR upon a parsing
30
+ error
31
+ * renamed a couple of JSON test files in the benchmark folder to better represent their contents
26
32
  * misc README updates
27
33
 
28
34
  0.2.1 (April 23rd, 2009)
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 3
2
+ :patch: 4
3
3
  :major: 0
4
4
  :minor: 3
data/ext/extconf.rb CHANGED
@@ -2,5 +2,9 @@ require 'mkmf'
2
2
  dir_config('yajl')
3
3
  have_header('yajl/yajl_parse.h')
4
4
  have_header('yajl/yajl_gen.h')
5
- have_library('yajl')
6
- create_makefile("yajl")
5
+
6
+ if have_library("yajl")
7
+ create_makefile("yajl")
8
+ else
9
+ puts "Yajl not found, maybe try manually specifying --with-yajl-dir to find it?"
10
+ end
data/ext/yajl.c CHANGED
@@ -48,7 +48,14 @@ static int found_boolean(void * ctx, int boolean) {
48
48
  }
49
49
 
50
50
  static int found_number(void * ctx, const char * numberVal, unsigned int numberLen) {
51
- set_static_value(ctx, rb_str2inum(rb_str_new(numberVal, numberLen), 10));
51
+ if (strstr(numberVal, ".") != NULL
52
+ || strstr(numberVal, "e") != NULL
53
+ || strstr(numberVal, "E") != NULL) {
54
+ set_static_value(ctx, rb_Float(rb_str_new(numberVal, numberLen)));
55
+ } else {
56
+ set_static_value(ctx, rb_Integer(rb_str_new(numberVal, numberLen)));
57
+ }
58
+
52
59
  return 1;
53
60
  }
54
61
 
@@ -101,7 +108,7 @@ static yajl_callbacks callbacks = {
101
108
  };
102
109
 
103
110
  static ID intern_io_read, intern_eof;
104
- yajl_parser_config cfg = {1, 0};
111
+ static yajl_parser_config cfg = {1, 1};
105
112
 
106
113
  static VALUE t_parse(VALUE self, VALUE io) {
107
114
  yajl_handle hand;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brianmario-yajl-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Lopez