spambox 0.3.1 → 0.3.2

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/spambox.rb +5 -2
  3. metadata +1 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42b3aac0468aeff152521ab737e6fef1b1f673ad
4
- data.tar.gz: 88ca40c356d3528442b5825ba6258b7e17090865
3
+ metadata.gz: a3aaa361c32dad4c4e71e787b032014340db3eb4
4
+ data.tar.gz: acac36459041d4d1b8a4c882571725065b70b66a
5
5
  SHA512:
6
- metadata.gz: 0e2bbed2ff8e574251ceed0ec8ce075f20b1f6ac1d376744560901cc5743587738c61a73d4716c3769b40a57c8f36093615c2482ef2a9a74939b12fa0bf248d0
7
- data.tar.gz: c7dfa876d51fa0051bebacc54a69614a2f784cc2dcac70a3392d5c87788586536ec5f95a7091c9b935c4be25b214fdbacb93be6b69088a37fe3130056a9b7f1a
6
+ metadata.gz: 97e0556763688ffe2e95aeba0dc23ee37fc1ac34f721f6b64bb27160f656d6149ddc962605304f9fdcbbcfdeb000647f14d7358d491f540c997169198f89b9d8
7
+ data.tar.gz: d9e2b943d09faf9a7956563e5ae8cdd5043fae4f080b04b116114ce093c8c58370cf0a1777eb6ca5194aff399a77b14ed4de2af493c4fc965f73674c6cab22ff
data/lib/spambox.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require "json"
2
2
  require "open-uri"
3
3
  require "sanitize"
4
- require "active_support/core_ext/string/filters"
5
4
 
6
5
  class Spambox
7
6
  FORMBOX_BLACKLIST_URL = "https://formbox.es/spam-keywords.json"
@@ -31,7 +30,7 @@ class Spambox
31
30
  end
32
31
 
33
32
  def flat_string
34
- @flat_string ||= object_to_string.squish
33
+ @flat_string ||= squish(object_to_string)
35
34
  end
36
35
 
37
36
  def object_to_string
@@ -80,4 +79,8 @@ class Spambox
80
79
  return hash if hash.is_a? String
81
80
  hash.flat_map { |_, v| [*flatten_hash_values(v)] }
82
81
  end
82
+
83
+ def squish(string)
84
+ string.gsub(/[[:space:]]+/, ' ').strip
85
+ end
83
86
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spambox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Jansen
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
- - !ruby/object:Gem::Dependency
28
- name: activesupport
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '4.2'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '4.2'
41
27
  description: Spambox uses Formbox.es API to check for spam.
42
28
  email:
43
29
  - joshuajansen88@gmail.com