zaarly-swearjar 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/swearjar.rb +1 -2
- data/lib/swearjar/tester.rb +1 -1
- data/lib/swearjar/version.rb +1 -1
- data/spec/swearjar_spec.rb +4 -5
- metadata +14 -14
data/lib/swearjar.rb
CHANGED
@@ -19,7 +19,7 @@ class SwearJar
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.setup!
|
22
|
-
@settings
|
22
|
+
return unless @settings.empty?
|
23
23
|
|
24
24
|
file = File.join(File.dirname(__FILE__), 'config', "#{language ||= "en"}.yml")
|
25
25
|
YAML.load_file(file).each do |key, inner_config|
|
@@ -72,6 +72,5 @@ class SwearJar
|
|
72
72
|
scan(string) {|word, test| censored_string.gsub!(word, block_given? ? yield(word) : word.gsub(/\S/, '*')) if test}
|
73
73
|
censored_string
|
74
74
|
end
|
75
|
-
|
76
75
|
end
|
77
76
|
|
data/lib/swearjar/tester.rb
CHANGED
data/lib/swearjar/version.rb
CHANGED
data/spec/swearjar_spec.rb
CHANGED
@@ -6,13 +6,13 @@ describe SwearJar do
|
|
6
6
|
SwearJar["profanity"].profane?("arsehole").should be_true
|
7
7
|
end
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
context "marijuana" do
|
11
11
|
it "is inappropriate" do
|
12
12
|
SwearJar["inappropriate"].profane?("marijuana").should be_true
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
context "freaky" do
|
17
17
|
it "is questionable" do
|
18
18
|
SwearJar["questionable"].profane?("freaky").should be_true
|
@@ -23,12 +23,11 @@ describe SwearJar do
|
|
23
23
|
it "is needs review" do
|
24
24
|
SwearJar["needs_review"].profane?("offer").should be_true
|
25
25
|
end
|
26
|
-
end
|
27
|
-
|
26
|
+
end
|
27
|
+
|
28
28
|
context "death" do
|
29
29
|
it "is assault" do
|
30
30
|
SwearJar["assault"].profane?("death").should be_true
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zaarly-swearjar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2012-02-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fuzzyhash
|
17
|
-
requirement: &
|
17
|
+
requirement: &70345424787680 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 0.0.11
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70345424787680
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: bundler
|
28
|
-
requirement: &
|
28
|
+
requirement: &70345424787100 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70345424787100
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rake
|
39
|
-
requirement: &
|
39
|
+
requirement: &70345424786640 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *70345424786640
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rspec
|
50
|
-
requirement: &
|
50
|
+
requirement: &70345424786220 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *70345424786220
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: activesupport
|
61
|
-
requirement: &
|
61
|
+
requirement: &70345424785760 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *70345424785760
|
70
70
|
description: Put another nickel in the swearjar. Simple profanity detection with content
|
71
71
|
analysis.
|
72
72
|
email: joshbuddy@gmail.com
|
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
segments:
|
105
105
|
- 0
|
106
|
-
hash:
|
106
|
+
hash: 617538836579371301
|
107
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
108
|
none: false
|
109
109
|
requirements:
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
114
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.8.
|
115
|
+
rubygems_version: 1.8.11
|
116
116
|
signing_key:
|
117
117
|
specification_version: 3
|
118
118
|
summary: Put another nickel in the swearjar. Simple profanity detection with content
|