brianmario-yajl-ruby 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +12 -6
 - data/VERSION.yml +1 -1
 - data/ext/extconf.rb +6 -2
 - data/ext/yajl.c +9 -2
 - 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 
     | 
    
         
            -
              
     | 
| 
      
 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 
     | 
    
         
            -
              
     | 
| 
       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
    
    
    
        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 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
                 
     | 
| 
      
 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,  
     | 
| 
      
 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;
         
     |