unswear 3.4.6 → 4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7728c649a0dabb1f2c5408e14d65c5bdc35a5595
4
- data.tar.gz: 52dbc6c57143785f08ec6755c70a7cb6e003a1f4
3
+ metadata.gz: 9ad841a3e136613bb5cc003de2c0a28642bfc0de
4
+ data.tar.gz: fbb0846a68deed6f0023ed3b27d74c9d21fb4c00
5
5
  SHA512:
6
- metadata.gz: 7db2668fe29269149f193a8887914b6b318005c79a7fb0eb48e9d55a423cf6bef346000f2351490cdcb0b0808fa675d4d456bfa2a62f61f76292d9c3fba0c0c1
7
- data.tar.gz: aed6311ab6e3e4d00a5cc0dda247271d6bf3fb735360e7314f60200b4b2e01e23042758f10d0c487f2c14559ea44666268ddcc268550cb80adc7baff25b75875
6
+ metadata.gz: bba034c9075b30f498721d78477dbf72b2ed62c55434e60ba3f82d034fc4329031b98c1b87570f91be6bbeefc99c61207932afc3440bab8d7cf3240ba13183c4
7
+ data.tar.gz: 604d16361febf5cd5d73514a9907f3fec83627df6150de7e6833415f82e6b2d7dbef383a8439674f85c83469b6206376ab7c206af32a4c09894f9508081dbbd1
@@ -0,0 +1,34 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in unswear.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Josh Trommel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,53 @@
1
+ unswear
2
+ =======
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/unswear.svg)](http://badge.fury.io/rb/unswear)
5
+
6
+ Censor swear words in a string
7
+
8
+ ## Install
9
+ You can install unswear via [RubyGems](https://rubygems.org/gems/unswear)
10
+
11
+ `gem install unswear`
12
+
13
+ Or stick it in your Gemfile
14
+
15
+ `gem 'unswear'`
16
+
17
+ ## Usage
18
+
19
+ Censor a string
20
+ ```ruby
21
+ require 'unswear'
22
+
23
+ "bitch ass nigga".censor # => b*tch *ss n*gg*
24
+ ```
25
+
26
+ .. or check if a string contains a swear
27
+
28
+ ```ruby
29
+ "oh shit".swear? # => true
30
+ "sandwhich".swear? # => false
31
+ ```
32
+
33
+ You can also list the swears that will be censored
34
+
35
+ ```ruby
36
+ Unswear.list # => arse, arsehole, ass, ass-fucker, ass-hat ...
37
+ ```
38
+
39
+ .. or list swears that start with a certain letter
40
+
41
+ ```ruby
42
+ Unswear.list('c') # => cunt, chink, cock, camel-toe, choad ...
43
+ ```
44
+
45
+ And if you'd like to check the version, there's a method for that as well
46
+
47
+ ```ruby
48
+ Unswear.version
49
+ ```
50
+
51
+ ## To Do
52
+ - Create dangerous version of `censor` method
53
+ - Fix all of the damn global variables
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -1,41 +1,6 @@
1
- # Define VERSION variable for use with Unswear.version
2
- VERSION = '3.4.6'
3
-
4
- # Create array of curse words
5
- $curses = %w(
6
- fuck fucking fucker fuckin nigger nigga cunt shit
7
- ass asshole bitch piss dick pussy pussay chink
8
- bastard fag faggot cock slut slutty sluttish whore
9
- whorish arse arsehole ass-jabber assjabber assbag
10
- assclown asscracker assface assfuck assfuck ass-nigger
11
- assfucker ass-fucker asshat ass-hat assnigger ass-pirate
12
- asspirate assshit ass-shit axwound beaner bitches
13
- bitchass bitch-ass blowjob blow-job bitchy bitchtits
14
- bollox boner brother-fucker brotherfucker butt-plug buttplug
15
- bullshit bull-shit bumblefuck buttfucker butt-fucker
16
- butt-fucka buttfucka camel-toe choad clit chinc
17
- chesticle clitface clit-face clit-fuck clitfuck cock-muncher
18
- cockass cock-ass cock-fucker cockfucker cockmuncher
19
- cockwaffle cock-waffle cracker cum cumguzzler cum-guzzler
20
- cooter cunt-face cuntface cuntslut cunt-slut dick-bag dickbag
21
- dago damn deggo dick-bag dickbag dickface dick-face dickhead
22
- dick-head dick-juice dickjuice dicks dickslap dick-slap dick-sucker
23
- dicksucker dickwad dick-wad douchebag dumbass dumb-ass dumb-fuck
24
- dumbfuck dumbshit dumb-shit dyke fatass flamer fuckbrain fuck-brain
25
- fucked fuckface fuck-face fuckoff fuck-off fucktard fuck-tard
26
- jackass jack-ass jap jigaboo jizz gaylord gay-lord goddamn
27
- goddamn goddamnit gook gooch gringo guido hard-on heeb hoe
28
- honkey hump humping kike koocher kooch kraut kunt kyke
29
- lameass lardass lame-ass lard-ass lesbo lezzie pecker pissed
30
- poon poontang poonany poonany prick pussies pussylicking puto
31
- mcfagget motherfucker motherfucking motherfuck niglet renob shitbreath
32
- shit-breath shitcunt shit-cunt shithead shit-head shitting shittiest
33
- queer rimjob ruski sandnigger schlong shitbrains shit-brains shitty
34
- skank skanky skankiest slutbag cumbag slut-bag cum-bag splooge
35
- tard retard tit titfuck tit-fuck tits titties twats twats unclefucker
36
- uncle-fucker va-j-j vag vajayjay vjayjay wank wank-job wankjob
37
- whorebag whore-bag wetback wet-back wop
38
- )
1
+ # Require some files
2
+ require_relative 'unswear/version'
3
+ require_relative 'unswear/curses'
39
4
 
40
5
  # Add some methods to the String class
41
6
  class String
@@ -46,8 +11,8 @@ class String
46
11
  new = new.split " "
47
12
  # do some magic
48
13
  new.count.times do |i|
49
- $curses.count.times do |c|
50
- if new[i].downcase == $curses[c]
14
+ Words::LIST.count.times do |c|
15
+ if new[i].downcase == Words::LIST[c]
51
16
  new[i].gsub! "a", "*"
52
17
  new[i].gsub! "e", "*"
53
18
  new[i].gsub! "i", "*"
@@ -66,16 +31,12 @@ class String
66
31
  def swear?
67
32
  new = self
68
33
  $swear = false
69
- $curses.each do |c|
34
+ Words::LIST.each do |c|
70
35
  if new.downcase.include?(c)
71
36
  $swear = true
72
37
  end
73
38
  end
74
- if $swear == false
75
- return false
76
- else
77
- return true
78
- end
39
+ return $swear
79
40
  end
80
41
 
81
42
  end
@@ -88,11 +49,11 @@ class Unswear
88
49
  # list all words that begin with that letter
89
50
  def self.list(x=0)
90
51
  unless x != 0
91
- print "#{$curses.sort_by(&:downcase).uniq}, "
52
+ print "#{Words::LIST.sort_by(&:downcase).uniq}, "
92
53
  else
93
- $curses.count.times do |m|
94
- if $curses[m][0] == x
95
- print "#{$curses[m]}, "
54
+ Words::LIST.count.times do |m|
55
+ if Words::LIST[m][0] == x
56
+ print "#{Words::LIST[m]}, "
96
57
  end
97
58
  end
98
59
  end
@@ -0,0 +1,36 @@
1
+ module Words
2
+ LIST = %w(
3
+ fuck fucking fucker fuckin nigger nigga cunt shit
4
+ ass asshole bitch piss dick pussy pussay chink
5
+ bastard fag faggot cock slut slutty sluttish whore
6
+ whorish arse arsehole ass-jabber assjabber assbag
7
+ assclown asscracker assface assfuck assfuck ass-nigger
8
+ assfucker ass-fucker asshat ass-hat assnigger ass-pirate
9
+ asspirate assshit ass-shit axwound beaner bitches
10
+ bitchass bitch-ass blowjob blow-job bitchy bitchtits
11
+ bollox boner brother-fucker brotherfucker butt-plug buttplug
12
+ bullshit bull-shit bumblefuck buttfucker butt-fucker
13
+ butt-fucka buttfucka camel-toe choad clit chinc
14
+ chesticle clitface clit-face clit-fuck clitfuck cock-muncher
15
+ cockass cock-ass cock-fucker cockfucker cockmuncher
16
+ cockwaffle cock-waffle cracker cum cumguzzler cum-guzzler
17
+ cooter cunt-face cuntface cuntslut cunt-slut dick-bag dickbag
18
+ dago damn deggo dick-bag dickbag dickface dick-face dickhead
19
+ dick-head dick-juice dickjuice dicks dickslap dick-slap dick-sucker
20
+ dicksucker dickwad dick-wad douchebag dumbass dumb-ass dumb-fuck
21
+ dumbfuck dumbshit dumb-shit dyke fatass flamer fuckbrain fuck-brain
22
+ fucked fuckface fuck-face fuckoff fuck-off fucktard fuck-tard
23
+ jackass jack-ass jap jigaboo jizz gaylord gay-lord goddamn
24
+ goddamn goddamnit gook gooch gringo guido hard-on heeb hoe
25
+ honkey hump humping kike koocher kooch kraut kunt kyke
26
+ lameass lardass lame-ass lard-ass lesbo lezzie pecker pissed
27
+ poon poontang poonany poonany prick pussies pussylicking puto
28
+ mcfagget motherfucker motherfucking motherfuck niglet renob shitbreath
29
+ shit-breath shitcunt shit-cunt shithead shit-head shitting shittiest
30
+ queer rimjob ruski sandnigger schlong shitbrains shit-brains shitty
31
+ skank skanky skankiest slutbag cumbag slut-bag cum-bag splooge
32
+ tard retard tit titfuck tit-fuck tits titties twats twats unclefucker
33
+ uncle-fucker va-j-j vag vajayjay vjayjay wank wank-job wankjob
34
+ whorebag whore-bag wetback wet-back wop
35
+ )
36
+ end
@@ -0,0 +1,3 @@
1
+ module Version
2
+ VERSION = '4.0'
3
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/unswear/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ['Josh']
6
+ gem.email = ['joshception@icloud.com']
7
+ gem.description = 'Un-f*ck user input'
8
+ gem.summary = 'Censor swear words in a string'
9
+ gem.homepage = 'https://github.com/trommel/unswear'
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
+ gem.name = 'unswear'
14
+ gem.require_paths = ['lib']
15
+ gem.version = Version::VERSION
16
+
17
+ gem.add_development_dependency 'bundler', '~> 1.6'
18
+ gem.add_development_dependency 'rake'
19
+ end
metadata CHANGED
@@ -1,25 +1,61 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unswear
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.6
4
+ version: '4.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-07 00:00:00.000000000 Z
12
- dependencies: []
13
- description: Censor swear words in a string
14
- email: joshception@icloud.com
11
+ date: 2015-02-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Un-f*ck user input
42
+ email:
43
+ - joshception@icloud.com
15
44
  executables: []
16
45
  extensions: []
17
46
  extra_rdoc_files: []
18
47
  files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE
51
+ - README.md
52
+ - Rakefile
19
53
  - lib/unswear.rb
20
- homepage: http://rubygems.org/gems/unswear
21
- licenses:
22
- - MIT
54
+ - lib/unswear/curses.rb
55
+ - lib/unswear/version.rb
56
+ - unswear.gemspec
57
+ homepage: https://github.com/trommel/unswear
58
+ licenses: []
23
59
  metadata: {}
24
60
  post_install_message:
25
61
  rdoc_options: []
@@ -37,8 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
37
73
  version: '0'
38
74
  requirements: []
39
75
  rubyforge_project:
40
- rubygems_version: 2.2.2
76
+ rubygems_version: 2.4.5
41
77
  signing_key:
42
78
  specification_version: 4
43
- summary: Un-f*ck user input
79
+ summary: Censor swear words in a string
44
80
  test_files: []