brotli 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +11 -0
- data/brotli.gemspec +1 -0
- data/ext/brotli/brotli.cc +30 -6
- data/lib/brotli/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd4d6db73c2704ff5b79264456b8ae9f371beb36
|
4
|
+
data.tar.gz: 33b074ac4545d43ed2aeb00713573754e24cb4c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 536ba6e984a19db3e78f434f9f1b9b91cb90c5d7d1e0bbf84ee436382c05afee7e4912ae3ee03c37bbf732d9d59bc6be80f55dbf0fc245256c14cae264b87fad
|
7
|
+
data.tar.gz: 553ae97d40b5df932133af25c3075194a0754b56e0e2fe233302918b94c2cc0aeaf5373f18e74e3bb798bca68e3bbf30d34c35f04a21319880c6043e1052efe2
|
data/.travis.yml
CHANGED
data/brotli.gemspec
CHANGED
data/ext/brotli/brotli.cc
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "brotli.h"
|
2
|
+
#include "ruby/thread.h"
|
2
3
|
|
3
4
|
#define CSTR2SYM(x) ID2SYM(rb_intern(x))
|
4
5
|
|
@@ -121,6 +122,27 @@ brotli_deflate_parse_options(brotli::BrotliParams& params, VALUE opts)
|
|
121
122
|
}
|
122
123
|
}
|
123
124
|
|
125
|
+
struct brotli_deflate_args_t
|
126
|
+
{
|
127
|
+
char *str;
|
128
|
+
size_t str_length;
|
129
|
+
brotli::BrotliParams *params;
|
130
|
+
std::string buf;
|
131
|
+
|
132
|
+
} brotli_deflate_args_t;
|
133
|
+
|
134
|
+
static void *
|
135
|
+
brotli_deflate_no_gvl(void *arg)
|
136
|
+
{
|
137
|
+
struct brotli_deflate_args_t *args = (struct brotli_deflate_args_t *)arg;
|
138
|
+
|
139
|
+
brotli::BrotliMemIn in(args->str, args->str_length);
|
140
|
+
args->buf.reserve(args->str_length * 2 + 1);
|
141
|
+
brotli::BrotliStringOut out(&args->buf, args->buf.capacity());
|
142
|
+
|
143
|
+
return (void *)(bool)brotli::BrotliCompress(*(args->params), &in, &out);
|
144
|
+
}
|
145
|
+
|
124
146
|
static VALUE
|
125
147
|
brotli_deflate(int argc, VALUE *argv, VALUE self)
|
126
148
|
{
|
@@ -134,15 +156,17 @@ brotli_deflate(int argc, VALUE *argv, VALUE self)
|
|
134
156
|
brotli_deflate_parse_options(params, opts);
|
135
157
|
}
|
136
158
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
159
|
+
struct brotli_deflate_args_t args = {
|
160
|
+
RSTRING_PTR(str),
|
161
|
+
RSTRING_LEN(str),
|
162
|
+
¶ms
|
163
|
+
};
|
164
|
+
if (!rb_thread_call_without_gvl(brotli_deflate_no_gvl, (void *)&args, NULL, NULL)) {
|
142
165
|
rb_raise(rb_eBrotli, "ERROR");
|
143
166
|
}
|
144
167
|
|
145
|
-
|
168
|
+
|
169
|
+
return rb_str_new(args.buf.c_str(), args.buf.size());
|
146
170
|
}
|
147
171
|
|
148
172
|
extern "C" {
|
data/lib/brotli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brotli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- miyucy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rantly
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Brotli compressor/decompressor
|
70
84
|
email:
|
71
85
|
- fistfvck@gmail.com
|
@@ -173,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
187
|
version: '0'
|
174
188
|
requirements: []
|
175
189
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.6.
|
190
|
+
rubygems_version: 2.6.8
|
177
191
|
signing_key:
|
178
192
|
specification_version: 4
|
179
193
|
summary: Brotli compressor/decompressor
|