brotli 0.7.0 → 0.9.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.
- checksums.yaml +4 -4
- data/README.md +113 -1
- data/ext/brotli/brotli.c +908 -288
- data/ext/brotli/brotli.h +0 -5
- data/ext/brotli/buffer.c +43 -65
- data/ext/brotli/buffer.h +6 -9
- data/ext/brotli/extconf.rb +115 -50
- data/lib/brotli/reader.rb +167 -0
- data/lib/brotli/version.rb +1 -1
- data/lib/brotli/writer.rb +81 -0
- data/lib/brotli.rb +2 -0
- data/vendor/brotli/c/common/constants.c +7 -7
- data/vendor/brotli/c/common/constants.h +2 -5
- data/vendor/brotli/c/common/context.c +2 -2
- data/vendor/brotli/c/common/context.h +1 -2
- data/vendor/brotli/c/common/dictionary.c +4 -5856
- data/vendor/brotli/c/common/dictionary.h +1 -2
- data/vendor/brotli/c/common/dictionary_inc.h +5847 -0
- data/vendor/brotli/c/common/platform.c +0 -4
- data/vendor/brotli/c/common/platform.h +182 -43
- data/vendor/brotli/c/common/shared_dictionary.c +3 -7
- data/vendor/brotli/c/common/shared_dictionary_internal.h +1 -1
- data/vendor/brotli/c/common/static_init.h +56 -0
- data/vendor/brotli/c/common/transform.c +6 -4
- data/vendor/brotli/c/common/transform.h +1 -2
- data/vendor/brotli/c/common/version.h +3 -3
- data/vendor/brotli/c/dec/bit_reader.c +2 -3
- data/vendor/brotli/c/dec/bit_reader.h +0 -4
- data/vendor/brotli/c/dec/decode.c +128 -39
- data/vendor/brotli/c/dec/huffman.c +2 -5
- data/vendor/brotli/c/dec/huffman.h +0 -2
- data/vendor/brotli/c/dec/prefix.c +67 -0
- data/vendor/brotli/c/dec/prefix.h +18 -708
- data/vendor/brotli/c/dec/prefix_inc.h +707 -0
- data/vendor/brotli/c/dec/state.c +18 -15
- data/vendor/brotli/c/dec/state.h +2 -6
- data/vendor/brotli/c/dec/static_init.c +53 -0
- data/vendor/brotli/c/dec/static_init.h +30 -0
- data/vendor/brotli/c/enc/backward_references.c +32 -8
- data/vendor/brotli/c/enc/backward_references.h +1 -5
- data/vendor/brotli/c/enc/backward_references_hq.c +15 -15
- data/vendor/brotli/c/enc/backward_references_hq.h +1 -5
- data/vendor/brotli/c/enc/bit_cost.c +28 -4
- data/vendor/brotli/c/enc/bit_cost.h +8 -40
- data/vendor/brotli/c/enc/bit_cost_inc.h +1 -1
- data/vendor/brotli/c/enc/block_splitter.c +9 -12
- data/vendor/brotli/c/enc/block_splitter.h +0 -3
- data/vendor/brotli/c/enc/block_splitter_inc.h +14 -8
- data/vendor/brotli/c/enc/brotli_bit_stream.c +10 -9
- data/vendor/brotli/c/enc/brotli_bit_stream.h +0 -6
- data/vendor/brotli/c/enc/cluster.c +0 -2
- data/vendor/brotli/c/enc/cluster.h +0 -2
- data/vendor/brotli/c/enc/command.c +1 -1
- data/vendor/brotli/c/enc/command.h +8 -10
- data/vendor/brotli/c/enc/compound_dictionary.c +3 -5
- data/vendor/brotli/c/enc/compound_dictionary.h +1 -4
- data/vendor/brotli/c/enc/compress_fragment.c +3 -13
- data/vendor/brotli/c/enc/compress_fragment.h +0 -2
- data/vendor/brotli/c/enc/compress_fragment_two_pass.c +5 -15
- data/vendor/brotli/c/enc/compress_fragment_two_pass.h +0 -2
- data/vendor/brotli/c/enc/dictionary_hash.c +127 -1830
- data/vendor/brotli/c/enc/dictionary_hash.h +23 -3
- data/vendor/brotli/c/enc/dictionary_hash_inc.h +1829 -0
- data/vendor/brotli/c/enc/encode.c +77 -52
- data/vendor/brotli/c/enc/encoder_dict.c +9 -7
- data/vendor/brotli/c/enc/encoder_dict.h +2 -4
- data/vendor/brotli/c/enc/entropy_encode.c +3 -6
- data/vendor/brotli/c/enc/entropy_encode.h +2 -4
- data/vendor/brotli/c/enc/entropy_encode_static.h +18 -12
- data/vendor/brotli/c/enc/fast_log.c +1 -1
- data/vendor/brotli/c/enc/fast_log.h +2 -3
- data/vendor/brotli/c/enc/find_match_length.h +0 -2
- data/vendor/brotli/c/enc/hash.h +38 -31
- data/vendor/brotli/c/enc/hash_base.h +38 -0
- data/vendor/brotli/c/enc/hash_forgetful_chain_inc.h +11 -1
- data/vendor/brotli/c/enc/hash_longest_match64_inc.h +24 -7
- data/vendor/brotli/c/enc/hash_longest_match64_simd_inc.h +304 -0
- data/vendor/brotli/c/enc/hash_longest_match_inc.h +30 -11
- data/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h +4 -0
- data/vendor/brotli/c/enc/hash_longest_match_simd_inc.h +278 -0
- data/vendor/brotli/c/enc/histogram.c +1 -0
- data/vendor/brotli/c/enc/histogram.h +0 -4
- data/vendor/brotli/c/enc/literal_cost.c +4 -6
- data/vendor/brotli/c/enc/literal_cost.h +0 -2
- data/vendor/brotli/c/enc/matching_tag_mask.h +69 -0
- data/vendor/brotli/c/enc/memory.c +0 -5
- data/vendor/brotli/c/enc/memory.h +0 -4
- data/vendor/brotli/c/enc/metablock.c +7 -9
- data/vendor/brotli/c/enc/metablock.h +3 -3
- data/vendor/brotli/c/enc/metablock_inc.h +4 -4
- data/vendor/brotli/c/enc/params.h +0 -1
- data/vendor/brotli/c/enc/prefix.h +0 -2
- data/vendor/brotli/c/enc/quality.h +17 -10
- data/vendor/brotli/c/enc/ringbuffer.h +1 -4
- data/vendor/brotli/c/enc/state.h +2 -2
- data/vendor/brotli/c/enc/static_dict.c +5 -11
- data/vendor/brotli/c/enc/static_dict.h +1 -3
- data/vendor/brotli/c/enc/static_dict_lut.c +224 -0
- data/vendor/brotli/c/enc/static_dict_lut.h +20 -5837
- data/vendor/brotli/c/enc/static_dict_lut_inc.h +5830 -0
- data/vendor/brotli/c/enc/static_init.c +59 -0
- data/vendor/brotli/c/enc/static_init.h +30 -0
- data/vendor/brotli/c/enc/utf8_util.c +1 -1
- data/vendor/brotli/c/enc/utf8_util.h +0 -2
- data/vendor/brotli/c/enc/write_bits.h +0 -2
- data/vendor/brotli/c/include/brotli/decode.h +1 -1
- data/vendor/brotli/c/include/brotli/encode.h +5 -1
- data/vendor/brotli/c/include/brotli/port.h +4 -7
- data/vendor/brotli/c/include/brotli/types.h +2 -2
- metadata +24 -28
- data/.github/workflows/main.yml +0 -37
- data/.github/workflows/publish.yml +0 -24
- data/.gitignore +0 -18
- data/.gitmodules +0 -3
- data/.rspec +0 -2
- data/Dockerfile +0 -38
- data/Gemfile +0 -10
- data/Rakefile +0 -42
- data/bin/before_install.sh +0 -9
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/brotli.gemspec +0 -27
- data/smoke.sh +0 -8
- data/test/brotli_test.rb +0 -183
- data/test/brotli_writer_test.rb +0 -93
- data/test/test_helper.rb +0 -9
- data/vendor/brotli/c/common/dictionary.bin +0 -432
- data/vendor/brotli/c/common/dictionary.bin.br +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* Copyright 2025 Google Inc. All Rights Reserved.
|
|
2
|
+
|
|
3
|
+
Distributed under MIT license.
|
|
4
|
+
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#include "static_init.h"
|
|
8
|
+
|
|
9
|
+
#include "../common/platform.h"
|
|
10
|
+
#include "../common/static_init.h"
|
|
11
|
+
|
|
12
|
+
#if (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_NONE)
|
|
13
|
+
#include "../common/dictionary.h"
|
|
14
|
+
#include "dictionary_hash.h"
|
|
15
|
+
#include "static_dict_lut.h"
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#if defined(__cplusplus) || defined(c_plusplus)
|
|
19
|
+
extern "C" {
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#if (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_NONE)
|
|
23
|
+
static BROTLI_BOOL DoBrotliEncoderStaticInit(void) {
|
|
24
|
+
const BrotliDictionary* dict = BrotliGetDictionary();
|
|
25
|
+
BROTLI_BOOL ok = BrotliEncoderInitStaticDictionaryLut(
|
|
26
|
+
dict, kStaticDictionaryBuckets, kStaticDictionaryWords);
|
|
27
|
+
if (!ok) return BROTLI_FALSE;
|
|
28
|
+
ok = BrotliEncoderInitDictionaryHash(dict, kStaticDictionaryHashWords,
|
|
29
|
+
kStaticDictionaryHashLengths);
|
|
30
|
+
if (!ok) return BROTLI_FALSE;
|
|
31
|
+
return BROTLI_TRUE;
|
|
32
|
+
}
|
|
33
|
+
#endif /* BROTLI_STATIC_INIT_NONE */
|
|
34
|
+
|
|
35
|
+
#if (BROTLI_STATIC_INIT == BROTLI_STATIC_INIT_EARLY)
|
|
36
|
+
static BROTLI_BOOL kEarlyInitOk;
|
|
37
|
+
static __attribute__((constructor)) void BrotliEncoderStaticInitEarly(void) {
|
|
38
|
+
kEarlyInitOk = DoBrotliEncoderStaticInit();
|
|
39
|
+
}
|
|
40
|
+
#elif (BROTLI_STATIC_INIT == BROTLI_STATIC_INIT_LAZY)
|
|
41
|
+
static BROTLI_BOOL kLazyInitOk;
|
|
42
|
+
void BrotliEncoderLazyStaticInitInner(void) {
|
|
43
|
+
kLazyInitOk = DoBrotliEncoderStaticInit();
|
|
44
|
+
}
|
|
45
|
+
#endif /* BROTLI_STATIC_INIT_EARLY */
|
|
46
|
+
|
|
47
|
+
BROTLI_BOOL BrotliEncoderEnsureStaticInit(void) {
|
|
48
|
+
#if (BROTLI_STATIC_INIT == BROTLI_STATIC_INIT_NONE)
|
|
49
|
+
return BROTLI_TRUE;
|
|
50
|
+
#elif (BROTLI_STATIC_INIT == BROTLI_STATIC_INIT_EARLY)
|
|
51
|
+
return kEarlyInitOk;
|
|
52
|
+
#else
|
|
53
|
+
return kLazyInitOk;
|
|
54
|
+
#endif
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#if defined(__cplusplus) || defined(c_plusplus)
|
|
58
|
+
} /* extern "C" */
|
|
59
|
+
#endif
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* Copyright 2025 Google Inc. All Rights Reserved.
|
|
2
|
+
|
|
3
|
+
Distributed under MIT license.
|
|
4
|
+
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* Central point for static initialization. */
|
|
8
|
+
|
|
9
|
+
#ifndef THIRD_PARTY_BROTLI_ENC_STATIC_INIT_H_
|
|
10
|
+
#define THIRD_PARTY_BROTLI_ENC_STATIC_INIT_H_
|
|
11
|
+
|
|
12
|
+
#include "../common/platform.h"
|
|
13
|
+
#include "../common/static_init.h"
|
|
14
|
+
|
|
15
|
+
#if defined(__cplusplus) || defined(c_plusplus)
|
|
16
|
+
extern "C" {
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
#if (BROTLI_STATIC_INIT == BROTLI_STATIC_INIT_LAZY)
|
|
20
|
+
BROTLI_INTERNAL void BrotliEncoderLazyStaticInitInner(void);
|
|
21
|
+
BROTLI_INTERNAL void BrotliEncoderLazyStaticInit(void);
|
|
22
|
+
#endif /* BROTLI_STATIC_INIT */
|
|
23
|
+
|
|
24
|
+
BROTLI_INTERNAL BROTLI_BOOL BrotliEncoderEnsureStaticInit(void);
|
|
25
|
+
|
|
26
|
+
#if defined(__cplusplus) || defined(c_plusplus)
|
|
27
|
+
} /* extern "C" */
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
#endif // THIRD_PARTY_BROTLI_ENC_STATIC_INIT_H_
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
#include <brotli/port.h>
|
|
16
16
|
#include <brotli/shared_dictionary.h>
|
|
17
|
-
#include <brotli/types.h>
|
|
17
|
+
#include <brotli/types.h> /* IWYU pragma: export */
|
|
18
18
|
|
|
19
19
|
#if defined(__cplusplus) || defined(c_plusplus)
|
|
20
20
|
extern "C" {
|
|
@@ -283,6 +283,10 @@ typedef struct BrotliEncoderPreparedDictionaryStruct
|
|
|
283
283
|
* passed to @p alloc_func and @p free_func when they are called. @p free_func
|
|
284
284
|
* has to return without doing anything when asked to free a NULL pointer.
|
|
285
285
|
*
|
|
286
|
+
* @warning Created instance is "lean"; it does not contain copy of @p data,
|
|
287
|
+
* rather it contains only pointer to it; therefore,
|
|
288
|
+
* @p data @b MUST outlive the created instance.
|
|
289
|
+
*
|
|
286
290
|
* @param type type of dictionary stored in data
|
|
287
291
|
* @param data_size size of @p data buffer
|
|
288
292
|
* @param data pointer to the dictionary data
|
|
@@ -239,8 +239,6 @@
|
|
|
239
239
|
#define BROTLI_PUBLIC
|
|
240
240
|
#endif
|
|
241
241
|
|
|
242
|
-
/* BROTLI_INTERNAL could be defined to override visibility, e.g. for tests. */
|
|
243
|
-
#if !defined(BROTLI_INTERNAL)
|
|
244
242
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
|
245
243
|
#define BROTLI_INTERNAL
|
|
246
244
|
#elif BROTLI_GNUC_VERSION_CHECK(3, 3, 0) || \
|
|
@@ -255,7 +253,6 @@
|
|
|
255
253
|
#else
|
|
256
254
|
#define BROTLI_INTERNAL
|
|
257
255
|
#endif
|
|
258
|
-
#endif
|
|
259
256
|
|
|
260
257
|
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
|
|
261
258
|
!defined(__STDC_NO_VLA__) && !defined(__cplusplus) && \
|
|
@@ -272,20 +269,20 @@
|
|
|
272
269
|
#if defined(_WIN32)
|
|
273
270
|
#if defined(BROTLICOMMON_SHARED_COMPILATION)
|
|
274
271
|
#define BROTLI_COMMON_API __declspec(dllexport)
|
|
275
|
-
#else
|
|
272
|
+
#else /* !BROTLICOMMON_SHARED_COMPILATION */
|
|
276
273
|
#define BROTLI_COMMON_API __declspec(dllimport)
|
|
277
274
|
#endif /* BROTLICOMMON_SHARED_COMPILATION */
|
|
278
275
|
#if defined(BROTLIDEC_SHARED_COMPILATION)
|
|
279
276
|
#define BROTLI_DEC_API __declspec(dllexport)
|
|
280
|
-
#else
|
|
277
|
+
#else /* !BROTLIDEC_SHARED_COMPILATION */
|
|
281
278
|
#define BROTLI_DEC_API __declspec(dllimport)
|
|
282
279
|
#endif /* BROTLIDEC_SHARED_COMPILATION */
|
|
283
280
|
#if defined(BROTLIENC_SHARED_COMPILATION)
|
|
284
281
|
#define BROTLI_ENC_API __declspec(dllexport)
|
|
285
|
-
#else
|
|
282
|
+
#else /* !BROTLIENC_SHARED_COMPILATION */
|
|
286
283
|
#define BROTLI_ENC_API __declspec(dllimport)
|
|
287
284
|
#endif /* BROTLIENC_SHARED_COMPILATION */
|
|
288
|
-
#else /* _WIN32 */
|
|
285
|
+
#else /* !_WIN32 */
|
|
289
286
|
#define BROTLI_COMMON_API BROTLI_PUBLIC
|
|
290
287
|
#define BROTLI_DEC_API BROTLI_PUBLIC
|
|
291
288
|
#define BROTLI_ENC_API BROTLI_PUBLIC
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
#ifndef BROTLI_COMMON_TYPES_H_
|
|
13
13
|
#define BROTLI_COMMON_TYPES_H_
|
|
14
14
|
|
|
15
|
-
#include <stddef.h> /*
|
|
15
|
+
#include <stddef.h> /* IWYU pragma: export */
|
|
16
16
|
|
|
17
17
|
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
|
18
18
|
typedef __int8 int8_t;
|
|
@@ -24,7 +24,7 @@ typedef unsigned __int32 uint32_t;
|
|
|
24
24
|
typedef unsigned __int64 uint64_t;
|
|
25
25
|
typedef __int64 int64_t;
|
|
26
26
|
#else
|
|
27
|
-
#include <stdint.h>
|
|
27
|
+
#include <stdint.h> /* IWYU pragma: export */
|
|
28
28
|
#endif /* defined(_MSC_VER) && (_MSC_VER < 1600) */
|
|
29
29
|
|
|
30
30
|
/**
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: brotli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- miyucy
|
|
8
|
-
bindir:
|
|
8
|
+
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
|
-
description: Brotli
|
|
12
|
+
description: Native Ruby bindings for Brotli compression and decompression.
|
|
13
13
|
email:
|
|
14
14
|
- fistfvck@gmail.com
|
|
15
15
|
executables: []
|
|
@@ -17,44 +17,30 @@ extensions:
|
|
|
17
17
|
- ext/brotli/extconf.rb
|
|
18
18
|
extra_rdoc_files: []
|
|
19
19
|
files:
|
|
20
|
-
- ".github/workflows/main.yml"
|
|
21
|
-
- ".github/workflows/publish.yml"
|
|
22
|
-
- ".gitignore"
|
|
23
|
-
- ".gitmodules"
|
|
24
|
-
- ".rspec"
|
|
25
|
-
- Dockerfile
|
|
26
|
-
- Gemfile
|
|
27
20
|
- LICENSE.txt
|
|
28
21
|
- README.md
|
|
29
|
-
- Rakefile
|
|
30
|
-
- bin/before_install.sh
|
|
31
|
-
- bin/console
|
|
32
|
-
- bin/setup
|
|
33
|
-
- brotli.gemspec
|
|
34
22
|
- ext/brotli/brotli.c
|
|
35
23
|
- ext/brotli/brotli.h
|
|
36
24
|
- ext/brotli/buffer.c
|
|
37
25
|
- ext/brotli/buffer.h
|
|
38
26
|
- ext/brotli/extconf.rb
|
|
39
27
|
- lib/brotli.rb
|
|
28
|
+
- lib/brotli/reader.rb
|
|
40
29
|
- lib/brotli/version.rb
|
|
41
|
-
-
|
|
42
|
-
- test/brotli_test.rb
|
|
43
|
-
- test/brotli_writer_test.rb
|
|
44
|
-
- test/test_helper.rb
|
|
30
|
+
- lib/brotli/writer.rb
|
|
45
31
|
- vendor/brotli/LICENSE
|
|
46
32
|
- vendor/brotli/c/common/constants.c
|
|
47
33
|
- vendor/brotli/c/common/constants.h
|
|
48
34
|
- vendor/brotli/c/common/context.c
|
|
49
35
|
- vendor/brotli/c/common/context.h
|
|
50
|
-
- vendor/brotli/c/common/dictionary.bin
|
|
51
|
-
- vendor/brotli/c/common/dictionary.bin.br
|
|
52
36
|
- vendor/brotli/c/common/dictionary.c
|
|
53
37
|
- vendor/brotli/c/common/dictionary.h
|
|
38
|
+
- vendor/brotli/c/common/dictionary_inc.h
|
|
54
39
|
- vendor/brotli/c/common/platform.c
|
|
55
40
|
- vendor/brotli/c/common/platform.h
|
|
56
41
|
- vendor/brotli/c/common/shared_dictionary.c
|
|
57
42
|
- vendor/brotli/c/common/shared_dictionary_internal.h
|
|
43
|
+
- vendor/brotli/c/common/static_init.h
|
|
58
44
|
- vendor/brotli/c/common/transform.c
|
|
59
45
|
- vendor/brotli/c/common/transform.h
|
|
60
46
|
- vendor/brotli/c/common/version.h
|
|
@@ -63,9 +49,13 @@ files:
|
|
|
63
49
|
- vendor/brotli/c/dec/decode.c
|
|
64
50
|
- vendor/brotli/c/dec/huffman.c
|
|
65
51
|
- vendor/brotli/c/dec/huffman.h
|
|
52
|
+
- vendor/brotli/c/dec/prefix.c
|
|
66
53
|
- vendor/brotli/c/dec/prefix.h
|
|
54
|
+
- vendor/brotli/c/dec/prefix_inc.h
|
|
67
55
|
- vendor/brotli/c/dec/state.c
|
|
68
56
|
- vendor/brotli/c/dec/state.h
|
|
57
|
+
- vendor/brotli/c/dec/static_init.c
|
|
58
|
+
- vendor/brotli/c/dec/static_init.h
|
|
69
59
|
- vendor/brotli/c/enc/backward_references.c
|
|
70
60
|
- vendor/brotli/c/enc/backward_references.h
|
|
71
61
|
- vendor/brotli/c/enc/backward_references_hq.c
|
|
@@ -93,6 +83,7 @@ files:
|
|
|
93
83
|
- vendor/brotli/c/enc/compress_fragment_two_pass.h
|
|
94
84
|
- vendor/brotli/c/enc/dictionary_hash.c
|
|
95
85
|
- vendor/brotli/c/enc/dictionary_hash.h
|
|
86
|
+
- vendor/brotli/c/enc/dictionary_hash_inc.h
|
|
96
87
|
- vendor/brotli/c/enc/encode.c
|
|
97
88
|
- vendor/brotli/c/enc/encoder_dict.c
|
|
98
89
|
- vendor/brotli/c/enc/encoder_dict.h
|
|
@@ -103,11 +94,14 @@ files:
|
|
|
103
94
|
- vendor/brotli/c/enc/fast_log.h
|
|
104
95
|
- vendor/brotli/c/enc/find_match_length.h
|
|
105
96
|
- vendor/brotli/c/enc/hash.h
|
|
97
|
+
- vendor/brotli/c/enc/hash_base.h
|
|
106
98
|
- vendor/brotli/c/enc/hash_composite_inc.h
|
|
107
99
|
- vendor/brotli/c/enc/hash_forgetful_chain_inc.h
|
|
108
100
|
- vendor/brotli/c/enc/hash_longest_match64_inc.h
|
|
101
|
+
- vendor/brotli/c/enc/hash_longest_match64_simd_inc.h
|
|
109
102
|
- vendor/brotli/c/enc/hash_longest_match_inc.h
|
|
110
103
|
- vendor/brotli/c/enc/hash_longest_match_quickly_inc.h
|
|
104
|
+
- vendor/brotli/c/enc/hash_longest_match_simd_inc.h
|
|
111
105
|
- vendor/brotli/c/enc/hash_rolling_inc.h
|
|
112
106
|
- vendor/brotli/c/enc/hash_to_binary_tree_inc.h
|
|
113
107
|
- vendor/brotli/c/enc/histogram.c
|
|
@@ -115,6 +109,7 @@ files:
|
|
|
115
109
|
- vendor/brotli/c/enc/histogram_inc.h
|
|
116
110
|
- vendor/brotli/c/enc/literal_cost.c
|
|
117
111
|
- vendor/brotli/c/enc/literal_cost.h
|
|
112
|
+
- vendor/brotli/c/enc/matching_tag_mask.h
|
|
118
113
|
- vendor/brotli/c/enc/memory.c
|
|
119
114
|
- vendor/brotli/c/enc/memory.h
|
|
120
115
|
- vendor/brotli/c/enc/metablock.c
|
|
@@ -127,7 +122,11 @@ files:
|
|
|
127
122
|
- vendor/brotli/c/enc/state.h
|
|
128
123
|
- vendor/brotli/c/enc/static_dict.c
|
|
129
124
|
- vendor/brotli/c/enc/static_dict.h
|
|
125
|
+
- vendor/brotli/c/enc/static_dict_lut.c
|
|
130
126
|
- vendor/brotli/c/enc/static_dict_lut.h
|
|
127
|
+
- vendor/brotli/c/enc/static_dict_lut_inc.h
|
|
128
|
+
- vendor/brotli/c/enc/static_init.c
|
|
129
|
+
- vendor/brotli/c/enc/static_init.h
|
|
131
130
|
- vendor/brotli/c/enc/utf8_util.c
|
|
132
131
|
- vendor/brotli/c/enc/utf8_util.h
|
|
133
132
|
- vendor/brotli/c/enc/write_bits.h
|
|
@@ -147,17 +146,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
147
146
|
requirements:
|
|
148
147
|
- - ">="
|
|
149
148
|
- !ruby/object:Gem::Version
|
|
150
|
-
version: '
|
|
149
|
+
version: '3.1'
|
|
151
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
151
|
requirements:
|
|
153
152
|
- - ">="
|
|
154
153
|
- !ruby/object:Gem::Version
|
|
155
154
|
version: '0'
|
|
156
155
|
requirements: []
|
|
157
|
-
rubygems_version:
|
|
156
|
+
rubygems_version: 4.0.20
|
|
158
157
|
specification_version: 4
|
|
159
|
-
summary: Brotli
|
|
160
|
-
test_files:
|
|
161
|
-
- test/brotli_test.rb
|
|
162
|
-
- test/brotli_writer_test.rb
|
|
163
|
-
- test/test_helper.rb
|
|
158
|
+
summary: Ruby bindings for Brotli compression
|
|
159
|
+
test_files: []
|
data/.github/workflows/main.yml
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
name: Ruby
|
|
2
|
-
|
|
3
|
-
on: [pull_request]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
strategy:
|
|
8
|
-
fail-fast: false
|
|
9
|
-
matrix:
|
|
10
|
-
ruby: [3.1, 3.2, 3.3, 3.4]
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v4
|
|
14
|
-
with:
|
|
15
|
-
submodules: true
|
|
16
|
-
- name: Set up Ruby
|
|
17
|
-
uses: ruby/setup-ruby@v1
|
|
18
|
-
with:
|
|
19
|
-
ruby-version: ${{ matrix.ruby }}
|
|
20
|
-
bundler-cache: true
|
|
21
|
-
- name: Run the default task
|
|
22
|
-
run: |
|
|
23
|
-
bundle exec rake clobber
|
|
24
|
-
bundle exec rake compile -- --enable-vendor
|
|
25
|
-
bundle exec rake test
|
|
26
|
-
bundle exec rake build
|
|
27
|
-
gem install --no-document "$(ls pkg/brotli-*.gem)"
|
|
28
|
-
cat <<EOF | ruby
|
|
29
|
-
require "brotli"
|
|
30
|
-
if Brotli.inflate(Brotli.deflate(File.read("README.md"))) == File.read("README.md")
|
|
31
|
-
puts "OK"
|
|
32
|
-
exit 0
|
|
33
|
-
else
|
|
34
|
-
puts "NG"
|
|
35
|
-
exit 0
|
|
36
|
-
end
|
|
37
|
-
EOF
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
name: Publish Gem
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build:
|
|
10
|
-
if: github.repository == 'miyucy/brotli'
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
permissions:
|
|
13
|
-
contents: write
|
|
14
|
-
id-token: write
|
|
15
|
-
steps:
|
|
16
|
-
- uses: actions/checkout@v4
|
|
17
|
-
with:
|
|
18
|
-
submodules: true
|
|
19
|
-
- name: Set up Ruby
|
|
20
|
-
uses: ruby/setup-ruby@v1
|
|
21
|
-
with:
|
|
22
|
-
ruby-version: ruby
|
|
23
|
-
bundler-cache: true
|
|
24
|
-
- uses: rubygems/release-gem@v1
|
data/.gitignore
DELETED
data/.gitmodules
DELETED
data/.rspec
DELETED
data/Dockerfile
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
ARG GCC_VERSION=14
|
|
2
|
-
FROM gcc:${GCC_VERSION}
|
|
3
|
-
|
|
4
|
-
ARG USE_SYSTEM_BROTLI=true
|
|
5
|
-
|
|
6
|
-
# Install Ruby and development dependencies
|
|
7
|
-
RUN apt-get update && apt-get install -y \
|
|
8
|
-
git \
|
|
9
|
-
libbrotli-dev \
|
|
10
|
-
pkg-config \
|
|
11
|
-
ruby \
|
|
12
|
-
ruby-dev \
|
|
13
|
-
&& rm -rf /var/lib/apt/lists/*
|
|
14
|
-
|
|
15
|
-
# Verify GCC version
|
|
16
|
-
RUN gcc --version
|
|
17
|
-
|
|
18
|
-
# Set working directory
|
|
19
|
-
WORKDIR /app
|
|
20
|
-
|
|
21
|
-
# Copy source code
|
|
22
|
-
COPY . .
|
|
23
|
-
|
|
24
|
-
# Install bundler and dependencies
|
|
25
|
-
RUN gem install bundler
|
|
26
|
-
RUN bundle install
|
|
27
|
-
|
|
28
|
-
# Build and test
|
|
29
|
-
RUN if [ "${USE_SYSTEM_BROTLI}" = "true" ]; then \
|
|
30
|
-
echo "Building with system Brotli" && \
|
|
31
|
-
bundle exec rake compile; \
|
|
32
|
-
else \
|
|
33
|
-
echo "Building with vendor Brotli" && \
|
|
34
|
-
bundle exec rake compile -- --enable-vendor; \
|
|
35
|
-
fi
|
|
36
|
-
RUN bundle exec rake test
|
|
37
|
-
|
|
38
|
-
CMD ["bash"]
|
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
require "bundler/setup"
|
|
2
|
-
require "bundler/gem_tasks"
|
|
3
|
-
require "rake/clean"
|
|
4
|
-
require "rake/testtask"
|
|
5
|
-
require "rake/extensiontask"
|
|
6
|
-
|
|
7
|
-
CLEAN.include("ext/brotli/common")
|
|
8
|
-
CLEAN.include("ext/brotli/dec")
|
|
9
|
-
CLEAN.include("ext/brotli/enc")
|
|
10
|
-
CLEAN.include("ext/brotli/include")
|
|
11
|
-
|
|
12
|
-
Rake::TestTask.new(:test) do |t|
|
|
13
|
-
t.libs << "test"
|
|
14
|
-
t.test_files = FileList["test/**/*_test.rb"]
|
|
15
|
-
t.warning = true
|
|
16
|
-
t.verbose = true
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
Rake::ExtensionTask.new("brotli") do |ext|
|
|
20
|
-
ext.lib_dir = "lib/brotli"
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
task :build => :compile
|
|
24
|
-
task :test => :compile
|
|
25
|
-
task :default => :test
|
|
26
|
-
|
|
27
|
-
task :docker do
|
|
28
|
-
gcc_versions = ["14", "15"]
|
|
29
|
-
brotli_configs = [true, false]
|
|
30
|
-
gcc_versions.product(brotli_configs).each do |gcc_version, use_system_brotli|
|
|
31
|
-
command = "docker build "\
|
|
32
|
-
"--progress=plain "\
|
|
33
|
-
"--build-arg GCC_VERSION=#{gcc_version} "\
|
|
34
|
-
"--build-arg USE_SYSTEM_BROTLI=#{use_system_brotli} "\
|
|
35
|
-
"-t brotli:#{gcc_version}#{use_system_brotli ? "-use_system_brotli" : ""} ."
|
|
36
|
-
puts "Running: #{command}"
|
|
37
|
-
system command
|
|
38
|
-
unless $?.exited?
|
|
39
|
-
raise "Docker build failed for GCC version #{gcc_version} with use_system_brotli=#{use_system_brotli}"
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
data/bin/before_install.sh
DELETED
data/bin/console
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "brotli"
|
|
5
|
-
|
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
-
|
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
# require "pry"
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
|
-
require "irb"
|
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
data/brotli.gemspec
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require "brotli/version"
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name = "brotli"
|
|
8
|
-
spec.version = Brotli::VERSION
|
|
9
|
-
spec.authors = ["miyucy"]
|
|
10
|
-
spec.email = ["fistfvck@gmail.com"]
|
|
11
|
-
|
|
12
|
-
spec.summary = "Brotli compressor/decompressor"
|
|
13
|
-
spec.description = "Brotli compressor/decompressor"
|
|
14
|
-
spec.homepage = "https://github.com/miyucy/brotli"
|
|
15
|
-
spec.license = "MIT"
|
|
16
|
-
|
|
17
|
-
spec.test_files = `git ls-files -z -- test`.split("\x0")
|
|
18
|
-
spec.files = `git ls-files -z`.split("\x0")
|
|
19
|
-
spec.files -= spec.test_files
|
|
20
|
-
spec.files -= ["vendor/brotli"]
|
|
21
|
-
spec.files += Dir["vendor/brotli/c/{common,enc,dec,include}/**/*"]
|
|
22
|
-
spec.files += ["vendor/brotli/LICENSE"]
|
|
23
|
-
spec.bindir = "exe"
|
|
24
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
25
|
-
spec.require_paths = ["lib"]
|
|
26
|
-
spec.extensions = ["ext/brotli/extconf.rb"]
|
|
27
|
-
end
|
data/smoke.sh
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
gem list | grep brotli && gem uninstall --force brotli
|
|
3
|
-
bundle exec rake clobber build
|
|
4
|
-
gem install --force --local "$(ls pkg/brotli-*.gem)"
|
|
5
|
-
cat <<EOF | ruby
|
|
6
|
-
require 'brotli'
|
|
7
|
-
abort if Brotli.inflate(Brotli.deflate(File.read('smoke.sh'))) != File.read('smoke.sh')
|
|
8
|
-
EOF
|