unswear 3.2.1 → 3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/unswear.rb +30 -22
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20aa09f499721a0a557aa30d50aaabacce0da6dd
4
- data.tar.gz: 64b25f47a15b4f98ba52788c5d49301fb6fac2d9
3
+ metadata.gz: 3b60513557e7836ca150fdc403735e1dd65361d2
4
+ data.tar.gz: c321e0bb0dea7ee0a799c2736157122f6a76c3a9
5
5
  SHA512:
6
- metadata.gz: da89cbff9e544e196b76809a338b7e40231c0100eedf6362b7de56886569f218c9dbc6bd5f395e26a788b87e381a8e4385f15b992c6e8f2840c5bacbcc832f78
7
- data.tar.gz: 20801be585c7675a541aec6192fc5ac9323b065023cdf84aa8149e99a0f421c5d7cb0093c222a5051d7bef372441f0d5a496d428cfed03fe1a0d0bbc66b1c9b9
6
+ metadata.gz: 2bc3465a3285316cd7e7afbf5a2311264bae5f61a15710389ea9268a5073709b2d0610544ee7499da65da0f036f8080ac026ffc2453b311b3f0f044a2a6f98ba
7
+ data.tar.gz: 8334fb681a434b0db1c98d1e613af71476c9bc62ee00e012c11ca1f9fb8af28208c3f8eefa07e2b1bdd206d7a47708553e19536617bedb2cccef6b6faac05dc3
data/lib/unswear.rb CHANGED
@@ -1,5 +1,7 @@
1
- VERSION = '3.2.1'
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
- # fix this shit later.
78
- # i don't care anymore
81
+ end
82
+
83
+ # Define Unswear class
84
+ class Unswear
79
85
 
80
- # class Unswear
81
- #
82
- # def self.list(x=0)
83
- # unless x != 0
84
- # puts $curses.sort_by(&:downcase).uniq
85
- # else
86
- # $curses.count.times do |m|
87
- # if $curses[m][0] == x
88
- # puts $curses[m]
89
- # end
90
- # end
91
- # end
92
- # end
93
- #
94
- # def self.version
95
- # puts "unswear v#{VERSION}"
96
- # end
97
- # end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unswear
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: '3.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh