text-gen 0.11.1 → 0.11.3

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: e9e642a0ea2be69600a0443de4e81035da0947aba383c2fa419a426bfbd4fd0d
4
- data.tar.gz: fecb3ad3bf8ade425cafedc50cac19f3a62de4af084623b313463d97b52c145a
3
+ metadata.gz: 549a452c7b5e0be1d179c8d3cd9a63fd5e3b922d3b5b46aebd589862a57a47c5
4
+ data.tar.gz: 1cc91f513982f11d3e2c062da0fb0f968cbde160adc6c8d1d53c3083c523ec35
5
5
  SHA512:
6
- metadata.gz: 7ea194fca6113a0d04276989071b935c12601cf02fcbf049b8b5eda74a513c0ad43089a64053c34fced79b166e589634010bcd0a717844d77a3187cd657394fc
7
- data.tar.gz: 56434b2d55cb28b4f176219343ed269b42d4717c58ffe704e667fa58778781b7016d7d0d355ae5d307fda4da17b0f78fc60adca49aa410573fdd43bb2394b4ee
6
+ metadata.gz: e83e321c33340d6e1962fc1c4f58668bd17778c215efda2218b5c1ee3c900c7dd9e2086d0dc46ba8b12551704554e54e6adb30ee82b48fc8f6f8d298aef39fe6
7
+ data.tar.gz: 9f7908767de4101d65bdf2a65640d2c6c431d940db45637383122112e7932cd285ea1aeff92f10cde24583f842417b404000f125a255b43e378ab993e01a0cec
@@ -8,11 +8,7 @@ module Text
8
8
  module Result
9
9
  class Capitalize < ResultFilter
10
10
  def apply(result)
11
- if key == "sentence"
12
- transform_text(result, result.text.sub(/\S/, &:upcase))
13
- else
14
- transform_text(result, result.text.capitalize)
15
- end
11
+ transform_text(result, result.text.sub(/\S/, &:upcase))
16
12
  end
17
13
  end
18
14
  end
@@ -18,7 +18,7 @@ module Text
18
18
 
19
19
  def titleize(str)
20
20
  str.split(/\s+/).map.with_index do |word, idx|
21
- idx.zero? || !SKIP_WORDS.include?(word) ? word.capitalize : word
21
+ idx.zero? || !SKIP_WORDS.include?(word) ? word.sub(/\S/, &:upcase) : word
22
22
  end.join(" ")
23
23
  end
24
24
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Text
4
4
  module Gen
5
- VERSION = "0.11.1"
5
+ VERSION = "0.11.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - G Palmer