multi_string_replace 1.0.4 → 1.0.5

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: '03680f4522d98a7a162df95c1151feedabe821febc15a03c7a98a6996dd43cc1'
4
- data.tar.gz: 80222e5675b3310fd079e6099026f8fa584d77542a0a34a30a3c6c3c67643cdb
3
+ metadata.gz: ce55106984f5b33c6b5dfe633fffb82c42cab34a1bd0516ef98025e8498bd172
4
+ data.tar.gz: cf3fc9d870bbf27f7d6869fefe0e2513871b2fb667ce83812b7e5630f9c06530
5
5
  SHA512:
6
- metadata.gz: 6bcda8e829e5fd9e747c567a44c09363f304bbc8162d661418fb491f6626019c158d8a60345bb814cab42598c3830d884e6b8b70b20215d9614cb36d6913928e
7
- data.tar.gz: 3f2895d64ba1d7560e866104f499a592767fa1dd161c1ff3d975126091d8330f06e85e25f37182de46f05c5dcb51a3f8ed4e38b352b78c8a1955dde1fdca5396
6
+ metadata.gz: cae97ff557266b797ea98e429218d0d39c95ad898d81cb82015746f80316cbe7f671af556c9b11f670730806370896a302f314290b026420a5e04d4e9e0226f1
7
+ data.tar.gz: f3e5e05f96c38df6f9f1782f03f76ba68d77e4f1aa278bcc902bbaeeff363922116d05b3c58fa492525c51db26c923a4bfdbdad3bba1cae39fbf380bccd8564f
@@ -226,7 +226,7 @@ VALUE aho_replace_text(struct ahocorasick * restrict aho, const char* data,
226
226
  last_concat_pos = i + 1;
227
227
  }
228
228
 
229
- if (last_concat_pos < data_len - 1) {
229
+ if (last_concat_pos < data_len) {
230
230
  rb_str_cat(main_result, &data[last_concat_pos], data_len - last_concat_pos);
231
231
  }
232
232
 
@@ -55,6 +55,7 @@ VALUE multi_string_match(VALUE self, VALUE body, VALUE keys)
55
55
 
56
56
  aho_create_trie(&aho);
57
57
  aho_register_match_callback(result, &aho, callback_match_pos, (void*)target);
58
+
58
59
  aho_findtext(&aho, target, RSTRING_LEN(body));
59
60
  aho_destroy(&aho);
60
61
  return result;
@@ -99,7 +100,6 @@ VALUE multi_string_replace(VALUE self, VALUE body, VALUE replace)
99
100
  aho_add_match_text(&aho, StringValuePtr(entry), RSTRING_LEN(entry));
100
101
  }
101
102
  aho_create_trie(&aho);
102
-
103
103
  VALUE result = aho_replace_text(&aho, target, RSTRING_LEN(body), values, value_sizes, ruby_val);
104
104
  aho_destroy(&aho);
105
105
  return result;
@@ -1,3 +1,3 @@
1
1
  module MultiStringReplace
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_string_replace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Dayo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -87,6 +87,7 @@ files:
87
87
  - bin/benchmark.rb
88
88
  - bin/console
89
89
  - bin/setup
90
+ - ext/multi_string_replace/.sitearchdir.-.multi_string_replace.time
90
91
  - ext/multi_string_replace/aho_queue.c
91
92
  - ext/multi_string_replace/aho_queue.h
92
93
  - ext/multi_string_replace/aho_text.h
@@ -106,7 +107,7 @@ licenses:
106
107
  - MIT
107
108
  metadata:
108
109
  allowed_push_host: https://rubygems.org
109
- post_install_message:
110
+ post_install_message:
110
111
  rdoc_options: []
111
112
  require_paths:
112
113
  - lib
@@ -121,9 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0'
123
124
  requirements: []
124
- rubyforge_project:
125
- rubygems_version: 2.7.7
126
- signing_key:
125
+ rubygems_version: 3.1.6
126
+ signing_key:
127
127
  specification_version: 4
128
128
  summary: A fast multiple string replace library for ruby. Uses a C implementation
129
129
  of the Aho–Corasick Algorithm