ffi-yajl 3.0.0 → 3.0.1
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 +4 -4
- data/LICENSE +0 -1
- data/README.md +9 -8
- data/ext/ffi_yajl/ext/encoder/encoder.c +1 -0
- data/ext/ffi_yajl/ext/encoder/extconf.rb +1 -1
- data/ext/ffi_yajl/ext/parser/extconf.rb +1 -1
- data/lib/ffi_yajl/benchmark.rb +6 -6
- data/lib/ffi_yajl/encoder.rb +3 -2
- data/lib/ffi_yajl/ext.rb +1 -1
- data/lib/ffi_yajl/ffi/encoder.rb +1 -1
- data/lib/ffi_yajl/ffi/parser.rb +1 -1
- data/lib/ffi_yajl/ffi.rb +1 -1
- data/lib/ffi_yajl/map_library_name.rb +12 -12
- data/lib/ffi_yajl/parser.rb +2 -1
- data/lib/ffi_yajl/platform.rb +1 -1
- data/lib/ffi_yajl/version.rb +2 -2
- data/lib/ffi_yajl.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 69f67b1a3f3d9b942addeddde3e5b06171a7099ec0e4627a5e122bb2616c911f
|
|
4
|
+
data.tar.gz: 99282786784721f7c66c4242fe384f9ebd936151edff6d71febc20dee5fc63a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e648895c1d8a1605984e14048ad5b2c9a5c3f57520d55691ec056663e8f8b73a39d0e7bac6f31a56e214ac5ae633b2e0859fed246992177754d29cba89fa557
|
|
7
|
+
data.tar.gz: '093cdf78cfaf2c96f74528b40a7020ab28e0c610a4b97de15808f9f28ade99ed18ff354b13ed8abef535717c0f9e2f71c7d1970ab5a0db46a7734da458ef8933'
|
data/LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://buildkite.com/chef-oss/chef-ffi-yajl-master-verify) [](https://badge.fury.io/rb/ffi-yajl)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
**Project State**: [Active](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md#active)
|
|
5
|
+
ffi-yajl is a Ruby adapter for the [yajl](http://lloyd.github.io/yajl/) JSON parser/generator library. ffi-yajl supports multiple Ruby C extension mechanisms, including both MRI native extensions and FFI in order to be compatible with as many Ruby implementations as possible while providing good performance where possible.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
## How to Install
|
|
10
8
|
|
|
11
|
-
**
|
|
9
|
+
**Warning** if building through Omnibus, a preinstalled ffi-yajl and libyajl2-gem version not matching the bundled version of the project you're attempting to build (e.g., Chef) may cause:
|
|
12
10
|
|
|
11
|
+
`cannot find -lyajldll: No such file or directory`
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
If your build script ends up up in this state, a short term fix is `gem uninstall -I libyajl2` before the failing `bundle install`
|
|
15
14
|
|
|
16
|
-
## How to Install
|
|
17
15
|
|
|
18
|
-
Install from the command-line:
|
|
16
|
+
### Install from the command-line:
|
|
19
17
|
|
|
20
18
|
```
|
|
21
19
|
gem install ffi-yajl
|
|
@@ -109,3 +107,6 @@ This was initially going to be a clean rewrite of an ffi ruby wrapper around yaj
|
|
|
109
107
|
## License
|
|
110
108
|
|
|
111
109
|
Given that this draws heavily from the yajl-ruby sources, and could be considered a derivative work, the MIT License from that project has been preserved and this source code has deliberately not been dual licensed under Chef's typical Apache License. See the [LICENSE](https://github.com/chef/ffi-yajl/blob/master/LICENSE) file in this project.
|
|
110
|
+
|
|
111
|
+
# Copyright
|
|
112
|
+
See [COPYRIGHT.md](./COPYRIGHT.md).
|
|
@@ -360,6 +360,7 @@ void Init_encoder() {
|
|
|
360
360
|
mExt = rb_define_module_under(mFFI_Yajl, "Ext");
|
|
361
361
|
mEncoder = rb_define_module_under(mExt, "Encoder");
|
|
362
362
|
cYajl_Gen = rb_define_class_under(mEncoder, "YajlGen", rb_cObject);
|
|
363
|
+
rb_undef_alloc_func(cYajl_Gen);
|
|
363
364
|
rb_define_method(mEncoder, "do_yajl_encode", mEncoder_do_yajl_encode, 3);
|
|
364
365
|
|
|
365
366
|
/* use rb_const_get instead of rb_define_class so that we don't get superclass mismatches */
|
|
@@ -41,7 +41,7 @@ end
|
|
|
41
41
|
# this flag by default in DLDFLAGS. Let's specify the list of dynamic symbols
|
|
42
42
|
# here to avoid compilation failures.
|
|
43
43
|
if clang? && macos?
|
|
44
|
-
symfile = File.join(__dir__,
|
|
44
|
+
symfile = File.join(__dir__, "../dlopen/yajl.sym")
|
|
45
45
|
dynamic_symbols = File.readlines(symfile)
|
|
46
46
|
dynamic_symbols.each do |sym|
|
|
47
47
|
$DLDFLAGS << " -Wl,-U,#{sym.strip}"
|
|
@@ -41,7 +41,7 @@ end
|
|
|
41
41
|
# this flag by default in DLDFLAGS. Let's specify the list of dynamic symbols
|
|
42
42
|
# here to avoid compilation failures.
|
|
43
43
|
if clang? && macos?
|
|
44
|
-
symfile = File.join(__dir__,
|
|
44
|
+
symfile = File.join(__dir__, "../dlopen/yajl.sym")
|
|
45
45
|
dynamic_symbols = File.readlines(symfile)
|
|
46
46
|
dynamic_symbols.each do |sym|
|
|
47
47
|
$DLDFLAGS << " -Wl,-U,#{sym.strip}"
|
data/lib/ffi_yajl/benchmark.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
|
|
23
|
-
require "ffi_yajl/benchmark/encode
|
|
24
|
-
require "ffi_yajl/benchmark/encode_profile
|
|
25
|
-
require "ffi_yajl/benchmark/parse
|
|
26
|
-
require "ffi_yajl/benchmark/parse_profile
|
|
27
|
-
require "ffi_yajl/benchmark/parse_profile_ruby_prof
|
|
23
|
+
require "ffi_yajl/benchmark/encode"
|
|
24
|
+
require "ffi_yajl/benchmark/encode_profile"
|
|
25
|
+
require "ffi_yajl/benchmark/parse"
|
|
26
|
+
require "ffi_yajl/benchmark/parse_profile"
|
|
27
|
+
require "ffi_yajl/benchmark/parse_profile_ruby_prof"
|
data/lib/ffi_yajl/encoder.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
module FFI_Yajl
|
|
24
24
|
class EncodeError < StandardError; end
|
|
25
|
+
|
|
25
26
|
class Encoder
|
|
26
27
|
attr_accessor :opts
|
|
27
28
|
|
|
@@ -35,7 +36,7 @@ module FFI_Yajl
|
|
|
35
36
|
|
|
36
37
|
if opts[:pretty]
|
|
37
38
|
yajl_gen_opts[:yajl_gen_beautify] = true
|
|
38
|
-
yajl_gen_opts[:yajl_gen_indent_string] = opts[:indent]
|
|
39
|
+
yajl_gen_opts[:yajl_gen_indent_string] = opts[:indent] || " "
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
# call either the ext or ffi hook
|
data/lib/ffi_yajl/ext.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
data/lib/ffi_yajl/ffi/encoder.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
data/lib/ffi_yajl/ffi/parser.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
data/lib/ffi_yajl/ffi.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
|
@@ -79,12 +79,12 @@ module FFI_Yajl
|
|
|
79
79
|
def dlopen_yajl_library
|
|
80
80
|
found = false
|
|
81
81
|
( expanded_library_names + library_names ).each do |libname|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
|
|
83
|
+
dlopen(libname)
|
|
84
|
+
found = true
|
|
85
|
+
break
|
|
86
|
+
rescue ArgumentError
|
|
87
|
+
|
|
88
88
|
end
|
|
89
89
|
raise "cannot find yajl library for platform" unless found
|
|
90
90
|
end
|
|
@@ -97,11 +97,11 @@ module FFI_Yajl
|
|
|
97
97
|
def ffi_open_yajl_library
|
|
98
98
|
found = false
|
|
99
99
|
expanded_library_names.each do |libname|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
|
|
101
|
+
ffi_lib libname
|
|
102
|
+
found = true
|
|
103
|
+
rescue LoadError
|
|
104
|
+
|
|
105
105
|
end
|
|
106
106
|
ffi_lib "yajl" unless found
|
|
107
107
|
end
|
data/lib/ffi_yajl/parser.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
module FFI_Yajl
|
|
24
24
|
class ParseError < StandardError; end
|
|
25
|
+
|
|
25
26
|
class Parser
|
|
26
27
|
attr_writer :stack, :key_stack
|
|
27
28
|
attr_accessor :key, :finished
|
data/lib/ffi_yajl/platform.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
data/lib/ffi_yajl/version.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright:: Copyright (c)
|
|
2
|
+
# Copyright:: Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
|
|
23
23
|
module FFI_Yajl
|
|
24
|
-
VERSION = "3.0.
|
|
24
|
+
VERSION = "3.0.1".freeze
|
|
25
25
|
end
|
data/lib/ffi_yajl.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2015 Lamont Granquist
|
|
2
|
-
# Copyright (c)
|
|
2
|
+
# Copyright (c) 2013-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
5
5
|
# a copy of this software and associated documentation files (the
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ffi-yajl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lamont Granquist
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-07-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: libyajl2
|
|
@@ -16,14 +16,28 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1
|
|
19
|
+
version: '2.1'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1
|
|
26
|
+
version: '2.1'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: cookstyle
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '8.1'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '8.1'
|
|
27
41
|
description: Ruby FFI wrapper around YAJL 2.x
|
|
28
42
|
email: lamont@chef.io
|
|
29
43
|
executables:
|
|
@@ -81,7 +95,7 @@ homepage: http://github.com/chef/ffi-yajl
|
|
|
81
95
|
licenses:
|
|
82
96
|
- MIT
|
|
83
97
|
metadata: {}
|
|
84
|
-
post_install_message:
|
|
98
|
+
post_install_message:
|
|
85
99
|
rdoc_options: []
|
|
86
100
|
require_paths:
|
|
87
101
|
- lib
|
|
@@ -89,15 +103,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
89
103
|
requirements:
|
|
90
104
|
- - ">="
|
|
91
105
|
- !ruby/object:Gem::Version
|
|
92
|
-
version: '
|
|
106
|
+
version: '3.1'
|
|
93
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
108
|
requirements:
|
|
95
109
|
- - ">="
|
|
96
110
|
- !ruby/object:Gem::Version
|
|
97
111
|
version: '0'
|
|
98
112
|
requirements: []
|
|
99
|
-
rubygems_version: 3.3.
|
|
100
|
-
signing_key:
|
|
113
|
+
rubygems_version: 3.3.27
|
|
114
|
+
signing_key:
|
|
101
115
|
specification_version: 4
|
|
102
116
|
summary: Ruby FFI wrapper around YAJL 2.x
|
|
103
117
|
test_files: []
|