yajl-ruby 1.4.2 → 1.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcd3ae6509fd5f45b1527644b221e2ec44e4f697ef0ef5d92399aee3567ad7a6
4
- data.tar.gz: 0045452d11da4b6b6fbcdf965fd94d0d43655245cb68fca518bfddc38513ad6c
3
+ metadata.gz: f45703d9d83ab3b6c69788dcce0cdc47e164ef2f851bd17015319615cdf83d97
4
+ data.tar.gz: 216b93aa9a440063db859182002047bb4ce02b5977ff154e01a9c4ddef4ca7c7
5
5
  SHA512:
6
- metadata.gz: 4cf495e84d645c644aa62233af8e0498da2b22fdf46f7071694df93af61d7b30785f2d0c1f73932979f92c5f94530427b018fb0bceb94ed5121de0c0fe792b15
7
- data.tar.gz: bbe72bfd0fd3d0c544557a0bbe7580b5ef33b893ce7df0ef01d40b653d0defdbce963091b9f21fe897082778a3587d9962c4fc10e41bb270c8d32706ef7478b1
6
+ metadata.gz: 2fb95eb9aca6bc05324a7f97d8d461aac96311ce159ab3b6d321ba89fcebe9147a2c2b678df17e7421dadadeea6f367c8d2ea7288211baeb49d74461d89cd7d5
7
+ data.tar.gz: 83d5d6f3264e5f678441465897f5a127d6ecf2aa260423b1f299a6339532aac4b2e7d128190ce09e9e05bb95d938d96e1d168fd272fc2f2317a18c9f826a46f0
@@ -1,26 +1,44 @@
1
1
  name: CI
2
2
 
3
- on: [push, pull_request]
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
4
11
 
5
12
  jobs:
6
13
  test:
14
+ name: Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
15
+ runs-on: ${{ matrix.os }}
16
+ continue-on-error: ${{ matrix.ruby == 'head' }}
7
17
  strategy:
8
- matrix:
9
- ruby_version: [2.6.x, 2.7.x, 3.0.x]
10
18
  fail-fast: false
11
- runs-on: ubuntu-latest
12
- name: Test on Ruby ${{ matrix.ruby_version }}
19
+ matrix:
20
+ os: [ubuntu-latest]
21
+ # 2.6 is the required_ruby_version floor in the gemspec; 3.3 and up are
22
+ # the versions Ruby core still maintains. Keep these quoted: YAML reads
23
+ # a bare 4.0 as the number 4, which selects the newest 4.x instead.
24
+ ruby: ['2.6', '3.3', '3.4', '4.0', head]
25
+ include:
26
+ - os: macos-latest
27
+ ruby: '4.0'
13
28
  steps:
14
- - uses: actions/checkout@v2
15
- - name: Setup Ruby ${{ matrix.ruby_version }}
16
- uses: actions/setup-ruby@v1
17
- with:
18
- ruby-version: ${{ matrix.ruby_version }}
19
- - name: Install dependencies
20
- run: bundle install
21
- - name: Build gem
22
- run: gem build yajl-ruby.gemspec
23
- - name: Install gem
24
- run: gem install yajl-ruby
25
- - name: Run tests
26
- run: bundle exec rake spec
29
+ - uses: actions/checkout@v7
30
+ - name: Set up Ruby ${{ matrix.ruby }}
31
+ uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: ${{ matrix.ruby }}
34
+ bundler-cache: true
35
+ - name: Run tests
36
+ run: bundle exec rake spec
37
+ - name: Build and install gem
38
+ run: |
39
+ gem build yajl-ruby.gemspec
40
+ gem install --local --no-document yajl-ruby-*.gem
41
+ - name: Smoke test installed gem
42
+ working-directory: ${{ runner.temp }}
43
+ run: |
44
+ ruby -ryajl -e 'raise "round trip failed" unless Yajl::Parser.parse(Yajl::Encoder.encode({"a" => 1})) == {"a" => 1}'
data/ext/yajl/yajl_buf.c CHANGED
@@ -116,10 +116,10 @@ yajl_buf_state yajl_buf_ensure_available(yajl_buf buf, unsigned int want)
116
116
 
