ruby-zstds 1.2.0 → 1.2.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/ext/extconf.rb +8 -1
- data/ext/zstds_ext/dictionary.c +9 -2
- data/ext/zstds_ext/dictionary.h +8 -0
- data/ext/zstds_ext/error.c +3 -0
- data/ext/zstds_ext/error.h +1 -0
- data/ext/zstds_ext/gvl.h +1 -1
- data/ext/zstds_ext/macro.h +6 -0
- data/lib/zstds/error.rb +2 -1
- data/lib/zstds/version.rb +1 -1
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80ccd3c8a7210dcf3fabdfadcca8e37ce82d5fe78c7f761f5ae7c355ff746854
|
4
|
+
data.tar.gz: a4ed4e5dd4c89b7f95438c5e3033d09eb25721ab32fda8e1eac9351774ab3215
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 967b5d866cd79b139bdbca97e1fdacf9063e3bc425f441be239980dd839d123173fcad15c0830576a32fe7c0bb5166f4fd5159717a9ac7f038fe57a435859f70
|
7
|
+
data.tar.gz: 78c54fc20f8facaa556eb68438407cfa7ff96d33425a9dce73584fc26435177dda8478c729a412f00d9b28a9d860b3dec6a059a728926a587f3a83dae9fe1836
|
data/ext/extconf.rb
CHANGED
@@ -26,6 +26,7 @@ def require_header(name, constants: [], macroses: [], types: [])
|
|
26
26
|
end
|
27
27
|
|
28
28
|
require_header "zdict.h"
|
29
|
+
|
29
30
|
require_header(
|
30
31
|
"zstd.h",
|
31
32
|
:constants => %w[
|
@@ -72,6 +73,7 @@ require_header(
|
|
72
73
|
"ZSTD_strategy"
|
73
74
|
]
|
74
75
|
)
|
76
|
+
|
75
77
|
require_header(
|
76
78
|
"zstd_errors.h",
|
77
79
|
:constants => %w[
|
@@ -106,11 +108,16 @@ def require_library(name, functions)
|
|
106
108
|
end
|
107
109
|
end
|
108
110
|
|
111
|
+
# rubocop:disable Style/GlobalVars
|
112
|
+
if find_library "zstd", "ZDICT_getDictHeaderSize"
|
113
|
+
$defs.push "-DHAVE_ZDICT_HEADER_SIZE"
|
114
|
+
end
|
115
|
+
# rubocop:enable Style/GlobalVars
|
116
|
+
|
109
117
|
require_library(
|
110
118
|
"zstd",
|
111
119
|
%w[
|
112
120
|
ZDICT_getDictID
|
113
|
-
ZDICT_getDictHeaderSize
|
114
121
|
ZDICT_isError
|
115
122
|
ZDICT_trainFromBuffer
|
116
123
|
ZSTD_CCtx_loadDictionary
|
data/ext/zstds_ext/dictionary.c
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
#include "zstds_ext/buffer.h"
|
10
10
|
#include "zstds_ext/error.h"
|
11
11
|
#include "zstds_ext/gvl.h"
|
12
|
-
#include "zstds_ext/macro.h"
|
13
12
|
#include "zstds_ext/option.h"
|
14
13
|
|
15
14
|
// -- initialization --
|
@@ -153,7 +152,8 @@ VALUE zstds_ext_get_dictionary_buffer_id(VALUE ZSTDS_EXT_UNUSED(self), VALUE buf
|
|
153
152
|
return UINT2NUM(id);
|
154
153
|
}
|
155
154
|
|
156
|
-
|
155
|
+
#if defined(HAVE_ZDICT_HEADER_SIZE)
|
156
|
+
VALUE zstds_ext_get_dictionary_header_size(VALUE self, VALUE buffer)
|
157
157
|
{
|
158
158
|
zstds_result_t result = ZDICT_getDictHeaderSize(RSTRING_PTR(buffer), RSTRING_LEN(buffer));
|
159
159
|
if (ZDICT_isError(result)) {
|
@@ -163,6 +163,13 @@ VALUE zstds_ext_get_dictionary_header_size(VALUE ZSTDS_EXT_UNUSED(self), VALUE b
|
|
163
163
|
return SIZET2NUM(result);
|
164
164
|
}
|
165
165
|
|
166
|
+
#else
|
167
|
+
ZSTDS_EXT_NORETURN VALUE zstds_ext_get_dictionary_header_size(VALUE self, VALUE buffer)
|
168
|
+
{
|
169
|
+
zstds_ext_raise_error(ZSTDS_EXT_ERROR_NOT_IMPLEMENTED);
|
170
|
+
};
|
171
|
+
#endif
|
172
|
+
|
166
173
|
// -- exports --
|
167
174
|
|
168
175
|
void zstds_ext_dictionary_exports(VALUE root_module)
|
data/ext/zstds_ext/dictionary.h
CHANGED
@@ -6,11 +6,19 @@
|
|
6
6
|
|
7
7
|
#include "ruby.h"
|
8
8
|
|
9
|
+
#include "zstds_ext/macro.h"
|
10
|
+
|
9
11
|
#define ZSTDS_EXT_DEFAULT_DICTIONARY_CAPACITY (1 << 17); // 128 KB
|
10
12
|
|
11
13
|
VALUE zstds_ext_train_dictionary_buffer(VALUE self, VALUE samples, VALUE options);
|
12
14
|
VALUE zstds_ext_get_dictionary_buffer_id(VALUE self, VALUE buffer);
|
13
15
|
|
16
|
+
#if defined(HAVE_ZDICT_HEADER_SIZE)
|
17
|
+
VALUE zstds_ext_get_dictionary_header_size(VALUE self, VALUE buffer);
|
18
|
+
#else
|
19
|
+
ZSTDS_EXT_NORETURN VALUE zstds_ext_get_dictionary_header_size(VALUE self, VALUE buffer);
|
20
|
+
#endif
|
21
|
+
|
14
22
|
void zstds_ext_dictionary_exports(VALUE root_module);
|
15
23
|
|
16
24
|
#endif // ZSTDS_EXT_DICTIONARY_H
|
data/ext/zstds_ext/error.c
CHANGED
@@ -69,6 +69,9 @@ void zstds_ext_raise_error(zstds_ext_result_t ext_result)
|
|
69
69
|
case ZSTDS_EXT_ERROR_WRITE_IO:
|
70
70
|
raise_error("WriteIOError", "failed to write IO");
|
71
71
|
|
72
|
+
case ZSTDS_EXT_ERROR_NOT_IMPLEMENTED:
|
73
|
+
raise_error("NotImplementedError", "not implemented error");
|
74
|
+
|
72
75
|
default:
|
73
76
|
// ZSTDS_EXT_ERROR_UNEXPECTED
|
74
77
|
raise_error("UnexpectedError", "unexpected error");
|
data/ext/zstds_ext/error.h
CHANGED
data/ext/zstds_ext/gvl.h
CHANGED
data/ext/zstds_ext/macro.h
CHANGED
data/lib/zstds/error.rb
CHANGED
data/lib/zstds/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-zstds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Aladjev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codecov
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '5.
|
61
|
+
version: '5.15'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '5.
|
68
|
+
version: '5.15'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: ocg
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,42 +128,42 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '1.
|
131
|
+
version: '1.24'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '1.
|
138
|
+
version: '1.24'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rubocop-minitest
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0.
|
145
|
+
version: '0.17'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '0.
|
152
|
+
version: '0.17'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rubocop-performance
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '1.
|
159
|
+
version: '1.13'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '1.
|
166
|
+
version: '1.13'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rubocop-rake
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -244,7 +244,8 @@ files:
|
|
244
244
|
homepage: https://github.com/andrew-aladev/ruby-zstds
|
245
245
|
licenses:
|
246
246
|
- MIT
|
247
|
-
metadata:
|
247
|
+
metadata:
|
248
|
+
rubygems_mfa_required: 'true'
|
248
249
|
post_install_message:
|
249
250
|
rdoc_options: []
|
250
251
|
require_paths:
|
@@ -260,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
261
|
- !ruby/object:Gem::Version
|
261
262
|
version: '0'
|
262
263
|
requirements: []
|
263
|
-
rubygems_version: 3.
|
264
|
+
rubygems_version: 3.3.3
|
264
265
|
signing_key:
|
265
266
|
specification_version: 4
|
266
267
|
summary: Ruby bindings for zstd library.
|