yajl-ruby 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of yajl-ruby might be problematic. Click here for more details.

Files changed (46) hide show
  1. data/CHANGELOG.md +8 -1
  2. data/MIT-LICENSE +3 -3
  3. data/README.rdoc +8 -8
  4. data/VERSION.yml +1 -1
  5. data/benchmark/subjects/ohai.yml +171 -171
  6. data/ext/api/yajl_common.h +9 -9
  7. data/ext/api/yajl_gen.h +10 -10
  8. data/ext/api/yajl_parse.h +15 -15
  9. data/ext/yajl.c +8 -8
  10. data/ext/yajl_alloc.c +6 -6
  11. data/ext/yajl_alloc.h +6 -6
  12. data/ext/yajl_buf.c +7 -7
  13. data/ext/yajl_buf.h +7 -7
  14. data/ext/yajl_bytestack.h +10 -10
  15. data/ext/yajl_encode.c +12 -12
  16. data/ext/yajl_encode.h +6 -6
  17. data/ext/yajl_ext.c +67 -80
  18. data/ext/yajl_ext.h +4 -4
  19. data/ext/yajl_gen.c +16 -16
  20. data/ext/yajl_lex.c +79 -76
  21. data/ext/yajl_lex.h +14 -14
  22. data/ext/yajl_parser.c +34 -34
  23. data/ext/yajl_parser.h +7 -7
  24. data/lib/yajl.rb +7 -7
  25. data/lib/yajl/bzip2/stream_reader.rb +1 -11
  26. data/lib/yajl/bzip2/stream_writer.rb +1 -1
  27. data/lib/yajl/deflate/stream_reader.rb +6 -7
  28. data/lib/yajl/deflate/stream_writer.rb +2 -2
  29. data/lib/yajl/gzip/stream_reader.rb +0 -10
  30. data/lib/yajl/http_stream.rb +12 -12
  31. data/lib/yajl/json_gem/encoding.rb +4 -4
  32. data/lib/yajl/json_gem/parsing.rb +3 -3
  33. data/spec/encoding/encoding_spec.rb +23 -23
  34. data/spec/global/global_spec.rb +8 -8
  35. data/spec/http/http_delete_spec.rb +13 -13
  36. data/spec/http/http_error_spec.rb +2 -2
  37. data/spec/http/http_get_spec.rb +15 -15
  38. data/spec/http/http_post_spec.rb +12 -12
  39. data/spec/http/http_put_spec.rb +14 -14
  40. data/spec/json_gem_compatibility/compatibility_spec.rb +21 -21
  41. data/spec/parsing/active_support_spec.rb +6 -6
  42. data/spec/parsing/chunked_spec.rb +12 -12
  43. data/spec/parsing/fixtures_spec.rb +4 -4
  44. data/spec/parsing/one_off_spec.rb +9 -9
  45. data/yajl-ruby.gemspec +3 -3
  46. metadata +12 -5
@@ -1,22 +1,22 @@
1
1
  /*
2
2
  * Copyright 2007-2009, Lloyd Hilaiel.
3
- *
3
+ *
4
4
  * Redistribution and use in source and binary forms, with or without
5
5
  * modification, are permitted provided that the following conditions are
6
6
  * met:
7
- *
7
+ *
8
8
  * 1. Redistributions of source code must retain the above copyright
9
9
  * notice, this list of conditions and the following disclaimer.
10
- *
10
+ *
11
11
  * 2. Redistributions in binary form must reproduce the above copyright
12
12
  * notice, this list of conditions and the following disclaimer in
13
13
  * the documentation and/or other materials provided with the
14
14
  * distribution.
15
- *
15
+ *
16
16
  * 3. Neither the name of Lloyd Hilaiel nor the names of its
17
17
  * contributors may be used to endorse or promote products derived
18
18
  * from this software without specific prior written permission.
19
- *
19
+ *
20
20
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
21
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
22
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -28,14 +28,14 @@
28
28
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29
29
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
30
  * POSSIBILITY OF SUCH DAMAGE.
31
- */
31
+ */
32
32
 
33
33
  #ifndef __YAJL_COMMON_H__
34
34
  #define __YAJL_COMMON_H__
35
35
 
36
36
  #ifdef __cplusplus
