lite-ruby 1.0.29 → 1.0.30

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab408998ca8693b60da98a82162403e2c18a30d22974a17ec17e3e7c38c9ad04
4
- data.tar.gz: 1a34293ee4ea051a3308d67eb77011902b6f7389284d695d510c54b48e449476
3
+ metadata.gz: 497a85ac4bea67a37f713e049589a1825e1ea9c2cb157ad5b9aba5b89ed0c37e
4
+ data.tar.gz: 7f4747cdcff9975cec2d43cb929223bb26ca43939ab60a3dee46d378252fdabe
5
5
  SHA512:
6
- metadata.gz: 0d1a2fd4da82dfb787b672e13b2be1289544f7a969b29a84b69f2a1bc01a59727c9a530d9fbfe51d3ef186cc27782582f841e748acaaa3e769c6de1d34086dc5
7
- data.tar.gz: 1a1926a5a3ab3f49865ccf81ba70212806cc02b766e811da0715fc11d5ffbfce823d5a7820efe6a2f428140cd168fd164961aec4b72482cf1976ee8e425908c4
6
+ metadata.gz: 4f63e2c228b2e4eb349a4b9c14187e906f3bb5803ea7188a352c4bbc6f82ac2867148b68acd92e8c5a758d9e57943f9410c72d380295953fa8e741b0734e3260
7
+ data.tar.gz: c1416d519e4ec7d8a3c0fad863145789cc55a262d293bacc9df6927ecc92d04b3464eee778dede669a33ecafdca6e2c4f51b725ffdc76735ec16c7a730447eac
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.30] - 2020-07-03
10
+ ### Added
11
+ - Added more Ruby 2.7 support
12
+
9
13
  ## [1.0.29] - 2020-07-03
10
14
  ### Added
11
15
  - Added Ruby 2.7 support
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-ruby (1.0.29)
4
+ lite-ruby (1.0.30)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -163,8 +163,8 @@ if Lite::Ruby.configuration.monkey_patches.include?('string')
163
163
  replace(headerize)
164
164
  end
165
165
 
166
- def humanize(options = {})
167
- dup.humanize!(options)
166
+ def humanize(capitalize: true)
167
+ dup.humanize!(capitalize: capitalize)
168
168
  end
169
169
 
170
170
  def humanize!(capitalize: true)
@@ -530,8 +530,9 @@ if Lite::Ruby.configuration.monkey_patches.include?('string')
530
530
  def truncate(truncate_at, options = {})
531
531
  return dup unless length > truncate_at
532
532
 
533
- seperator = options[:separator]
534
533
  omission = options[:omission] || '...'
534
+ seperator = options[:separator]
535
+
535
536
  size_with_room_for_omission = truncate_at - omission.length
536
537
 
537
538
  stop = if seperator
@@ -543,13 +544,17 @@ if Lite::Ruby.configuration.monkey_patches.include?('string')
543
544
  "#{self[0, stop]}#{omission}"
544
545
  end
545
546
 
547
+ # rubocop:disable Layout/LineLength
546
548
  def truncate_words(words_count, options = {})
547
- sep = options[:separator] || /\s+/
548
- sep = Regexp.escape(sep.to_s) unless sep.is_a(Regexp)
549
- return self unless /\A((?:.+?#{sep}){#{words_count - 1}}.+?)#{sep}.*/m.match?(self)
549
+ omission = options[:omission] || '...'
550
+ seperator = options[:separator] || /\s+/
551
+
552
+ seperator = Regexp.escape(seperator.to_s) unless seperator.is_a(Regexp)
553
+ return self unless /\A((?:.+?#{seperator}){#{words_count - 1}}.+?)#{seperator}.*/m.match?(self)
550
554
 
551
- "#{::Regexp.last_match(1)}#{options[:omissio] || '...'}"
555
+ "#{::Regexp.last_match(1)}#{omission}"
552
556
  end
557
+ # rubocop:enable Layout/LineLength
553
558
 
554
559
  def underscore
555
560
  dup.underscore!
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Ruby
5
5
 
6
- VERSION ||= '1.0.29'
6
+ VERSION ||= '1.0.30'
7
7
 
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.29
4
+ version: 1.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez