string_splitter 0.7.1 → 0.7.2

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: 799ba605477bc50679baaa0ae5d12ac8077fc3a57611f69beddb3396a45e3a13
4
- data.tar.gz: 0fbdf7225b69ea52b615ac7523bd15266dc9b0dbbe541e7b3802027a0a8c6c36
3
+ metadata.gz: aa94b66f61dc3f1970d92b7fa4fb01ba0932262338c124592f539a2f3b4e7ca3
4
+ data.tar.gz: 0b415f82cfe372bdc9fd0e72d26beeb5071fc02f31e6fa5c02606d3837680506
5
5
  SHA512:
6
- metadata.gz: c8fc9cf7bbd351013091918f5398c27efcda0b9b8c1f66294af76f1864e911d2fc0520b653fe1bdf3d11fb912dd0615b0954e38176f87fbf2a6cc931d0bdf6be
7
- data.tar.gz: 98bd2cdeae3a27f9f54bb982b75033c9180e688419c0f5209682462a27e1792d6c8ec6d16ec6340c359c22373cdcad07c05a8ced5b03811060cf492d09a1c13b
6
+ metadata.gz: 5efaba21a21e25b4b3f54a505f35cf16bba346427dfe4694554de6a1e917160e08cab9be65e80fd7d7407ba82cf5e876fff21ca2607e2da4fc137f3907b2322a
7
+ data.tar.gz: 37ac5c38859a8ed4036e68d9e588c58c8aa63e6ce2a47066dc1d02b115564cc187c505bec4b066a20981eedb21d210f01d019715ab9d91c9dc88f6e320763a3c
@@ -1,3 +1,9 @@
1
+ ## 0.7.2 - 2020-08-22
2
+
3
+ #### Fixes
4
+
5
+ - fix/test default delimiter + `remove_empty_fields`
6
+
1
7
  ## 0.7.1 - 2020-08-22
2
8
 
3
9
  #### Changes
data/README.md CHANGED
@@ -297,7 +297,7 @@ currently, Ruby 2.5 and above.
297
297
 
298
298
  # VERSION
299
299
 
300
- 0.7.1
300
+ 0.7.2
301
301
 
302
302
  # SEE ALSO
303
303
 
@@ -219,15 +219,24 @@ class StringSplitter
219
219
  elsif delimiter == DEFAULT_DELIMITER && block == ACCEPT_ALL
220
220
  # non-empty separators so -1 is safe
221
221
 
222
- if @remove_empty_fields
223
- result = []
224
- string.split(delimiter, -1) do |field|
225
- result << field unless it.empty?
226
- end
227
- else
228
- result = string.split(delimiter, -1)
229
- end
230
-
222
+ # XXX String#split with block was introduced in Ruby 2.6:
223
+ #
224
+ # - https://rubyreferences.github.io/rubychanges/2.6.html#stringsplit-with-block
225
+ #
226
+ # rather than sniffing, we'll just use the compatible version for now
227
+ #
228
+ # if @remove_empty_fields
229
+ # result = []
230
+ #
231
+ # string.split(delimiter, -1) do |field|
232
+ # result << field unless field.empty?
233
+ # end
234
+ # else
235
+ # result = string.split(delimiter, -1)
236
+ # end
237
+
238
+ result = string.split(delimiter, -1)
239
+ result = result.reject(&:empty?) if @remove_empty_fields
231
240
  return [result]
232
241
  else
233
242
  splits = parse(string, delimiter)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class StringSplitter
4
- VERSION = '0.7.1'
4
+ VERSION = '0.7.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string_splitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - chocolateboy