ruby-brs 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 779dc2709fa1dc4c1316cafb41ec7ca289ddab6e3e93302c8c9d730d5e13062c
4
- data.tar.gz: b9e44118ae67ccc3ddc80a4976c946ef1b4d0801192b5b2f7f286bbf7b6f1446
3
+ metadata.gz: 76cee1124501f374a5f27ca52ecd1b632058bfb3136e2fa3c1f447ae292d9f23
4
+ data.tar.gz: 4436a321a655174132a371e8140a892f18fcd365efbd4fd3da4ee2f1683d2c19
5
5
  SHA512:
6
- metadata.gz: fd2f3127fa61d8e5d1523c331edbb96823976622d81ba61ff4d10965ed9f536773a2abbea59c3fd1a03b9d6df9b4fbe9662a0d47cdaed5aa19e481544cc9952a
7
- data.tar.gz: d487532c19995e7307f68b1b5ccc091e9445e02b8a53c3c9039765e8fbb6dd11960563d6860aaba236dc7b7b424674d12f471163cd52940511dbd4803799a250
6
+ metadata.gz: 1b9d0d1bead338ba24ee95dad6c6387a8ab31bb1e037147d4c15955176eaf1314120b1c0ced1bc68dc6c7c498ade16b22be90f0d89b76eaf31542c48c562ac09
7
+ data.tar.gz: 470a2e6fab1f66d787d92dc352094f2c34e9c0f788545bc08a3643e3cc4faa6369804c24ec5499666894b130600630e9455b70f5c0b2c9b38148eb979111f188
data/README.md CHANGED
@@ -1,13 +1,14 @@
1
1
  # Ruby bindings for brotli library
2
2
 
