rude 0.0.1 → 0.0.2
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.
- data/lib/rude.rb +10 -16
- data/lib/rude/version.rb +1 -1
- metadata +1 -1
data/lib/rude.rb
CHANGED
@@ -1,23 +1,18 @@
|
|
1
1
|
require "rude/version"
|
2
2
|
|
3
|
-
|
3
|
+
DEFAULT_RUDE_WORDS = [
|
4
|
+
'cunt', 'twat', 'shit'
|
5
|
+
]
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
7
|
+
class String
|
8
|
+
def rude?
|
9
|
+
Rude.is?(self)
|
10
|
+
end
|
11
|
+
end
|
8
12
|
|
9
|
-
# class String
|
10
|
-
# def rude?
|
11
|
-
# self.split(' ').each do |t|
|
12
|
-
# if DEFAULT_RUDE_WORDS.member?(t.downcase)
|
13
|
-
# return true
|
14
|
-
# end
|
15
|
-
# end
|
16
|
-
# return false
|
17
|
-
# end
|
18
|
-
# end
|
19
13
|
|
20
|
-
|
14
|
+
module Rude
|
15
|
+
def self.is?(text)
|
21
16
|
text.split(' ').each do |t|
|
22
17
|
if DEFAULT_RUDE_WORDS.member?(t.downcase)
|
23
18
|
return true
|
@@ -25,5 +20,4 @@ module Rude
|
|
25
20
|
end
|
26
21
|
return false
|
27
22
|
end
|
28
|
-
|
29
23
|
end
|
data/lib/rude/version.rb
CHANGED