unswear 1.5 → 1.6

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 +22 -15
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 568d7d9a54842dea1f3929689f35f4ac9ad097b4
4
- data.tar.gz: fe746ec6b6bb430f875d08cba770c947fc2c8afe
3
+ metadata.gz: 77360b4923d34914a158a3e77910836d37f988ec
4
+ data.tar.gz: 22e3efa848d5ab298ea88c9151576b751bac4273
5
5
  SHA512:
6
- metadata.gz: ca4f721f1ba524bf3547e2bff1601f7898b9698b615316f3ba1ef1ab9b570645f4b1731c1d2e5f58bbb553492dda8a48d4e3e25a4c5923594fa2e6622e45a63d
7
- data.tar.gz: 57eb7f73ec89076888179f2e6620c7325af6f98a12b4030752679782781682a65ff137cad342b890f2d085e46dcc531beb3e03f45ff008fc0061ef2148cfc391
6
+ metadata.gz: 0b4d33618583ce9b59f1806b55ab89b26270c198ac03c75ab72a5538bacddc65dc8de871b44c7e6ffef4b5a77f95ecbb2883d2fdbc32d08662375f1c32761ec3
7
+ data.tar.gz: aa9f62ba71f92bea4cee6681a207d6fc7ab9bca95fd340d5806cf41616377ef9d4857c954c5f4633492b3136f18d81c26ddf007ffae0deed974ae85ee132be9b
data/lib/unswear.rb CHANGED
@@ -1,21 +1,28 @@
1
1
  class Unswear
2
2
  def self.censor(input)
3
3
  new = input
4
- new.gsub!("fuck", "f*ck")
5
- new.gsub!("cunt", "c*nt")
6
- new.gsub!("shit", "sh*t")
7
- new.gsub!("ass", "a*s")
8
- new.gsub!("bitch", "b*tch")
9
- new.gsub!("piss", "p*ss")
10
- new.gsub!("bastard", "b*stard")
11
- new.gsub!("fag", "f*g")
12
- new.gsub!("cock", "c*ck")
13
- new.gsub!("slut", "sl*t")
14
- new.gsub!("pussy", "p*ssy")
15
- new.gsub!("dick", "d*ck")
16
- new.gsub!("nigger", "n*gger")
17
- new.gsub!("nigga", "n*gga")
4
+
5
+ curses = [
6
+ "fuck", "nigger", "nigga", "cunt", "shit",
7
+ "ass", "bitch", "piss", "dick", "pussy",
8
+ "bastard", "fag", "cock", "slut"
9
+ ]
10
+
11
+ new = new.split " "
12
+ # do some magic
13
+ new.count.times do |i|
14
+ curses.count.times do |c|
15
+ if new[i] == curses[c]
16
+ new[i].gsub! "a", "*"
17
+ new[i].gsub! "e", "*"
18
+ new[i].gsub! "i", "*"
19
+ new[i].gsub! "o", "*"
20
+ new[i].gsub! "u", "*"
21
+ end
22
+ end
23
+ end
24
+ new.join(",")
18
25
  #finally return new
19
- new
26
+ puts new
20
27
  end
21
28
  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: '1.5'
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh