unswear 3.2.1 → 3.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 +4 -4
- data/lib/unswear.rb +30 -22
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b60513557e7836ca150fdc403735e1dd65361d2
|
4
|
+
data.tar.gz: c321e0bb0dea7ee0a799c2736157122f6a76c3a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bc3465a3285316cd7e7afbf5a2311264bae5f61a15710389ea9268a5073709b2d0610544ee7499da65da0f036f8080ac026ffc2453b311b3f0f044a2a6f98ba
|
7
|
+
data.tar.gz: 8334fb681a434b0db1c98d1e613af71476c9bc62ee00e012c11ca1f9fb8af28208c3f8eefa07e2b1bdd206d7a47708553e19536617bedb2cccef6b6faac05dc3
|
data/lib/unswear.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
VERSION
|
1
|
+
# Define VERSION variable for use with Unswear.version
|
2
|
+
VERSION = '3.3'
|
2
3
|
|
4
|
+
# Create array of curse words
|
3
5
|
$curses = %w(
|
4
6
|
fuck fucking fucker fuckin nigger nigga cunt shit
|
5
7
|
ass asshole bitch piss dick pussy pussay chink
|
@@ -35,9 +37,10 @@ $curses = %w(
|
|
35
37
|
whorebag whore-bag wetback wet-back wop
|
36
38
|
)
|
37
39
|
|
38
|
-
|
40
|
+
# Add some methods to the String class
|
39
41
|
class String
|
40
42
|
|
43
|
+
# Method to censor swears in string
|
41
44
|
def censor
|
42
45
|
new = self
|
43
46
|
new = new.split " "
|
@@ -59,6 +62,7 @@ class String
|
|
59
62
|
puts new
|
60
63
|
end
|
61
64
|
|
65
|
+
# Method to check if string contains swear
|
62
66
|
def swear?
|
63
67
|
new = self
|
64
68
|
$swear = false
|
@@ -74,25 +78,29 @@ class String
|
|
74
78
|
end
|
75
79
|
end
|
76
80
|
|
77
|
-
|
78
|
-
|
81
|
+
end
|
82
|
+
|
83
|
+
# Define Unswear class
|
84
|
+
class Unswear
|
79
85
|
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
#
|
96
|
-
|
97
|
-
#
|
86
|
+
# Method to list all swear words
|
87
|
+
# If parameter (letter) is supplied,
|
88
|
+
# list all words that begin with that letter
|
89
|
+
def self.list(x=0)
|
90
|
+
unless x != 0
|
91
|
+
puts $curses.sort_by(&:downcase).uniq
|
92
|
+
else
|
93
|
+
$curses.count.times do |m|
|
94
|
+
if $curses[m][0] == x
|
95
|
+
puts $curses[m]
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# Method to display Unswear's version
|
102
|
+
def self.version
|
103
|
+
puts "unswear v#{VERSION}"
|
104
|
+
end
|
105
|
+
|
98
106
|
end
|