cf-swearjar 1.0.6 → 1.0.7

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.
@@ -1,3 +1,3 @@
1
1
  class Swearjar
2
- VERSION = '1.0.6'
2
+ VERSION = '1.0.7'
3
3
  end
data/lib/swearjar.rb CHANGED
@@ -33,7 +33,7 @@ class Swearjar
33
33
 
34
34
  def scan(string, &block)
35
35
  string = string.to_s
36
- string.scan(/\b[a-zA-Z-]+\b/) do |word|
36
+ string.scan(/\b[a-zA-Z0-9-]+\b/) do |word|
37
37
  block.call(word, hash[word.downcase])
38
38
  end
39
39
  if match = tester.match_with_result(string)
@@ -43,7 +43,7 @@ class Swearjar
43
43
 
44
44
  def profane?(string)
45
45
  string = string.to_s
46
- scan(string) {|word, test| return true if !test.nil?}
46
+ scan(string) {|word, test| return true unless test.nil?}
47
47
  return false
48
48
  end
49
49
 
@@ -66,5 +66,4 @@ class Swearjar
66
66
  scan(string) {|word, test| censored_string.gsub!(word, block_given? ? yield(word) : word.gsub(/\S/, '*')) if test}
67
67
  censored_string
68
68
  end
69
-
70
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf-swearjar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-08 00:00:00.000000000 Z
12
+ date: 2012-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fuzzyhash