l2e_vocab_blacklist 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/lib/l2e_vocab_blacklist.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6472f6520171d62549e667e2b4d89672775a68d
|
4
|
+
data.tar.gz: 7f53a8d540d884bc2da7e2c19b316ceebf35537c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8833b89926f3ab4df06c805415c9f051711718de59af0c2e0c79a679254556930c28c00592e9e32f1867f83e00fc5f9b3cc19c7ada59b550656c70a09c6f8fd7
|
7
|
+
data.tar.gz: 846bc0cd40e6fe031cf17537012beb958d597af95778bf55d238d9ddbcb0b9e741204e255a45ee047f49ae7174fcae6722a7369c9d62c897162c6d6048688b2a
|
data/README.md
CHANGED
@@ -5,4 +5,9 @@ Detect words and partial-words that shouldn't be used on Learn2Earn's website
|
|
5
5
|
|
6
6
|
To be expanded to allow for different classes of banned words so
|
7
7
|
administrators may loosen or expand restrictions, or so we can be more
|
8
|
-
permissive with older students.
|
8
|
+
permissive with older students.
|
9
|
+
|
10
|
+
Use:
|
11
|
+
```
|
12
|
+
gem 'l2e_vocab_blacklist'
|
13
|
+
```
|
data/lib/l2e_vocab_blacklist.rb
CHANGED
@@ -22,12 +22,14 @@ class VocabBlacklist
|
|
22
22
|
|
23
23
|
def self.censor(str, replace_with = "****")
|
24
24
|
|
25
|
+
require "pry"
|
26
|
+
|
25
27
|
PHRASES.each do |bad_phrase|
|
26
28
|
str.gsub!(/#{bad_phrase}/i, replace_with)
|
27
29
|
end
|
28
30
|
|
29
|
-
str.split(
|
30
|
-
word = working_word.downcase.
|
31
|
+
str.split(/ /).map do |working_word|
|
32
|
+
word = working_word.downcase.gsub(CONSIDER_REGEX, '')
|
31
33
|
|
32
34
|
if FULL_WORDS.include?(word)
|
33
35
|
working_word.gsub!(/#{word}/i, replace_with)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: l2e_vocab_blacklist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Sherrid
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Detect words and partial-words that shouldn't be used on Learn2Earn's
|
15
15
|
website
|