3
- [![Travis build status](https://travis-ci.org/andrew-aladev/ruby-brs.svg?branch=master)](https://travis-ci.org/andrew-aladev/ruby-brs)
4
- [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/andrew-aladev/ruby-brs?branch=master&svg=true)](https://ci.appveyor.com/project/andrew-aladev/ruby-brs/branch/master)
3
+ | Travis | AppVeyor | Cirrus | Circle |
4
+ | :---: | :---: | :---: | :---: |
5
+ | [![Travis test status](https://travis-ci.com/andrew-aladev/ruby-brs.svg?branch=master)](https://travis-ci.com/andrew-aladev/ruby-brs) | [![AppVeyor test status](https://ci.appveyor.com/api/projects/status/github/andrew-aladev/ruby-brs?branch=master&svg=true)](https://ci.appveyor.com/project/andrew-aladev/ruby-brs/branch/master) | [![Cirrus test status](https://api.cirrus-ci.com/github/andrew-aladev/ruby-brs.svg?branch=master)](https://cirrus-ci.com/github/andrew-aladev/ruby-brs) | [![Circle test status](https://circleci.com/gh/andrew-aladev/ruby-brs/tree/master.svg?style=shield)](https://circleci.com/gh/andrew-aladev/ruby-brs/tree/master) |
5
6
 
6
7
  See [brotli library](https://github.com/google/brotli).
7
8
 
8
9
  ## Installation
9
10
 
10
- Please install brotli library first.
11
+ Please install brotli library first, use latest 1.0.0+ version.
11
12
 
12
13
  ```sh
13
14
  gem install ruby-brs
@@ -79,25 +80,25 @@ Values: 0 - infinity, default value: 0.
79
80
  :mode
80
81
  ```
81
82
 
82
- Values: [`:text`, `:font`, `:generic`], default value: `:generic`.
83
+ Values: `BRS::Option::MODES`, default value: `:generic`.
83
84
 
84
85
  ```
85
86
  :quality
86
87
  ```
87
88
 
88
- Values: 0 - 11, default value: 11.
89
+ Values: `BRS::Option::MIN_QUALITY` - `BRS::Option::MAX_QUALITY`, default value: `BRS::Option::MAX_QUALITY`.
89
90
 
90
91
  ```
91
92
  :lgwin
92
93
  ```
93
94
 
94
- Values: 10 - 24, default value: 22.
95
+ Values: `BRS::Option::MIN_LGWIN` - `BRS::Option::MAX_LGWIN`, default value: `22`.
95
96
 
96
97
  ```
97
98
  :lgblock
98
99
  ```
99
100
 
100
- Values: 16 - 24, default value: none.
101
+ Values: `BRS::Option::MIN_LGBLOCK` - `BRS::Option::MAX_LGBLOCK`, default value: none.
101
102
 
102
103
  ```
103
104
  :disable_literal_context_modeling
@@ -116,6 +117,8 @@ Values: true/false, default value: false.
116
117
  ```
117
118
 
118
119
  Values: 0 - infinity, default value: 0.
120
+ It is reasonable to provide size of input (if known) for streaming api.
121
+ `String` and `File` will set `:size_hint` automaticaly.
119
122
 
120
123
  ```
121
124
  :large_window
@@ -151,7 +154,7 @@ data = BRS::String.compress "sample string", :quality => 5
151
154
  puts BRS::String.decompress(data, :disable_ring_buffer_reallocation => true)
152
155
  ```
153
156
 
154
- Default options are compatible with HTTP (`Content-Encoding: br`):
157
+ HTTP encoding (`Content-Encoding: br`) using default options:
155
158
 
156
159
  ```ruby
157
160
  require "brs"
@@ -198,6 +201,8 @@ Writer maintains destination buffer only, so it accepts `destination_buffer_leng
198
201
  Open file path and create stream writer associated with opened file.
199
202
  Data will be transcoded to `:external_encoding` using `:transcode_options` before compressing.
200
203
 
204
+ It may be tricky to use both `:size_hint` and `:transcode_options`. You have to provide size of transcoded input.
205
+
201
206
  ```
202
207
  ::new(destination_io, options = {}, :external_encoding => nil, :transcode_options => {})
203
208
  ```
@@ -205,6 +210,8 @@ Data will be transcoded to `:external_encoding` using `:transcode_options` befor
205
210
  Create stream writer associated with destination io.
206
211
  Data will be transcoded to `:external_encoding` using `:transcode_options` before compressing.
207
212
 
213
+ It may be tricky to use both `:size_hint` and `:transcode_options`. You have to provide size of transcoded input.
214
+
208
215
  ```
209
216
  #set_encoding(external_encoding, nil, transcode_options)
210
217
  ```
@@ -334,6 +341,12 @@ See [`IO`](https://ruby-doc.org/core-2.6.1/IO.html) docs.
334
341
 
335
342
  Typical helpers, see [`Zlib::GzipReader`](https://ruby-doc.org/stdlib-2.6.1/libdoc/zlib/rdoc/Zlib/GzipReader.html) docs.
336
343
 
344
+ ## CI
345
+
346
+ Travis and Appveyor CI uses [scripts/ci_test.sh](scripts/ci_test.sh) directly.
347
+ Cirrus and Circle CI uses prebuilt [scripts/test-images](scripts/test-images).
348
+ Cirrus CI uses amd64 image, Circle CI - i686.
349
+
337
350
  ## License
338
351
 
339
352
  MIT license, see LICENSE and AUTHORS.
data/ext/brs_ext/buffer.c CHANGED
@@ -5,12 +5,24 @@
5
5
 
6
6
  #include "ruby.h"
7
7
 
8
+ VALUE brs_ext_create_string_buffer(VALUE length)
9
+ {
10
+ return rb_str_new(NULL, NUM2SIZET(length));
11
+ }
12
+
13
+ VALUE brs_ext_resize_string_buffer(VALUE args)
14
+ {
15
+ VALUE buffer = rb_ary_entry(args, 0);
16
+ VALUE length = rb_ary_entry(args, 1);
17
+ return rb_str_resize(buffer, NUM2SIZET(length));
18
+ }
19
+
8
20
  void brs_ext_buffer_exports(VALUE root_module)
9
21
  {
10
- VALUE option = rb_define_module_under(root_module, "Buffer");
22
+ VALUE module = rb_define_module_under(root_module, "Buffer");
11
23
 
12
- rb_define_const(option, "DEFAULT_SOURCE_BUFFER_LENGTH_FOR_COMPRESSOR", UINT2NUM(BRS_DEFAULT_SOURCE_BUFFER_LENGTH_FOR_COMPRESSOR));
13
- rb_define_const(option, "DEFAULT_DESTINATION_BUFFER_LENGTH_FOR_COMPRESSOR", UINT2NUM(BRS_DEFAULT_DESTINATION_BUFFER_LENGTH_FOR_COMPRESSOR));
14
- rb_define_const(option, "DEFAULT_SOURCE_BUFFER_LENGTH_FOR_DECOMPRESSOR", UINT2NUM(BRS_DEFAULT_SOURCE_BUFFER_LENGTH_FOR_DECOMPRESSOR));
15
- rb_define_const(option, "DEFAULT_DESTINATION_BUFFER_LENGTH_FOR_DECOMPRESSOR", UINT2NUM(BRS_DEFAULT_DESTINATION_BUFFER_LENGTH_FOR_DECOMPRESSOR));
24
+ rb_define_const(module, "DEFAULT_SOURCE_BUFFER_LENGTH_FOR_COMPRESSOR", SIZET2NUM(BRS_DEFAULT_SOURCE_BUFFER_LENGTH_FOR_COMPRESSOR));
25
+ rb_define_const(module, "DEFAULT_DESTINATION_BUFFER_LENGTH_FOR_COMPRESSOR", SIZET2NUM(BRS_DEFAULT_DESTINATION_BUFFER_LENGTH_FOR_COMPRESSOR));
26
+ rb_define_const(module, "DEFAULT_SOURCE_BUFFER_LENGTH_FOR_DECOMPRESSOR", SIZET2NUM(BRS_DEFAULT_SOURCE_BUFFER_LENGTH_FOR_DECOMPRESSOR));
27
+ rb_define_const(module, "DEFAULT_DESTINATION_BUFFER_LENGTH_FOR_DECOMPRESSOR", SIZET2NUM(BRS_DEFAULT_DESTINATION_BUFFER_LENGTH_FOR_DECOMPRESSOR));
16
28
  }
data/ext/brs_ext/buffer.h CHANGED
@@ -12,6 +12,18 @@
12
12
  #define BRS_DEFAULT_SOURCE_BUFFER_LENGTH_FOR_DECOMPRESSOR (1 << 16) // 64 KB
13
13
  #define BRS_DEFAULT_DESTINATION_BUFFER_LENGTH_FOR_DECOMPRESSOR (1 << 18) // 256 KB
14
14
 
15
+ VALUE brs_ext_create_string_buffer(VALUE length);
16
+
17
+ #define BRS_EXT_CREATE_STRING_BUFFER(buffer, length, exception) \
18
+ VALUE buffer = rb_protect(brs_ext_create_string_buffer, SIZET2NUM(length), &exception);
19
+
20
+ VALUE brs_ext_resize_string_buffer(VALUE args);
21
+
22
+ #define BRS_EXT_RESIZE_STRING_BUFFER(buffer, length, exception) \
23
+ VALUE args = rb_ary_new_from_args(2, buffer, SIZET2NUM(length)); \
24
+ buffer = rb_protect(brs_ext_resize_string_buffer, args, &exception); \
25
+ RB_GC_GUARD(args);
26
+
15
27
  void brs_ext_buffer_exports(VALUE root_module);
16
28
 
17
29
  #endif // BRS_EXT_BUFFER_H
data/ext/brs_ext/error.c CHANGED
@@ -47,9 +47,9 @@ static inline NORETURN(void raise(const char* name, const char* description))
47
47
  rb_raise(error, "%s", description);
48
48
  }
49
49
 
50
- void brs_ext_raise_error(brs_ext_result_t result)
50
+ void brs_ext_raise_error(brs_ext_result_t ext_result)
51
51
  {
52
- switch (result) {
52
+ switch (ext_result) {
53
53
  case BRS_EXT_ERROR_ALLOCATE_FAILED:
54
54
  raise("AllocateError", "allocate error");
55
55
  case BRS_EXT_ERROR_VALIDATE_FAILED:
data/ext/brs_ext/error.h CHANGED
@@ -29,6 +29,6 @@ enum {
29
29
 
30
30
  brs_ext_result_t brs_ext_get_decompressor_error(BrotliDecoderErrorCode error_code);
31
31
 
32
- NORETURN(void brs_ext_raise_error(brs_ext_result_t result));
32
+ NORETURN(void brs_ext_raise_error(brs_ext_result_t ext_result));
33
33
 
34
34
  #endif // BRS_EXT_ERROR_H
data/ext/brs_ext/io.c CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  #include <brotli/decode.h>
7
7
  #include <brotli/encode.h>
8
+ #include <brotli/types.h>
8
9
  #include <stdint.h>
9
10
  #include <stdio.h>
10
11
  #include <stdlib.h>
@@ -116,29 +117,43 @@ static inline brs_ext_result_t read_more_source(
116
117
  return 0;
117
118
  }
118
119
 
119
- #define BUFFERED_READ_SOURCE(function, ...) \
120
- while (true) { \
121
- ext_result = function(__VA_ARGS__); \
122
- if (ext_result != 0) { \
123
- return ext_result; \
124
- } \
125
- \
126
- ext_result = read_more_source( \
127
- source_file, \
128
- &source, &source_length, \
129
- source_buffer, source_buffer_length); \
130
- \
131
- if (ext_result == BRS_EXT_FILE_READ_FINISHED) { \
132
- if (source_length != 0) { \
133
- /* Brotli wont provide any remainder by design. */ \
134
- return BRS_EXT_ERROR_READ_IO; \
135
- } \
136
- break; \
137
- } \
138
- else if (ext_result != 0) { \
139
- return ext_result; \
140
- } \
141
- }
120
+ #define BUFFERED_READ_SOURCE(function, ...) \
121
+ do { \
122
+ bool is_function_called = false; \
123
+ \
124
+ while (true) { \
125
+ ext_result = read_more_source( \
126
+ source_file, \
127
+ &source, &source_length, \
128
+ source_buffer, source_buffer_length); \
129
+ \
130
+ if (ext_result == BRS_EXT_FILE_READ_FINISHED) { \
131
+ if (source_length != 0) { \
132
+ /* Brotli won't provide any remainder by design. */ \
133
+ return BRS_EXT_ERROR_READ_IO; \
134
+ } \
135
+ break; \
136
+ } \
137
+ else if (ext_result != 0) { \
138
+ return ext_result; \
139
+ } \
140
+ \
141
+ ext_result = function(__VA_ARGS__); \
142
+ if (ext_result != 0) { \
143
+ return ext_result; \
144
+ } \
145
+ \
146
+ is_function_called = true; \
147
+ } \
148
+ \
149
+ if (!is_function_called) { \
150
+ /* Function should be called at least once. */ \
151
+ ext_result = function(__VA_ARGS__); \
152
+ if (ext_result != 0) { \
153
+ return ext_result; \
154
+ } \
155
+ } \
156
+ } while (false);
142
157
 
143
158
  // Algorithm has written data into destination buffer.
144
159
  // We need to write this data into file.
@@ -192,6 +207,7 @@ static inline brs_ext_result_t buffered_compress(
192
207
  const uint8_t** source_ptr, size_t* source_length_ptr,
193
208
  FILE* destination_file, uint8_t* destination_buffer, size_t* destination_length_ptr, size_t destination_buffer_length)
194
209
  {
210
+ BROTLI_BOOL result;
195
211
  brs_ext_result_t ext_result;
196
212
 
197
213
  while (true) {
@@ -199,7 +215,7 @@ static inline brs_ext_result_t buffered_compress(
199
215
  size_t remaining_destination_buffer_length = destination_buffer_length - *destination_length_ptr;
200
216
  size_t prev_remaining_destination_buffer_length = remaining_destination_buffer_length;
201
217
 
202
- BROTLI_BOOL result = BrotliEncoderCompressStream(
218
+ result = BrotliEncoderCompressStream(
203
219
  state_ptr,
204
220
  BROTLI_OPERATION_PROCESS,
205
221
  source_length_ptr, source_ptr,
@@ -234,6 +250,7 @@ static inline brs_ext_result_t buffered_compressor_finish(
234
250
  BrotliEncoderState* state_ptr,
235
251
  FILE* destination_file, uint8_t* destination_buffer, size_t* destination_length_ptr, size_t destination_buffer_length)
236
252
  {
253
+ BROTLI_BOOL result;
237
254
  brs_ext_result_t ext_result;
238
255
 
239
256
  const uint8_t* source = NULL;
@@ -244,7 +261,7 @@ static inline brs_ext_result_t buffered_compressor_finish(
244
261
  size_t remaining_destination_buffer_length = destination_buffer_length - *destination_length_ptr;
245
262
  size_t prev_remaining_destination_buffer_length = remaining_destination_buffer_length;
246
263
 
247
- BROTLI_BOOL result = BrotliEncoderCompressStream(
264
+ result = BrotliEncoderCompressStream(
248
265
  state_ptr,
249
266
  BROTLI_OPERATION_FINISH,
250
267
  &source_length, &source,
@@ -368,14 +385,15 @@ static inline brs_ext_result_t buffered_decompress(
368
385
  const uint8_t** source_ptr, size_t* source_length_ptr,
369
386
  FILE* destination_file, uint8_t* destination_buffer, size_t* destination_length_ptr, size_t destination_buffer_length)
370
387
  {
371
- brs_ext_result_t ext_result;
388
+ BrotliDecoderResult result;
389
+ brs_ext_result_t ext_result;
372
390
 
373
391
  while (true) {
374
392
  uint8_t* remaining_destination_buffer = destination_buffer + *destination_length_ptr;
375
393
  size_t remaining_destination_buffer_length = destination_buffer_length - *destination_length_ptr;
376
394
  size_t prev_remaining_destination_buffer_length = remaining_destination_buffer_length;
377
395
 
378
- BrotliDecoderResult result = BrotliDecoderDecompressStream(
396
+ result = BrotliDecoderDecompressStream(
379
397
  state_ptr,
380
398
  source_length_ptr, source_ptr,
381
399
  &remaining_destination_buffer_length, &remaining_destination_buffer,
data/ext/brs_ext/option.c CHANGED
@@ -6,12 +6,14 @@
6
6
  #include <brotli/decode.h>
7
7
  #include <brotli/encode.h>
8
8
  #include <stdbool.h>
9
- #include <stdint.h>
9
+ #include <stdlib.h>
10
10
 
11
11
  #include "brs_ext/common.h"
12
12
  #include "brs_ext/error.h"
13
13
  #include "ruby.h"
14
14
 
15
+ // -- values --
16
+
15
17
  static inline VALUE get_raw_option_value(VALUE options, const char* name)
16
18
  {
17
19
  return rb_funcall(options, rb_intern("[]"), 1, ID2SYM(rb_intern(name)));
@@ -27,14 +29,14 @@ static inline bool get_bool_option_value(VALUE raw_value)
27
29
  return raw_type == T_TRUE;
28
30
  }
29
31
 
30
- static inline unsigned long get_fixnum_option_value(VALUE raw_value)
32
+ static inline unsigned int get_uint_option_value(VALUE raw_value)
31
33
  {
32
34
  Check_Type(raw_value, T_FIXNUM);
33
35
 
34
36
  return NUM2UINT(raw_value);
35
37
  }
36
38
 
37
- static inline uint_fast8_t get_mode_option_value(VALUE raw_value)
39
+ static inline BrotliEncoderMode get_mode_option_value(VALUE raw_value)
38
40
  {
39
41
  Check_Type(raw_value, T_SYMBOL);
40
42
 
@@ -68,8 +70,8 @@ void brs_ext_get_option(VALUE options, brs_ext_option_t* option, brs_ext_option_
68
70
  case BRS_EXT_OPTION_TYPE_BOOL:
69
71
  value = get_bool_option_value(raw_value) ? 1 : 0;
70
72
  break;
71
- case BRS_EXT_OPTION_TYPE_FIXNUM:
72
- value = (brs_ext_option_value_t)get_fixnum_option_value(raw_value);
73
+ case BRS_EXT_OPTION_TYPE_UINT:
74
+ value = (brs_ext_option_value_t)get_uint_option_value(raw_value);
73
75
  break;
74
76
  case BRS_EXT_OPTION_TYPE_MODE:
75
77
  value = (brs_ext_option_value_t)get_mode_option_value(raw_value);
@@ -81,13 +83,17 @@ void brs_ext_get_option(VALUE options, brs_ext_option_t* option, brs_ext_option_
81
83
  option->value = value;
82
84
  }
83
85
 
84
- unsigned long brs_ext_get_fixnum_option_value(VALUE options, const char* name)
86
+ size_t brs_ext_get_size_option_value(VALUE options, const char* name)
85
87
  {
86
88
  VALUE raw_value = get_raw_option_value(options, name);
87
89
 
88
- return get_fixnum_option_value(raw_value);
90
+ Check_Type(raw_value, T_FIXNUM);
91
+
92
+ return NUM2SIZET(raw_value);
89
93
  }
90
94
 
95
+ // -- set params --
96
+
91
97
  #define SET_OPTION_VALUE(function, state_ptr, param, option) \
92
98
  if (option.has_value && !function(state_ptr, param, option.value)) { \
93
99
  return BRS_EXT_ERROR_VALIDATE_FAILED; \
@@ -120,24 +126,25 @@ brs_ext_result_t brs_ext_set_decompressor_options(BrotliDecoderState* state_ptr,
120
126
  return 0;
121
127
  }
122
128
 
129
+ // -- exports --
130
+
131
+ #define EXPORT_PARAM_BOUNDS(module, param, name) \
132
+ rb_define_const(module, "MIN_" name, UINT2NUM(BROTLI_MIN_##param)); \
133
+ rb_define_const(module, "MAX_" name, UINT2NUM(BROTLI_MAX_##param));
134
+
123
135
  void brs_ext_option_exports(VALUE root_module)
124
136
  {
125
- VALUE option = rb_define_module_under(root_module, "Option");
137
+ VALUE module = rb_define_module_under(root_module, "Option");
126
138
 
127
139
  VALUE modes = rb_ary_new_from_args(
128
140
  3,
129
141
  ID2SYM(rb_intern("text")),
130
142
  ID2SYM(rb_intern("font")),
131
143
  ID2SYM(rb_intern("generic")));
132
- rb_define_const(option, "MODES", modes);
144
+ rb_define_const(module, "MODES", modes);
133
145
  RB_GC_GUARD(modes);
134
146
 
135
- rb_define_const(option, "MIN_QUALITY", UINT2NUM(BROTLI_MIN_QUALITY));
136
- rb_define_const(option, "MAX_QUALITY", UINT2NUM(BROTLI_MAX_QUALITY));
137
-
138
- rb_define_const(option, "MIN_LGWIN", UINT2NUM(BROTLI_MIN_WINDOW_BITS));
139
- rb_define_const(option, "MAX_LGWIN", UINT2NUM(BROTLI_MAX_WINDOW_BITS));
140
-
141
- rb_define_const(option, "MIN_LGBLOCK", UINT2NUM(BROTLI_MIN_INPUT_BLOCK_BITS));
142
- rb_define_const(option, "MAX_LGBLOCK", UINT2NUM(BROTLI_MAX_INPUT_BLOCK_BITS));
147
+ EXPORT_PARAM_BOUNDS(module, QUALITY, "QUALITY");
148
+ EXPORT_PARAM_BOUNDS(module, WINDOW_BITS, "LGWIN");
149
+ EXPORT_PARAM_BOUNDS(module, INPUT_BLOCK_BITS, "LGBLOCK");
143
150
  }
data/ext/brs_ext/option.h CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  enum {
20
20
  BRS_EXT_OPTION_TYPE_BOOL = 1,
21
- BRS_EXT_OPTION_TYPE_FIXNUM,
21
+ BRS_EXT_OPTION_TYPE_UINT,
22
22
  BRS_EXT_OPTION_TYPE_MODE
23
23
  };
24
24
 
@@ -54,11 +54,11 @@ void brs_ext_get_option(VALUE options, brs_ext_option_t* option, brs_ext_option_
54
54
  brs_ext_compressor_options_t compressor_options; \
55
55
  \
56
56
  BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_MODE, mode); \
57
- BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_FIXNUM, quality); \
58
- BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_FIXNUM, lgwin); \
59
- BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_FIXNUM, lgblock); \
57
+ BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_UINT, quality); \
58
+ BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_UINT, lgwin); \
59
+ BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_UINT, lgblock); \
60
60
  BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_BOOL, disable_literal_context_modeling); \
61
- BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_FIXNUM, size_hint); \
61
+ BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_UINT, size_hint); \
62
62
  BRS_EXT_GET_OPTION(options, compressor_options, BRS_EXT_OPTION_TYPE_BOOL, large_window);
63
63
 
64
64
  #define BRS_EXT_GET_DECOMPRESSOR_OPTIONS(options) \
@@ -67,10 +67,10 @@ void brs_ext_get_option(VALUE options, brs_ext_option_t* option, brs_ext_option_
67
67
  BRS_EXT_GET_OPTION(options, decompressor_options, BRS_EXT_OPTION_TYPE_BOOL, disable_ring_buffer_reallocation); \
68
68
  BRS_EXT_GET_OPTION(options, decompressor_options, BRS_EXT_OPTION_TYPE_BOOL, large_window);
69
69
 
70
- unsigned long brs_ext_get_fixnum_option_value(VALUE options, const char* name);
70
+ size_t brs_ext_get_size_option_value(VALUE options, const char* name);
71
71
 
72
72
  #define BRS_EXT_GET_BUFFER_LENGTH_OPTION(options, name) \
73
- size_t name = brs_ext_get_fixnum_option_value(options, #name);
73
+ size_t name = brs_ext_get_size_option_value(options, #name);
74
74
 
75
75
  brs_ext_result_t brs_ext_set_compressor_options(BrotliEncoderState* state_ptr, brs_ext_compressor_options_t* options);
76
76
  brs_ext_result_t brs_ext_set_decompressor_options(BrotliDecoderState* state_ptr, brs_ext_decompressor_options_t* options);
@@ -4,6 +4,7 @@
4
4
  #include "brs_ext/stream/compressor.h"
5
5
 
6
6
  #include <brotli/encode.h>
7
+ #include <brotli/types.h>
7
8
  #include <stdint.h>
8
9
  #include <stdlib.h>
9
10
 
@@ -116,7 +117,7 @@ VALUE brs_ext_compress(VALUE self, VALUE source_value)
116
117
  brs_ext_raise_error(BRS_EXT_ERROR_UNEXPECTED);
117
118
  }
118
119
 
119
- VALUE bytes_written = UINT2NUM(source_length - remaining_source_length);
120
+ VALUE bytes_written = SIZET2NUM(source_length - remaining_source_length);
120
121
  VALUE needs_more_destination = BrotliEncoderHasMoreOutput(state_ptr) ? Qtrue : Qfalse;
121
122
 
122
123
  return rb_ary_new_from_args(2, bytes_written, needs_more_destination);
@@ -221,9 +222,10 @@ VALUE brs_ext_compressor_close(VALUE self)
221
222
 
222
223
  void brs_ext_compressor_exports(VALUE root_module)
223
224
  {
224
- VALUE stream = rb_define_module_under(root_module, "Stream");
225
+ VALUE module = rb_define_module_under(root_module, "Stream");
226
+
227
+ VALUE compressor = rb_define_class_under(module, "NativeCompressor", rb_cObject);
225
228
 
226
- VALUE compressor = rb_define_class_under(stream, "NativeCompressor", rb_cObject);
227
229
  rb_define_alloc_func(compressor, brs_ext_allocate_compressor);
228
230
  rb_define_method(compressor, "initialize", brs_ext_initialize_compressor, 1);
229
231
  rb_define_method(compressor, "write", brs_ext_compress, 1);
@@ -117,10 +117,10 @@ VALUE brs_ext_decompress(VALUE self, VALUE source_value)
117
117
  brs_ext_raise_error(brs_ext_get_decompressor_error(error_code));
118
118
  }
119
119
 
120
- VALUE bytes_written = UINT2NUM(source_length - remaining_source_length);
120
+ VALUE bytes_read = SIZET2NUM(source_length - remaining_source_length);
121
121
  VALUE needs_more_destination = result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT ? Qtrue : Qfalse;
122
122
 
123
- return rb_ary_new_from_args(2, bytes_written, needs_more_destination);
123
+ return rb_ary_new_from_args(2, bytes_read, needs_more_destination);
124
124
  }
125
125
 
126
126
  VALUE brs_ext_decompressor_read_result(VALUE self)
@@ -170,9 +170,10 @@ VALUE brs_ext_decompressor_close(VALUE self)
170
170
 
171
171
  void brs_ext_decompressor_exports(VALUE root_module)
172
172
  {
173
- VALUE stream = rb_define_module_under(root_module, "Stream");
173
+ VALUE module = rb_define_module_under(root_module, "Stream");
174
+
175
+ VALUE decompressor = rb_define_class_under(module, "NativeDecompressor", rb_cObject);
174
176
 
175
- VALUE decompressor = rb_define_class_under(stream, "NativeDecompressor", rb_cObject);
176
177
  rb_define_alloc_func(decompressor, brs_ext_allocate_decompressor);
177
178
  rb_define_method(decompressor, "initialize", brs_ext_initialize_decompressor, 1);
178
179
  rb_define_method(decompressor, "read", brs_ext_decompress, 1);
data/ext/brs_ext/string.c CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  #include <brotli/decode.h>
7
7
  #include <brotli/encode.h>
8
+ #include <brotli/types.h>
8
9
  #include <stdint.h>
9
10
  #include <stdlib.h>
10
11
 
@@ -17,26 +18,6 @@
17
18
 
18
19
  // -- buffer --
19
20
 
20
- static inline VALUE create_buffer(VALUE length)
21
- {
22
- return rb_str_new(NULL, NUM2UINT(length));
23
- }
24
-
25
- #define CREATE_BUFFER(buffer, length, exception) \
26
- VALUE buffer = rb_protect(create_buffer, UINT2NUM(length), &exception);
27
-
28
- static inline VALUE resize_buffer(VALUE args)
29
- {
30
- VALUE buffer = rb_ary_entry(args, 0);
31
- VALUE length = rb_ary_entry(args, 1);
32
- return rb_str_resize(buffer, NUM2UINT(length));
33
- }
34
-
35
- #define RESIZE_BUFFER(buffer, length, exception) \
36
- VALUE resize_buffer_args = rb_ary_new_from_args(2, buffer, UINT2NUM(length)); \
37
- buffer = rb_protect(resize_buffer, resize_buffer_args, &exception); \
38
- RB_GC_GUARD(resize_buffer_args);
39
-
40
21
  static inline brs_ext_result_t increase_destination_buffer(
41
22
  VALUE destination_value, size_t destination_length,
42
23
  size_t* remaining_destination_buffer_length_ptr, size_t destination_buffer_length)
@@ -48,7 +29,7 @@ static inline brs_ext_result_t increase_destination_buffer(
48
29
 
49
30
  int exception;
50
31
 
51
- RESIZE_BUFFER(destination_value, destination_length + destination_buffer_length, exception);
32
+ BRS_EXT_RESIZE_STRING_BUFFER(destination_value, destination_length + destination_buffer_length, exception);
52
33
  if (exception != 0) {
53
34
  return BRS_EXT_ERROR_ALLOCATE_FAILED;
54
35
  }
@@ -60,23 +41,25 @@ static inline brs_ext_result_t increase_destination_buffer(
60
41
 
61
42
  // -- utils --
62
43
 
63
- #define GET_SOURCE_DATA(source_value) \
64
- Check_Type(source_value, T_STRING); \
65
- \
66
- const char* source = RSTRING_PTR(source_value); \
67
- size_t source_length = RSTRING_LEN(source_value); \
68
- const uint8_t* remaining_source = (const uint8_t*)source; \
69
- size_t remaining_source_length = source_length;
44
+ #define GET_SOURCE_DATA(source_value) \
45
+ Check_Type(source_value, T_STRING); \
46
+ \
47
+ const char* source = RSTRING_PTR(source_value); \
48
+ size_t source_length = RSTRING_LEN(source_value);
70
49
 
71
50
  // -- compress --
72
51
 
73
52
  static inline brs_ext_result_t compress(
74
53
  BrotliEncoderState* state_ptr,
75
- const uint8_t* remaining_source, size_t remaining_source_length,
54
+ const char* source, size_t source_length,
76
55
  VALUE destination_value, size_t destination_buffer_length)
77
56
  {
57
+ BROTLI_BOOL result;
78
58
  brs_ext_result_t ext_result;
79
59
 
60
+ const uint8_t* remaining_source = (const uint8_t*)source;
61
+ size_t remaining_source_length = source_length;
62
+
80
63
  size_t destination_length = 0;
81
64
  size_t remaining_destination_buffer_length = destination_buffer_length;
82
65
 
@@ -84,7 +67,7 @@ static inline brs_ext_result_t compress(
84
67
  uint8_t* remaining_destination_buffer = (uint8_t*)RSTRING_PTR(destination_value) + destination_length;
85
68
  size_t prev_remaining_destination_buffer_length = remaining_destination_buffer_length;
86
69
 
87
- BROTLI_BOOL result = BrotliEncoderCompressStream(
70
+ result = BrotliEncoderCompressStream(
88
71
  state_ptr,
89
72
  BROTLI_OPERATION_FINISH,
90
73
  &remaining_source_length, &remaining_source,
@@ -114,7 +97,7 @@ static inline brs_ext_result_t compress(
114
97
 
115
98
  int exception;
116
99
 
117
- RESIZE_BUFFER(destination_value, destination_length, exception);
100
+ BRS_EXT_RESIZE_STRING_BUFFER(destination_value, destination_length, exception);
118
101
  if (exception != 0) {
119
102
  return BRS_EXT_ERROR_ALLOCATE_FAILED;
120
103
  }
@@ -146,7 +129,7 @@ VALUE brs_ext_compress_string(VALUE BRS_EXT_UNUSED(self), VALUE source_value, VA
146
129
 
147
130
  int exception;
148
131
 
149
- CREATE_BUFFER(destination_value, destination_buffer_length, exception);
132
+ BRS_EXT_CREATE_STRING_BUFFER(destination_value, destination_buffer_length, exception);
150
133
  if (exception != 0) {
151
134
  BrotliEncoderDestroyInstance(state_ptr);
152
135
  brs_ext_raise_error(BRS_EXT_ERROR_ALLOCATE_FAILED);
@@ -154,7 +137,7 @@ VALUE brs_ext_compress_string(VALUE BRS_EXT_UNUSED(self), VALUE source_value, VA
154
137
 
155
138
  ext_result = compress(
156
139
  state_ptr,
157
- remaining_source, remaining_source_length,
140
+ source, source_length,
158
141
  destination_value, destination_buffer_length);
159
142
 
160
143
  BrotliEncoderDestroyInstance(state_ptr);
@@ -170,10 +153,14 @@ VALUE brs_ext_compress_string(VALUE BRS_EXT_UNUSED(self), VALUE source_value, VA
170
153
 
171
154
  static inline brs_ext_result_t decompress(
172
155
  BrotliDecoderState* state_ptr,
173
- const uint8_t* remaining_source, size_t remaining_source_length,
156
+ const char* source, size_t source_length,
174
157
  VALUE destination_value, size_t destination_buffer_length)
175
158
  {
176
- brs_ext_result_t ext_result;
159
+ BrotliDecoderResult result;
160
+ brs_ext_result_t ext_result;
161
+
162
+ const uint8_t* remaining_source = (const uint8_t*)source;
163
+ size_t remaining_source_length = source_length;
177
164
 
178
165
  size_t destination_length = 0;
179
166
  size_t remaining_destination_buffer_length = destination_buffer_length;
@@ -182,7 +169,7 @@ static inline brs_ext_result_t decompress(
182
169
  uint8_t* remaining_destination_buffer = (uint8_t*)RSTRING_PTR(destination_value) + destination_length;
183
170
  size_t prev_remaining_destination_buffer_length = remaining_destination_buffer_length;
184
171
 
185
- BrotliDecoderResult result = BrotliDecoderDecompressStream(
172
+ result = BrotliDecoderDecompressStream(
186
173
  state_ptr,
187
174
  &remaining_source_length, &remaining_source,
188
175
  &remaining_destination_buffer_length, &remaining_destination_buffer,
@@ -215,7 +202,7 @@ static inline brs_ext_result_t decompress(
215
202
 
216
203
  int exception;
217
204
 
218
- RESIZE_BUFFER(destination_value, destination_length, exception);
205
+ BRS_EXT_RESIZE_STRING_BUFFER(destination_value, destination_length, exception);
219
206
  if (exception != 0) {
220
207
  brs_ext_raise_error(BRS_EXT_ERROR_ALLOCATE_FAILED);
221
208
  }
@@ -247,7 +234,7 @@ VALUE brs_ext_decompress_string(VALUE BRS_EXT_UNUSED(self), VALUE source_value,
247
234
 
248
235
  int exception;
249
236
 
250
- CREATE_BUFFER(destination_value, destination_buffer_length, exception);
237
+ BRS_EXT_CREATE_STRING_BUFFER(destination_value, destination_buffer_length, exception);
251
238
  if (exception != 0) {
252
239
  BrotliDecoderDestroyInstance(state_ptr);
253
240
  brs_ext_raise_error(BRS_EXT_ERROR_ALLOCATE_FAILED);
@@ -255,7 +242,7 @@ VALUE brs_ext_decompress_string(VALUE BRS_EXT_UNUSED(self), VALUE source_value,
255
242
 
256
243
  ext_result = decompress(
257
244
  state_ptr,
258
- remaining_source, remaining_source_length,
245
+ source, source_length,
259
246
  destination_value, destination_buffer_length);
260
247
 
261
248
  BrotliDecoderDestroyInstance(state_ptr);
data/ext/extconf.rb CHANGED
@@ -3,46 +3,52 @@
3
3
 
4
4
  require "mkmf"
5
5
 
6
- def require_header(name)
6
+ def require_header(name, types = [])
7
7
  abort "Can't find #{name} header" unless find_header name
8
+
9
+ types.each do |type|
10
+ abort "Can't find #{type} type in #{name} header" unless find_type type, nil, name
11
+ end
8
12
  end
9
13
 
10
- require_header "brotli/encode.h"
11
- require_header "brotli/decode.h"
14
+ require_header "brotli/types.h", %w[BROTLI_BOOL]
15
+ require_header "brotli/encode.h", ["BrotliEncoderState *", "BrotliEncoderMode"]
16
+ require_header "brotli/decode.h", ["BrotliDecoderState *", "BrotliDecoderResult", "BrotliDecoderErrorCode"]
12
17
 
13
18
  def require_library(name, functions)
14
19
  functions.each do |function|
15
- abort "Can't find #{name} library and #{function} function" unless find_library name, function
20
+ abort "Can't find #{function} function in #{name} library" unless find_library name, function
16
21
  end
17
22
  end
18
23
 
19
- encoder_functions = %w[
20
- BrotliEncoderCreateInstance
21
- BrotliEncoderSetParameter
22
- BrotliEncoderCompressStream
23
- BrotliEncoderHasMoreOutput
24
- BrotliEncoderIsFinished
25
- BrotliEncoderDestroyInstance
26
- ]
27
- .freeze
24
+ require_library(
25
+ "brotlienc",
26
+ %w[
27
+ BrotliEncoderCreateInstance
28
+ BrotliEncoderSetParameter
29
+ BrotliEncoderCompressStream
30
+ BrotliEncoderHasMoreOutput
31
+ BrotliEncoderIsFinished
32
+ BrotliEncoderDestroyInstance
33
+ ]
34
+ )
28
35
 
29
- require_library "brotlienc", encoder_functions
30
-
31
- decoder_functions = %w[
32
- BrotliDecoderCreateInstance
33
- BrotliDecoderSetParameter
34
- BrotliDecoderDecompressStream
35
- BrotliDecoderGetErrorCode
36
- BrotliDecoderDestroyInstance
37
- ]
38
- .freeze
39
-
40
- require_library "brotlidec", decoder_functions
36
+ require_library(
37
+ "brotlidec",
38
+ %w[
39
+ BrotliDecoderCreateInstance
40
+ BrotliDecoderSetParameter
41
+ BrotliDecoderDecompressStream
42
+ BrotliDecoderGetErrorCode
43
+ BrotliDecoderDestroyInstance
44
+ ]
45
+ )
41
46
 
42
47
  extension_name = "brs_ext".freeze
43
48
  dir_config extension_name
44
49
 
45
- sources = %w[
50
+ # rubocop:disable Style/GlobalVars
51
+ $srcs = %w[
46
52
  stream/compressor
47
53
  stream/decompressor
48
54
  buffer
@@ -52,13 +58,9 @@ sources = %w[
52
58
  option
53
59
  string
54
60
  ]
61
+ .map { |name| "src/#{extension_name}/#{name}.c" }
55
62
  .freeze
56
63
 
57
- # rubocop:disable Style/GlobalVars
58
- $srcs = sources
59
- .map { |name| "src/#{extension_name}/#{name}.c" }
60
- .freeze
61
-
62
64
  $CFLAGS << " -Wno-declaration-after-statement"
63
65
  $VPATH << "$(srcdir)/#{extension_name}:$(srcdir)/#{extension_name}/stream"
64
66
  # rubocop:enable Style/GlobalVars
data/lib/brs/file.rb CHANGED
@@ -17,6 +17,8 @@ module BRS
17
17
 
18
18
  options = Option.get_compressor_options options, BUFFER_LENGTH_NAMES
19
19
 
20
+ options[:size_hint] = ::File.size source
21
+
20
22
  open_files(source, destination) do |source_io, destination_io|
21
23
  BRS._native_compress_io source_io, destination_io, options
22
24
  end
data/lib/brs/option.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # Ruby bindings for brotli library.
2
2
  # Copyright (c) 2019 AUTHORS, MIT License.
3
3
 
4
+ require "brs_ext"
5
+
4
6
  require_relative "error"
5
7
  require_relative "validation"
6
8
 
@@ -14,7 +16,6 @@ module BRS
14
16
  :lgwin => nil,
15
17
  :lgblock => nil,
16
18
  :disable_literal_context_modeling => nil,
17
- :size_hint => nil,
18
19
  :large_window => nil
19
20
  }
20
21
  .freeze
@@ -40,20 +41,26 @@ module BRS
40
41
  end
41
42
 
42
43
  quality = options[:quality]
43
- Validation.validate_not_negative_integer quality unless quality.nil?
44
+ unless quality.nil?
45
+ Validation.validate_not_negative_integer quality
46
+ raise ValidateError, "invalid quality" if quality < MIN_QUALITY || quality > MAX_QUALITY
47
+ end
44
48
 
45
49
  lgwin = options[:lgwin]
46
- Validation.validate_not_negative_integer lgwin unless lgwin.nil?
50
+ unless lgwin.nil?
51
+ Validation.validate_not_negative_integer lgwin
52
+ raise ValidateError, "invalid lgwin" if lgwin < MIN_LGWIN || lgwin > MAX_LGWIN
53
+ end
47
54
 
48
55
  lgblock = options[:lgblock]
49
- Validation.validate_not_negative_integer lgblock unless lgblock.nil?
56
+ unless lgblock.nil?
57
+ Validation.validate_not_negative_integer lgblock
58
+ raise ValidateError, "invalid lgblock" if lgblock < MIN_LGBLOCK || lgblock > MAX_LGBLOCK
59
+ end
50
60
 
51
61
  disable_literal_context_modeling = options[:disable_literal_context_modeling]
52
62
  Validation.validate_bool disable_literal_context_modeling unless disable_literal_context_modeling.nil?
53
63
 
54
- size_hint = options[:size_hint]
55
- Validation.validate_not_negative_integer size_hint unless size_hint.nil?
56
-
57
64
  large_window = options[:large_window]
58
65
  Validation.validate_bool large_window unless large_window.nil?
59
66
 
@@ -15,7 +15,11 @@ module BRS
15
15
  BUFFER_LENGTH_NAMES = %i[destination_buffer_length].freeze
16
16
 
17
17
  def initialize(options = {})
18
- options = Option.get_compressor_options options, BUFFER_LENGTH_NAMES
18
+ options = Option.get_compressor_options options, BUFFER_LENGTH_NAMES
19
+
20
+ size_hint = options[:size_hint]
21
+ Validation.validate_not_negative_integer size_hint unless size_hint.nil?
22
+
19
23
  native_stream = NativeCompressor.new options
20
24
 
21
25
  super native_stream
data/lib/brs/string.rb CHANGED
@@ -15,6 +15,8 @@ module BRS
15
15
 
16
16
  options = Option.get_compressor_options options, BUFFER_LENGTH_NAMES
17
17
 
18
+ options[:size_hint] = source.bytesize
19
+
18
20
  BRS._native_compress_string source, options
19
21
  end
20
22
 
data/lib/brs/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # Copyright (c) 2019 AUTHORS, MIT License.
3
3
 
4
4
  module BRS
5
- VERSION = "1.0.1".freeze
5
+ VERSION = "1.1.0".freeze
6
6
  end
data/lib/brs.rb CHANGED
@@ -5,3 +5,4 @@ require_relative "brs/stream/reader"
5
5
  require_relative "brs/stream/writer"
6
6
  require_relative "brs/file"
7
7
  require_relative "brs/string"
8
+ require_relative "brs/version"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-brs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Aladjev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-12 00:00:00.000000000 Z
11
+ date: 2019-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitar
@@ -16,28 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
19
+ version: '0.9'
20
20
  type: :development
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: '0.8'
26
+ version: '0.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '5.11'
33
+ version: '5.12'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.11'
40
+ version: '5.12'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ocg
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.1'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.1'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake-compiler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -58,42 +72,42 @@ dependencies:
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '0.74'
75
+ version: '0.75'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '0.74'
82
+ version: '0.75'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rubocop-performance
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: '1.4'
89
+ version: '1.5'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: '1.4'
96
+ version: '1.5'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rubocop-rails
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: '2.2'
103
+ version: '2.3'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: '2.2'
110
+ version: '2.3'
97
111
  description:
98
112
  email: aladjev.andrew@gmail.com
99
113
  executables: []