word_censored 0.1.3 → 0.1.4

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: dc96587b004e8db96030ee072d8f8a550122a42876432a22a052c94663ce2b46
4
- data.tar.gz: c4825a718fe382593a552dcfa219764c083e099ceb1fb9954a78cd642d8ee35a
3
+ metadata.gz: 1ecc5c3d0d5e018379f0cb504fba466a6fbaab0436868fb06fb13100c2a961e9
4
+ data.tar.gz: 315d1c2d24443a823b629d36ef62917bf04284a30e018537f3f1b7c63bce0442
5
5
  SHA512:
6
- metadata.gz: 78cf350f34ed1541d0134823f5c8eb8fd574a94d12a0d852360db239a569c11fe7935200783fec1115bbd6a326b3332071aac4c30943f4a1a0aa8eb4df9c731a
7
- data.tar.gz: b0ddea70adce750aa1f3aafb4972d69f9a7bdc6189a0f086756caec194932641b942fefde8db57e49369ee5eeb97cffc82c448b9552760d899422f4ee1a7a40d
6
+ metadata.gz: 575077fd3ef9fe3d78344757479dcc7ddd7c9fb071fa1455d4b2b384874d3ab707f4d2f426b9edb5c829f983ac33f79c86beca4b93469e08b142e0ab28083c43
7
+ data.tar.gz: ec148772620dd3d39bb24d2783e20c1fc5afbbde4e8f4199078f108d38363cca1e750617e9a0cb422d2619f448084b0244fb0a36f1f9d81b96da69d54a1ab85e
data/README.md CHANGED
@@ -22,7 +22,19 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ Add this line to your class where you gonna use this gem:
26
+
27
+ ```ruby
28
+ include WordCensored
29
+ ```
30
+
31
+ then use it:
32
+
33
+ ```ruby
34
+ filter('bad word')
35
+
36
+ > *** ****
37
+ ```
26
38
 
27
39
  ## Development
28
40
 
@@ -1,3 +1,3 @@
1
1
  module WordCensored
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/word_censored.rb CHANGED
@@ -17,6 +17,7 @@ module WordCensored
17
17
 
18
18
  @str_array.each_with_index do |word, index|
19
19
  next if index <= current_index
20
+ next if preprocess_word(word).strip.empty?
20
21
 
21
22
  first_letter = preprocess_word(word)[0].match?(REGEX_FIRST_LETTER) ? preprocess_word(word)[0] : 'other'
22
23
  index_badword = detect_badword(blacklist[first_letter], index, index)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: word_censored
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Tran