yajl-ruby 1.0.0 → 1.1.0

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/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - rbx
6
+ - ree
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0 (November 9th, 2011)
4
+ * fix compilation due to a "bug" in gcc-llvm on 10.7.2
5
+ * fix gemspec so ruby 1.8.6 or later is required
6
+ *
7
+
3
8
  ## 1.0.0 (September 13th, 2011)
4
9
  * add deprecation notice for Yajl's Bzip2 support
5
10
  * add deprecation notice for Yajl's Deflate support
@@ -324,4 +329,4 @@
324
329
  * updated gemspec and README
325
330
 
326
331
  ## 0.1.0 (April 21st, 2009)
327
- * initial release - gemified
332
+ * initial release - gemified
data/README.md CHANGED
@@ -224,7 +224,7 @@ str = Yajl::Encoder.encode(obj)
224
224
 
225
225
  You can also use `Yajl::Bzip2::StreamWriter` and `Yajl::Deflate::StreamWriter`. So you can pick whichever fits your CPU/bandwidth sweet-spot.
226
226
 
227
- === HTML Safety
227
+ ### HTML Safety
228
228
 
229
229
  If you plan on embedding the output from the encoder in the DOM, you'll want to make sure you use the html_safe option on the encoder. This will escape all '/' characters to ensure no closing tags can be injected, preventing XSS.
230
230
 
@@ -236,7 +236,7 @@ Meaning the following should be perfectly safe:
236
236
  </script>
237
237
  ```
238
238
 
239
- == JSON gem Compatibility API
239
+ ## JSON gem Compatibility API
240
240
 
241
241
  The JSON gem compatibility API isn't enabled by default. You have to explicitly require it like so:
242
242
 
data/ext/yajl/yajl_ext.c CHANGED
@@ -33,7 +33,7 @@
33
33
  return rb_yajl_encoder_encode(1, &self, rb_encoder); \
34
34
 
35
35
  /* Helpers for building objects */
36
- inline void yajl_check_and_fire_callback(void * ctx) {
36
+ static void yajl_check_and_fire_callback(void * ctx) {
37
37
  yajl_parser_wrapper * wrapper;
38
38
  GetParser((VALUE)ctx, wrapper);
39
39
 
@@ -54,7 +54,7 @@ inline void yajl_check_and_fire_callback(void * ctx) {
54
54
  }
55
55
  }
56
56
 
57
- inline void yajl_set_static_value(void * ctx, VALUE val) {
57
+ static void yajl_set_static_value(void * ctx, VALUE val) {
58
58
  yajl_parser_wrapper * wrapper;
59
59
  VALUE lastEntry, hash;
60
60
  int len;
data/ext/yajl/yajl_ext.h CHANGED
@@ -61,8 +61,8 @@ static ID sym_allow_comments, sym_check_utf8, sym_pretty, sym_indent, sym_termin
61
61
  #define GetParser(obj, sval) (sval = (yajl_parser_wrapper*)DATA_PTR(obj));
62
62
  #define GetEncoder(obj, sval) (sval = (yajl_encoder_wrapper*)DATA_PTR(obj));
63
63
 
64
- inline void yajl_check_and_fire_callback(void * ctx);
65
- inline void yajl_set_static_value(void * ctx, VALUE val);
64
+ static void yajl_check_and_fire_callback(void * ctx);
65
+ static void yajl_set_static_value(void * ctx, VALUE val);
66
66
  void yajl_encode_part(void * wrapper, VALUE obj, VALUE io);
67
67
  void yajl_parse_chunk(const unsigned char * chunk, unsigned int len, yajl_handle parser);
68
68
 
data/lib/yajl/json_gem.rb CHANGED
@@ -1,5 +1,3 @@
1
- puts "DEPRECATION WARNING: Yajl's JSON gem compatibility API is going to be removed in 2.0"
2
-
3
1
  require 'yajl' unless defined?(Yajl::Parser)
4
2
  require 'yajl/json_gem/parsing'
5
3
  require 'yajl/json_gem/encoding'
@@ -12,4 +10,4 @@ module ::Kernel
12
10
  JSON.generate(object, opts)
13
11
  end
14
12
  end
15
- end
13
+ end
data/lib/yajl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yajl
2
- VERSION = '1.0.0'
3
- end
2
+ VERSION = '1.1.0'
3
+ end
@@ -9,13 +9,13 @@ end
9
9
 
10
10
  class TheMindKiller
11
11
  def to_json
12
- @wait_i_dont_exist_this_is_a_horrible_mistake_dont_do_it_aiiiiiiiiieeeeeee
12
+ nil
13
13
  end
14
14
  end
15
15
 
16
16
  class TheMindKillerDuce
17
17
  def to_s
18
- @wait_i_dont_exist_this_is_a_horrible_mistake_dont_do_it_aiiiiiiiiieeeeeee
18
+ nil
19
19
  end
20
20
  end
21
21
 
@@ -265,6 +265,9 @@ describe "Yajl JSON encoder" do
265
265
 
266
266
  it "return value of #to_s must be a string" do
267
267
  lambda {
268
+ if TheMindKillerDuce.send(:method_defined?, :to_json)
269
+ TheMindKillerDuce.send(:undef_method, :to_json)
270
+ end
268
271
  Yajl::Encoder.encode(TheMindKillerDuce.new)
269
272
  }.should raise_error(TypeError)
270
273
  end
data/yajl-ruby.gemspec CHANGED
@@ -13,6 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.rubygems_version = %q{1.4.2}
14
14
  s.summary = %q{Ruby C bindings to the excellent Yajl JSON stream-based parser library.}
15
15
  s.test_files = `git ls-files spec examples`.split("\n")
16
+ s.required_ruby_version = ">= 1.8.6"
16
17
 
17
18
  # tests
18
19
  s.add_development_dependency 'rake-compiler', ">= 0.7.5"
metadata CHANGED
@@ -1,71 +1,96 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: yajl-ruby
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 19
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 0
10
+ version: 1.1.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Brian Lopez
9
14
  - Lloyd Hilaiel
10
15
  autorequire:
11
16
  bindir: bin
12
17
  cert_chain: []
13
- date: 2011-09-16 00:00:00.000000000 -07:00
18
+
19
+ date: 2011-11-09 00:00:00 -08:00
14
20
  default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
17
23
  name: rake-compiler
18
- requirement: &70167590495720 !ruby/object:Gem::Requirement
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
19
26
  none: false
20
- requirements:
21
- - - ! '>='
22
- - !ruby/object:Gem::Version
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 9
31
+ segments:
32
+ - 0
33
+ - 7
34
+ - 5
23
35
  version: 0.7.5
24
36
  type: :development
25
- prerelease: false
26
- version_requirements: *70167590495720
27
- - !ruby/object:Gem::Dependency
37
+ version_requirements: *id001
38
+ - !ruby/object:Gem::Dependency
28
39
  name: rspec
29
- requirement: &70167590495220 !ruby/object:Gem::Requirement
40
+ prerelease: false
41
+ requirement: &id002 !ruby/object:Gem::Requirement
30
42
  none: false
31
- requirements:
32
- - - ! '>='
33
- - !ruby/object:Gem::Version
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ hash: 15
47
+ segments:
48
+ - 2
49
+ - 0
50
+ - 0
34
51
  version: 2.0.0
35
52
  type: :development
36
- prerelease: false
37
- version_requirements: *70167590495220
38
- - !ruby/object:Gem::Dependency
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
39
55
  name: activesupport
40
- requirement: &70167590494840 !ruby/object:Gem::Requirement
56
+ prerelease: false
57
+ requirement: &id003 !ruby/object:Gem::Requirement
41
58
  none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ hash: 3
63
+ segments:
64
+ - 0
65
+ version: "0"
46
66
  type: :development
47
- prerelease: false
48
- version_requirements: *70167590494840
49
- - !ruby/object:Gem::Dependency
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
50
69
  name: json
51
- requirement: &70167590494380 !ruby/object:Gem::Requirement
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
52
72
  none: false
53
- requirements:
54
- - - ! '>='
55
- - !ruby/object:Gem::Version
56
- version: '0'
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 3
77
+ segments:
78
+ - 0
79
+ version: "0"
57
80
  type: :development
58
- prerelease: false
59
- version_requirements: *70167590494380
81
+ version_requirements: *id004
60
82
  description:
61
83
  email: seniorlopez@gmail.com
62
84
  executables: []
63
- extensions:
85
+
86
+ extensions:
64
87
  - ext/yajl/extconf.rb
65
88
  extra_rdoc_files: []
66
- files:
89
+
90
+ files:
67
91
  - .gitignore
68
92
  - .rspec
93
+ - .travis.yml
69
94
  - CHANGELOG.md
70
95
  - Gemfile
71
96
  - MIT-LICENSE
@@ -215,29 +240,40 @@ files:
215
240
  has_rdoc: true
216
241
  homepage: http://github.com/brianmario/yajl-ruby
217
242
  licenses: []
243
+
218
244
  post_install_message:
219
245
  rdoc_options: []
220
- require_paths:
246
+
247
+ require_paths:
221
248
  - lib
222
- required_ruby_version: !ruby/object:Gem::Requirement
249
+ required_ruby_version: !ruby/object:Gem::Requirement
223
250
  none: false
224
- requirements:
225
- - - ! '>='
226
- - !ruby/object:Gem::Version
227
- version: '0'
228
- required_rubygems_version: !ruby/object:Gem::Requirement
251
+ requirements:
252
+ - - ">="
253
+ - !ruby/object:Gem::Version
254
+ hash: 59
255
+ segments:
256
+ - 1
257
+ - 8
258
+ - 6
259
+ version: 1.8.6
260
+ required_rubygems_version: !ruby/object:Gem::Requirement
229
261
  none: false
230
- requirements:
231
- - - ! '>='
232
- - !ruby/object:Gem::Version
233
- version: '0'
262
+ requirements:
263
+ - - ">="
264
+ - !ruby/object:Gem::Version
265
+ hash: 3
266
+ segments:
267
+ - 0
268
+ version: "0"
234
269
  requirements: []
270
+
235
271
  rubyforge_project:
236
272
  rubygems_version: 1.6.2
237
273
  signing_key:
238
274
  specification_version: 3
239
275
  summary: Ruby C bindings to the excellent Yajl JSON stream-based parser library.
240
- test_files:
276
+ test_files:
241
277
  - examples/encoding/chunked_encoding.rb
242
278
  - examples/encoding/one_shot.rb
243
279
  - examples/encoding/to_an_io.rb