117
117
  need = buf->len;
118
118
 
119
- while (want >= (need - buf->used)) need <<= 1;
119
+ while (want >= (need - buf->used) && need > 0) need <<= 1;
120
120
 
121
121
  // Check for overflow
122
- if (need < buf->used) {
122
+ if (need < buf->used || need == 0) {
123
123
  return yajl_buf_set_error(buf, yajl_buf_overflow);
124
124
  }
125
125
 
data/ext/yajl/yajl_ext.c CHANGED
@@ -159,6 +159,14 @@ static void yajl_encoder_wrapper_mark(void * wrapper) {
159
159
  }
160
160
  }
161
161
 
162
+ static const rb_data_type_t yajl_encoder_wrapper_type = {
163
+ "YAJL::Encoder",
164
+ {
165
+ yajl_encoder_wrapper_mark,
166
+ yajl_encoder_wrapper_free,
167
+ }
168
+ };
169
+
162
170
  static VALUE yajl_key_to_string(VALUE obj) {
163
171
  switch (TYPE(obj)) {
164
172
  case T_STRING:
@@ -309,6 +317,14 @@ void yajl_parser_wrapper_mark(void * wrapper) {
309
317
  }
310
318
  }
311
319
 
320
+ static const rb_data_type_t yajl_parser_wrapper_type = {
321
+ "YAJL::Parser",
322
+ {
323
+ yajl_parser_wrapper_mark,
324
+ yajl_parser_wrapper_free,
325
+ }
326
+ };
327
+
312
328
  void yajl_parse_chunk(const unsigned char * chunk, unsigned int len, yajl_handle parser) {
313
329
  yajl_status stat;
314
330
 
@@ -486,7 +502,7 @@ static VALUE rb_yajl_parser_new(int argc, VALUE * argv, VALUE klass) {
486
502
  }
487
503
  cfg = (yajl_parser_config){allowComments, checkUTF8};
488
504
 
489
- obj = Data_Make_Struct(klass, yajl_parser_wrapper, yajl_parser_wrapper_mark, yajl_parser_wrapper_free, wrapper);
505
+ obj = TypedData_Make_Struct(klass, yajl_parser_wrapper, &yajl_parser_wrapper_type, wrapper);
490
506
  wrapper->parser = yajl_alloc(&callbacks, &cfg, &rb_alloc_funcs, (void *)obj);
491
507
  wrapper->nestedArrayLevel = 0;
492
508
  wrapper->nestedHashLevel = 0;
@@ -1089,7 +1105,7 @@ static VALUE rb_yajl_encoder_new(int argc, VALUE * argv, VALUE klass) {
1089
1105
  }
1090
1106
  cfg = (yajl_gen_config){beautify, (const char *)indentString, htmlSafe};
1091
1107
 
1092
- obj = Data_Make_Struct(klass, yajl_encoder_wrapper, yajl_encoder_wrapper_mark, yajl_encoder_wrapper_free, wrapper);
1108
+ obj = TypedData_Make_Struct(klass, yajl_encoder_wrapper, &yajl_encoder_wrapper_type, wrapper);
1093
1109
  wrapper->indentString = actualIndent;
1094
1110
  wrapper->encoder = yajl_gen_alloc(&cfg, &rb_alloc_funcs);
1095
1111
  wrapper->on_progress_callback = Qnil;
@@ -1379,6 +1395,7 @@ void Init_yajl() {
1379
1395
  cStandardError = rb_const_get(rb_cObject, rb_intern("StandardError"));
1380
1396
 
1381
1397
  cParser = rb_define_class_under(mYajl, "Parser", rb_cObject);
1398
+ rb_undef_alloc_func(cParser);
1382
1399
  rb_define_singleton_method(cParser, "new", rb_yajl_parser_new, -1);
1383
1400
  rb_define_method(cParser, "initialize", rb_yajl_parser_init, -1);
1384
1401
  rb_define_method(cParser, "parse", rb_yajl_parser_parse, -1);
@@ -1390,6 +1407,7 @@ void Init_yajl() {
1390
1407
  rb_define_method(cProjector, "project", rb_yajl_projector_project, 1);
1391
1408
 
1392
1409
  cEncoder = rb_define_class_under(mYajl, "Encoder", rb_cObject);
1410
+ rb_undef_alloc_func(cEncoder);
1393
1411
  rb_define_singleton_method(cEncoder, "new", rb_yajl_encoder_new, -1);
1394
1412
  rb_define_method(cEncoder, "initialize", rb_yajl_encoder_init, -1);
1395
1413
  rb_define_method(cEncoder, "encode", rb_yajl_encoder_encode, -1);
data/ext/yajl/yajl_ext.h CHANGED
@@ -58,8 +58,10 @@ static ID intern_io_read, intern_call, intern_keys, intern_to_s,
58
58
  intern_to_json, intern_has_key, intern_to_sym, intern_as_json;
59
59
  static ID sym_allow_comments, sym_check_utf8, sym_pretty, sym_indent, sym_terminator, sym_symbolize_keys, sym_symbolize_names, sym_html_safe, sym_entities;
60
60
 
61
- #define GetParser(obj, sval) Data_Get_Struct(obj, yajl_parser_wrapper, sval);
62
- #define GetEncoder(obj, sval) Data_Get_Struct(obj, yajl_encoder_wrapper, sval);
61
+ static const rb_data_type_t yajl_parser_wrapper_type, yajl_encoder_wrapper_type;
62
+
63
+ #define GetParser(obj, sval) TypedData_Get_Struct(obj, yajl_parser_wrapper, &yajl_parser_wrapper_type, sval)
64
+ #define GetEncoder(obj, sval) TypedData_Get_Struct(obj, yajl_encoder_wrapper, &yajl_encoder_wrapper_type, sval)
63
65
 
64
66
  static void yajl_check_and_fire_callback(void * ctx);
65
67
  static void yajl_set_static_value(void * ctx, VALUE val);
data/lib/yajl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yajl
2
- VERSION = '1.4.2'
2
+ VERSION = '1.4.4'
3
3
  end
data/yajl-ruby.gemspec CHANGED
@@ -5,15 +5,12 @@ Gem::Specification.new do |s|
5
5
  s.version = Yajl::VERSION
6
6
  s.license = "MIT"
7
7
  s.authors = ["Brian Lopez", "Lloyd Hilaiel"]
8
- s.date = Time.now.utc.strftime("%Y-%m-%d")
9
8
  s.email = %q{seniorlopez@gmail.com}
10
9
  s.extensions = ["ext/yajl/extconf.rb"]
11
10
  s.files = `git ls-files`.split("\n")
12
- s.homepage = %q{http://github.com/brianmario/yajl-ruby}
11
+ s.homepage = %q{https://github.com/brianmario/yajl-ruby}
13
12
  s.require_paths = ["lib"]
14
- s.rubygems_version = %q{1.4.2}
15
13
  s.summary = %q{Ruby C bindings to the excellent Yajl JSON stream-based parser library.}
16
- s.test_files = `git ls-files spec examples`.split("\n")
17
14
  s.required_ruby_version = ">= 2.6.0"
18
15
 
19
16
  # tests
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yajl-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Lopez
8
8
  - Lloyd Hilaiel
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2022-04-04 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake-compiler
@@ -81,14 +80,12 @@ dependencies:
81
80
  - - ">="
82
81
  - !ruby/object:Gem::Version
83
82
  version: '0'
84
- description:
85
83
  email: seniorlopez@gmail.com
86
84
  executables: []
87
85
  extensions:
88
86
  - ext/yajl/extconf.rb
89
87
  extra_rdoc_files: []
90
88
  files:
91
- - ".codeclimate.yml"
92
89
  - ".github/workflows/ci.yml"
93
90
  - ".gitignore"
94
91
  - ".rspec"
@@ -242,11 +239,10 @@ files:
242
239
  - tasks/compile.rake
243
240
  - tasks/rspec.rake
244
241
  - yajl-ruby.gemspec
245
- homepage: http://github.com/brianmario/yajl-ruby
242
+ homepage: https://github.com/brianmario/yajl-ruby
246
243
  licenses:
247
244
  - MIT
248
245
  metadata: {}
249
- post_install_message:
250
246
  rdoc_options: []
251
247
  require_paths:
252
248
  - lib
@@ -261,98 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
257
  - !ruby/object:Gem::Version
262
258
  version: '0'
263
259
  requirements: []
264
- rubygems_version: 3.3.3
265
- signing_key:
260
+ rubygems_version: 4.0.20
266
261
  specification_version: 4
267
262
  summary: Ruby C bindings to the excellent Yajl JSON stream-based parser library.
268
- test_files:
269
- - examples/encoding/chunked_encoding.rb
270
- - examples/encoding/one_shot.rb
271
- - examples/encoding/to_an_io.rb
272
- - examples/http/twitter_search_api.rb
273
- - examples/http/twitter_stream_api.rb
274
- - examples/parsing/from_file.rb
275
- - examples/parsing/from_stdin.rb
276
- - examples/parsing/from_string.rb
277
- - spec/encoding/encoding_spec.rb
278
- - spec/global/global_spec.rb
279
- - spec/http/fixtures/http.bzip2.dump
280
- - spec/http/fixtures/http.chunked.dump
281
- - spec/http/fixtures/http.deflate.dump
282
- - spec/http/fixtures/http.error.dump
283
- - spec/http/fixtures/http.gzip.dump
284
- - spec/http/fixtures/http.html.dump
285
- - spec/http/fixtures/http.raw.dump
286
- - spec/http/http_delete_spec.rb
287
- - spec/http/http_error_spec.rb
288
- - spec/http/http_get_spec.rb
289
- - spec/http/http_post_spec.rb
290
- - spec/http/http_put_spec.rb
291
- - spec/http/http_stream_options_spec.rb
292
- - spec/json_gem_compatibility/compatibility_spec.rb
293
- - spec/parsing/active_support_spec.rb
294
- - spec/parsing/chunked_spec.rb
295
- - spec/parsing/fixtures/fail.15.json
296
- - spec/parsing/fixtures/fail.16.json
297
- - spec/parsing/fixtures/fail.17.json
298
- - spec/parsing/fixtures/fail.26.json
299
- - spec/parsing/fixtures/fail11.json
300
- - spec/parsing/fixtures/fail12.json
301
- - spec/parsing/fixtures/fail13.json
302
- - spec/parsing/fixtures/fail14.json
303
- - spec/parsing/fixtures/fail19.json
304
- - spec/parsing/fixtures/fail20.json
305
- - spec/parsing/fixtures/fail21.json
306
- - spec/parsing/fixtures/fail22.json
307
- - spec/parsing/fixtures/fail23.json
308
- - spec/parsing/fixtures/fail24.json
309
- - spec/parsing/fixtures/fail25.json
310
- - spec/parsing/fixtures/fail27.json
311
- - spec/parsing/fixtures/fail28.json
312
- - spec/parsing/fixtures/fail3.json
313
- - spec/parsing/fixtures/fail4.json
314
- - spec/parsing/fixtures/fail5.json
315
- - spec/parsing/fixtures/fail6.json
316
- - spec/parsing/fixtures/fail9.json
317
- - spec/parsing/fixtures/pass.array.json
318
- - spec/parsing/fixtures/pass.codepoints_from_unicode_org.json
319
- - spec/parsing/fixtures/pass.contacts.json
320
- - spec/parsing/fixtures/pass.db100.xml.json
321
- - spec/parsing/fixtures/pass.db1000.xml.json
322
- - spec/parsing/fixtures/pass.dc_simple_with_comments.json
323
- - spec/parsing/fixtures/pass.deep_arrays.json
324
- - spec/parsing/fixtures/pass.difficult_json_c_test_case.json
325
- - spec/parsing/fixtures/pass.difficult_json_c_test_case_with_comments.json
326
- - spec/parsing/fixtures/pass.doubles.json
327
- - spec/parsing/fixtures/pass.empty_array.json
328
- - spec/parsing/fixtures/pass.empty_string.json
329
- - spec/parsing/fixtures/pass.escaped_bulgarian.json
330
- - spec/parsing/fixtures/pass.escaped_foobar.json
331
- - spec/parsing/fixtures/pass.item.json
332
- - spec/parsing/fixtures/pass.json-org-sample1.json
333
- - spec/parsing/fixtures/pass.json-org-sample2.json
334
- - spec/parsing/fixtures/pass.json-org-sample3.json
335
- - spec/parsing/fixtures/pass.json-org-sample4-nows.json
336
- - spec/parsing/fixtures/pass.json-org-sample4.json
337
- - spec/parsing/fixtures/pass.json-org-sample5.json
338
- - spec/parsing/fixtures/pass.map-spain.xml.json
339
- - spec/parsing/fixtures/pass.ns-invoice100.xml.json
340
- - spec/parsing/fixtures/pass.ns-soap.xml.json
341
- - spec/parsing/fixtures/pass.numbers-fp-4k.json
342
- - spec/parsing/fixtures/pass.numbers-fp-64k.json
343
- - spec/parsing/fixtures/pass.numbers-int-4k.json
344
- - spec/parsing/fixtures/pass.numbers-int-64k.json
345
- - spec/parsing/fixtures/pass.twitter-search.json
346
- - spec/parsing/fixtures/pass.twitter-search2.json
347
- - spec/parsing/fixtures/pass.unicode.json
348
- - spec/parsing/fixtures/pass.yelp.json
349
- - spec/parsing/fixtures/pass1.json
350
- - spec/parsing/fixtures/pass2.json
351
- - spec/parsing/fixtures/pass3.json
352
- - spec/parsing/fixtures_spec.rb
353
- - spec/parsing/large_number_spec.rb
354
- - spec/parsing/one_off_spec.rb
355
- - spec/projection/project_file.rb
356
- - spec/projection/projection.rb
357
- - spec/rcov.opts
358
- - spec/spec_helper.rb
263
+ test_files: []
data/.codeclimate.yml DELETED
@@ -1,40 +0,0 @@
1
- # This is a sample .codeclimate.yml configured for Engine analysis on Code
2
- # Climate Platform. For an overview of the Code Climate Platform, see here:
3
- # http://docs.codeclimate.com/article/300-the-codeclimate-platform
4
-
5
- # Under the engines key, you can configure which engines will analyze your repo.
6
- # Each key is an engine name. For each value, you need to specify enabled: true
7
- # to enable the engine as well as any other engines-specific configuration.
8
-
9
- # For more details, see here:
10
- # http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform
11
-
12
- # For a list of all available engines, see here:
13
- # http://docs.codeclimate.com/article/296-engines-available-engines
14
-
15
- engines:
16
- # to turn on an engine, add it here and set enabled to `true`
17
- # to turn off an engine, set enabled to `false` or remove it
18
- rubocop:
19
- enabled: true
20
-
21
- # Engines can analyze files and report issues on them, but you can separately
22
- # decide which files will receive ratings based on those issues. This is
23
- # specified by path patterns under the ratings key.
24
-
25
- # For more details see here:
26
- # http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform
27
-
28
- # Note: If the ratings key is not specified, this will result in a 0.0 GPA on your dashboard.
29
-
30
- ratings:
31
- paths:
32
- - ext/**
33
- - lib/**
34
-
35
- # You can globally exclude files from being analyzed by any engine using the
36
- # exclude_paths key.
37
-
38
- #exclude_paths:
39
- #- spec/**/*
40
- #- vendor/**/*