37
37
  extern "C" {
38
- #endif
38
+ #endif
39
39
 
40
40
  #define YAJL_MAX_DEPTH 128
41
41
 
@@ -50,7 +50,7 @@ extern "C" {
50
50
  # endif
51
51
  #else
52
52
  # define YAJL_API
53
- #endif
53
+ #endif
54
54
 
55
55
  /** pointer to a malloc function, supporting client overriding memory
56
56
  * allocation routines */
@@ -80,6 +80,6 @@ typedef struct
80
80
 
81
81
  #ifdef __cplusplus
82
82
  }
83
- #endif
83
+ #endif
84
84
 
85
85
  #endif
data/ext/api/yajl_gen.h CHANGED
@@ -1,22 +1,22 @@
1
1
  /*
2
2
  * Copyright 2007-2009, Lloyd Hilaiel.
3
- *
3
+ *
4
4
  * Redistribution and use in source and binary forms, with or without
5
5
  * modification, are permitted provided that the following conditions are
6
6
  * met:
7
- *
7
+ *
8
8
  * 1. Redistributions of source code must retain the above copyright
9
9
  * notice, this list of conditions and the following disclaimer.
10
- *
10
+ *
11
11
  * 2. Redistributions in binary form must reproduce the above copyright
12
12
  * notice, this list of conditions and the following disclaimer in
13
13
  * the documentation and/or other materials provided with the
14
14
  * distribution.
15
- *
15
+ *
16
16
  * 3. Neither the name of Lloyd Hilaiel nor the names of its
17
17
  * contributors may be used to endorse or promote products derived
18
18
  * from this software without specific prior written permission.
19
- *
19
+ *
20
20
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
21
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
22
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -28,7 +28,7 @@
28
28
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29
29
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
30
  * POSSIBILITY OF SUCH DAMAGE.
31
- */
31
+ */
32
32
 
33
33
  /**
34
34
  * \file yajl_gen.h
@@ -42,7 +42,7 @@
42
42
 
43
43
  #ifdef __cplusplus
44
44
  extern "C" {
45
- #endif
45
+ #endif
46
46
  /** generator status codes */
47
47
  typedef enum {
48
48
  /** no error */
@@ -57,7 +57,7 @@ extern "C" {
57
57
  * state */
58
58
  yajl_gen_in_error_state,
59
59
  /** A complete JSON document has been generated */
60
- yajl_gen_generation_complete,
60
+ yajl_gen_generation_complete,
61
61
  /** yajl_gen_double was passed an invalid floating point value
62
62
  * (infinity or NaN). */
63
63
  yajl_gen_invalid_number,
@@ -119,7 +119,7 @@ extern "C" {
119
119
  const yajl_alloc_funcs * allocFuncs,
120
120
  void * ctx);
121
121
 
122
- /** free a generator handle */
122
+ /** free a generator handle */
123
123
  void YAJL_API yajl_gen_free(yajl_gen handle);
124
124
 
125
125
  yajl_gen_status YAJL_API yajl_gen_integer(yajl_gen hand, long int number);
@@ -154,6 +154,6 @@ extern "C" {
154
154
 
155
155
  #ifdef __cplusplus
156
156
  }
157
- #endif
157
+ #endif
158
158
 
159
159
  #endif
data/ext/api/yajl_parse.h CHANGED
@@ -1,22 +1,22 @@
1
1
  /*
2
2
  * Copyright 2007-2009, Lloyd Hilaiel.
3
- *
3
+ *
4
4
  * Redistribution and use in source and binary forms, with or without
5
5
  * modification, are permitted provided that the following conditions are
6
6
  * met:
7
- *
7
+ *
8
8
  * 1. Redistributions of source code must retain the above copyright
9
9
  * notice, this list of conditions and the following disclaimer.
10
- *
10
+ *
11
11
  * 2. Redistributions in binary form must reproduce the above copyright
12
12
  * notice, this list of conditions and the following disclaimer in
13
13
  * the documentation and/or other materials provided with the
14
14
  * distribution.
15
- *
15
+ *
16
16
  * 3. Neither the name of Lloyd Hilaiel nor the names of its
17
17
  * contributors may be used to endorse or promote products derived
18
18
  * from this software without specific prior written permission.
19
- *
19
+ *
20
20
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
21
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
22
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -28,7 +28,7 @@
28
28
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29
29
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
30
  * POSSIBILITY OF SUCH DAMAGE.
31
- */
31
+ */
32
32
 
33
33
  /**
34
34
  * \file yajl_parse.h
@@ -42,7 +42,7 @@
42
42
 
43
43
  #ifdef __cplusplus
44
44
  extern "C" {
45
- #endif
45
+ #endif
46
46
  /** error codes returned from this interface */
47
47
  typedef enum {
48
48
  /** no error was encountered */
@@ -103,12 +103,12 @@ extern "C" {
103
103
  int (* yajl_start_map)(void * ctx);
104
104
  int (* yajl_map_key)(void * ctx, const unsigned char * key,
105
105
  unsigned int stringLen);
106
- int (* yajl_end_map)(void * ctx);
106
+ int (* yajl_end_map)(void * ctx);
107
107
 
108
108
  int (* yajl_start_array)(void * ctx);
109
- int (* yajl_end_array)(void * ctx);
109
+ int (* yajl_end_array)(void * ctx);
110
110
  } yajl_callbacks;
111
-
111
+
112
112
  /** configuration structure for the generator */
113
113
  typedef struct {
114
114
  /** if nonzero, javascript style comments will be allowed in
@@ -131,11 +131,11 @@ extern "C" {
131
131
  const yajl_parser_config * config,
132
132
  const yajl_alloc_funcs * allocFuncs,
133
133
  void * ctx);
134
-
134
+
135
135
  /** allow resetting of the lexer without the need to realloc a new parser */
136
136
  void yajl_reset_parser(yajl_handle hand);
137
137
 
138
- /** free a parser handle */
138
+ /** free a parser handle */
139
139
  void YAJL_API yajl_free(yajl_handle handle);
140
140
 
141
141
  /** Parse some json!
@@ -157,7 +157,7 @@ extern "C" {
157
157
  * \param hand - a handle to the json parser allocated with yajl_alloc
158
158
  */
159
159
  yajl_status yajl_parse_complete(yajl_handle hand);
160
-
160
+
161
161
  /** get an error string describing the state of the
162
162
  * parse.
163
163
  *
@@ -166,7 +166,7 @@ extern "C" {
166
166
  * the specific char.
167
167
  *
168
168
  * A dynamically allocated string will be returned which should
169
- * be freed with yajl_free_error
169
+ * be freed with yajl_free_error
170
170
  */
171
171
  unsigned char * YAJL_API yajl_get_error(yajl_handle hand, int verbose,
172
172
  const unsigned char * jsonText,
@@ -177,6 +177,6 @@ extern "C" {
177
177
 
178
178
  #ifdef __cplusplus
179
179
  }
180
- #endif
180
+ #endif
181
181
 
182
182
  #endif
data/ext/yajl.c CHANGED
@@ -1,22 +1,22 @@
1
1
  /*
2
2
  * Copyright 2007-2009, Lloyd Hilaiel.
3
- *
3
+ *
4
4
  * Redistribution and use in source and binary forms, with or without
5
5
  * modification, are permitted provided that the following conditions are
6
6
  * met:
7
- *
7
+ *
8
8
  * 1. Redistributions of source code must retain the above copyright
9
9
  * notice, this list of conditions and the following disclaimer.
10
- *
10
+ *
11
11
  * 2. Redistributions in binary form must reproduce the above copyright
12
12
  * notice, this list of conditions and the following disclaimer in
13
13
  * the documentation and/or other materials provided with the
14
14
  * distribution.
15
- *
15
+ *
16
16
  * 3. Neither the name of Lloyd Hilaiel nor the names of its
17
17
  * contributors may be used to endorse or promote products derived
18
18
  * from this software without specific prior written permission.
19
- *
19
+ *
20
20
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
21
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
22
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -28,7 +28,7 @@
28
28
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29
29
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
30
  * POSSIBILITY OF SUCH DAMAGE.
31
- */
31
+ */
32
32
 
33
33
  #include "api/yajl_parse.h"
34
34
  #include "yajl_lex.h"
@@ -70,7 +70,7 @@ yajl_alloc(const yajl_callbacks * callbacks,
70
70
  unsigned int validateUTF8 = 0;
71
71
  yajl_handle hand = NULL;
72
72
  yajl_alloc_funcs afsBuffer;
73
-
73
+
74
74
  /* first order of business is to set up memory allocation routines */
75
75
  if (afs != NULL) {
76
76
  if (afs->malloc == NULL || afs->realloc == NULL || afs->free == NULL)
@@ -99,7 +99,7 @@ yajl_alloc(const yajl_callbacks * callbacks,
99
99
  hand->decodeBuf = yajl_buf_alloc(&(hand->alloc));
100
100
  yajl_bs_init(hand->stateStack, &(hand->alloc));
101
101
 
102
- yajl_bs_push(hand->stateStack, yajl_state_start);
102
+ yajl_bs_push(hand->stateStack, yajl_state_start);
103
103
 
104
104
  return hand;
105
105
  }
data/ext/yajl_alloc.c CHANGED
@@ -1,22 +1,22 @@
1
1
  /*
2
2
  * Copyright 2007-2009, Lloyd Hilaiel.
3
- *
3
+ *
4
4
  * Redistribution and use in source and binary forms, with or without
5
5
  * modification, are permitted provided that the following conditions are
6
6
  * met:
7
- *
7
+ *
8
8
  * 1. Redistributions of source code must retain the above copyright
9
9
  * notice, this list of conditions and the following disclaimer.
10
- *
10
+ *
11
11
  * 2. Redistributions in binary form must reproduce the above copyright
12
12
  * notice, this list of conditions and the following disclaimer in
13
13
  * the documentation and/or other materials provided with the
14
14
  * distribution.
15
- *
15
+ *
16
16
  * 3. Neither the name of Lloyd Hilaiel nor the names of its
17
17
  * contributors may be used to endorse or promote products derived
18
18
  * from this software without specific prior written permission.
19
- *
19
+ *
20
20
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
21
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
22
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -28,7 +28,7 @@
28
28
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29
29
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
30
  * POSSIBILITY OF SUCH DAMAGE.
31
- */
31
+ */
32
32
 
33
33
  /**
34
34
  * \file yajl_alloc.h
data/ext/yajl_alloc.h CHANGED
@@ -1,22 +1,22 @@
1
1
  /*
2
2
  * Copyright 2007-2009, Lloyd Hilaiel.
3
- *
3
+ *
4
4
  * Redistribution and use in source and binary forms, with or without
5
5
  * modification, are permitted provided that the following conditions are
6
6
  * met:
7
- *
7
+ *
8
8
  * 1. Redistributions of source code must retain the above copyright
9
9
  * notice, this list of conditions and the following disclaimer.
10
- *
10
+ *
11
11
  * 2. Redistributions in binary form must reproduce the above copyright
12
12
  * notice, this list of conditions and the following disclaimer in
13
13
  * the documentation and/or other materials provided with the
14
14
  * distribution.
15
- *
15
+ *
16
16
  * 3. Neither the name of Lloyd Hilaiel nor the names of its
17
17
  * contributors may be used to endorse or promote products derived
18
18
  * from this software without specific prior written permission.
19
- *
19
+ *
20
20
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
21
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
22
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -28,7 +28,7 @@
28
28
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29
29
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
30
  * POSSIBILITY OF SUCH DAMAGE.
31
- */
31
+ */
32
32
 
33
33
  /**
34
34
  * \file yajl_alloc.h
data/ext/yajl_buf.c CHANGED
@@ -1,22 +1,22 @@
1
1
  /*
2
2
  * Copyright 2007-2009, Lloyd Hilaiel.
3
- *
3
+ *
4
4
  * Redistribution and use in source and binary forms, with or without
5
5
  * modification, are permitted provided that the following conditions are
6
6
  * met:
7
- *
7
+ *
8
8
  * 1. Redistributions of source code must retain the above copyright
9
9
  * notice, this list of conditions and the following disclaimer.
10
- *
10
+ *
11
11
  * 2. Redistributions in binary form must reproduce the above copyright
12
12
  * notice, this list of conditions and the following disclaimer in
13
13
  * the documentation and/or other materials provided with the
14
14
  * distribution.
15
- *
15
+ *
16
16
  * 3. Neither the name of Lloyd Hilaiel nor the names of its
17
17
  * contributors may be used to endorse or promote products derived
18
18
  * from this software without specific prior written permission.
19
- *
19
+ *
20
20
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
21
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
22
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -28,7 +28,7 @@
28
28
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29
29
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
30
  * POSSIBILITY OF SUCH DAMAGE.
31
- */
31
+ */
32
32
 
33
33
  #include "yajl_buf.h"
34
34
 
@@ -49,7 +49,7 @@ static
49
49
  void yajl_buf_ensure_available(yajl_buf buf, unsigned int want)
50
50
  {
51
51
  unsigned int need;
52
-
52
+
53
53
  assert(buf != NULL);
54
54
 
55
55
  /* first call */
data/ext/yajl_buf.h CHANGED
@@ -1,22 +1,22 @@
1
1
  /*
2
2
  * Copyright 2007-2009, Lloyd Hilaiel.
3
- *
3
+ *
4
4
  * Redistribution and use in source and binary forms, with or without
5
5
  * modification, are permitted provided that the following conditions are
6
6
  * met:
7
- *
7
+ *
8
8
  * 1. Redistributions of source code must retain the above copyright
9
9
  * notice, this list of conditions and the following disclaimer.
10
- *
10
+ *
11
11
  * 2. Redistributions in binary form must reproduce the above copyright
12
12
  * notice, this list of conditions and the following disclaimer in
13
13
  * the documentation and/or other materials provided with the
14
14
  * distribution.
15
- *
15
+ *
16
16
  * 3. Neither the name of Lloyd Hilaiel nor the names of its
17
17
  * contributors may be used to endorse or promote products derived
18
18
  * from this software without specific prior written permission.
19
- *
19
+ *
20
20
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
21
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
22
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -28,7 +28,7 @@
28
28
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29
29
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
30
  * POSSIBILITY OF SUCH DAMAGE.
31
- */
31
+ */
32
32
 
33
33
  #ifndef __YAJL_BUF_H__
34
34
  #define __YAJL_BUF_H__
@@ -38,7 +38,7 @@
38
38
 
39
39
  /*
40
40
  * Implementation/performance notes. If this were moved to a header
41
- * only implementation using #define's where possible we might be
41
+ * only implementation using #define's where possible we might be
42
42
  * able to sqeeze a little performance out of the guy by killing function
43
43
  * call overhead. YMMV.
44
44
  */