Cussy 1.0.1
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 +7 -0
- data/lib/Cussy.rb +20 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8e598fca5b4d6fe34bc65fc2491addc9f4623561
|
4
|
+
data.tar.gz: 41bb28e02eb3ae0f19e683fab49f9ef2f09b52d4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1ab44d23710d1ab7b40dadac05c3dc565309be09ee8d84848b04d685ce8cf58b8ab21b33de05a0952fc9e4bf08e76ab520b1ba9f5d6f611589651515aff8af68
|
7
|
+
data.tar.gz: b7cdce0da7ec6bda6395d2f5ef54102df9fadd71bc8ec4a3a0a071d3cf41340b2c2e52f81281ebb7842cad6373cc9a2970294c8d7cb104643b32f18b4ae7f0d1
|
data/lib/Cussy.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
class Cussy
|
2
|
+
def self.evaluate(userinput)
|
3
|
+
@words = ["shitehawk", "fucking","shit","fuck","shitting"]
|
4
|
+
@words.sort_by!{|str| str.length}.reverse!
|
5
|
+
@words.each {|x|
|
6
|
+
|
7
|
+
if
|
8
|
+
#If it has a Cuss Word from array @words
|
9
|
+
userinput.include?(x)
|
10
|
+
#Counts Number of letters in present Cuss Word.
|
11
|
+
#And replaces each leter with a star
|
12
|
+
starCount = x.length
|
13
|
+
userinput.gsub! x, "*" * starCount
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
}
|
18
|
+
return userinput
|
19
|
+
end
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: Cussy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Graham Barry
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-12-02 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Takes in user input on a comment form and replaces any of the profane
|
14
|
+
word with stars
|
15
|
+
email: info@grazermedia.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/Cussy.rb
|
21
|
+
homepage: http://rubygems.org/gems/Cussy
|
22
|
+
licenses: []
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.4.3
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Profanity Filter
|
44
|
+
test_files: []
|