google_safe_browsing 0.6.1 → 0.6.2

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: d946ae1600f648b9fc8a7c0768e0b7705e24f223
4
- data.tar.gz: c34af8e761bea301d64a65cfa078f1449713d7f1
3
+ metadata.gz: 0d187e5a85e975ac9103be2439146189032756e4
4
+ data.tar.gz: 8e779fea3a2d207d27f3ffeb4c2ed3b876844628
5
5
  SHA512:
6
- metadata.gz: 05d832d303bb171aa3c0f4d71e9d23e3263e95ca74b976213f1b4c7e337ce67dfab6d64b860764c7f6fb3c06e99e57fd2b4fbc1f9b36085b40393a661f751d0f
7
- data.tar.gz: 8ff8c417be266b6fb170ea84a5044f8295ea9693d692639f46de0c8b0b470095476cdd169fdceb2b4200d47301bdb5da51519d71e3f7781cafa0a4f765dbb379
6
+ metadata.gz: a3475dcb3a3dbce00cf27e7a0e120b784d30c9a241e434a2891c2bbcc8319ab092f30c7351c613e8da1e930886ceb0662d022e207028eecb33daf1aa699a449e
7
+ data.tar.gz: d87d6f0764b760f68aa490948e01b252fdf7ef56fc485d963b24fd59e828ca794d753000494c74de77df90653d3dc78c2eac77f988c6f820d5652b3cc3c1791a
data/README.md CHANGED
@@ -4,9 +4,11 @@ This gem allows easy Google Safe Browsing APIv2 usage with optional integration
4
4
  into Rails 3 apps.
5
5
 
6
6
  [![Build
7
- Status](https://travis-ci.org/mobiledefense/google_safe_browsing.png)](https://travis-ci.org//mobiledefense/google_safe_browsing)
7
+ Status](https://travis-ci.org/mobiledefense/google_safe_browsing.png)](https://travis-ci.org/mobiledefense/google_safe_browsing)
8
8
  [![Code
9
9
  Climate](https://codeclimate.com/github/mobiledefense/google_safe_browsing.png)](https://codeclimate.com/github/mobiledefense/google_safe_browsing)
10
+ [![PullReview
11
+ stats](https://www.pullreview.com/github/mobiledefense/google_safe_browsing/badges/master.svg?)](https://www.pullreview.com/github/mobiledefense/google_safe_browsing/reviews/master)
10
12
 
11
13
  It includes:
12
14
 
@@ -1,6 +1,7 @@
1
1
  module GoogleSafeBrowsing
2
2
  class AddShavar < ActiveRecord::Base
3
3
  include Shavar
4
+ extend Shavar::ClassMethods
4
5
 
5
6
  self.table_name = 'gsb_add_shavars'
6
7
  end
@@ -19,6 +19,7 @@ module GoogleSafeBrowsing
19
19
  body << BinaryHelper.hex_to_bin(h[0..7])
20
20
  end
21
21
 
22
+
22
23
  body
23
24
  end
24
25
 
@@ -80,6 +81,8 @@ module GoogleSafeBrowsing
80
81
  response = yield uri
81
82
  end while self.please_rekey?(response.body)
82
83
 
84
+ return unless response.body
85
+
83
86
  lines = response.body.split("\n")
84
87
  mac = lines.shift
85
88
  if mac[0..1] == 'm:'
@@ -110,7 +113,7 @@ module GoogleSafeBrowsing
110
113
  end
111
114
 
112
115
  def self.please_rekey?(body)
113
- if body.split("\n").include? REKEY_PREFIX
116
+ if body.to_s.split("\n").include? REKEY_PREFIX
114
117
  GoogleSafeBrowsing.config.client_key = nil
115
118
  GoogleSafeBrowsing.config.wrapped_key = nil
116
119
  true
@@ -1,7 +1,9 @@
1
1
  module GoogleSafeBrowsing
2
2
  module Shavar
3
- def self.delete_chunks_from_list(list, chunk_list)
4
- self.class.where(list: list, chunk_number: chunk_list.to_a).delete_all
3
+ module ClassMethods
4
+ def delete_chunks_from_list(list, chunk_list)
5
+ where(list: list, chunk_number: chunk_list.to_a).delete_all
6
+ end
5
7
  end
6
8
  end
7
9
  end
@@ -1,6 +1,7 @@
1
1
  module GoogleSafeBrowsing
2
2
  class SubShavar < ActiveRecord::Base
3
3
  include Shavar
4
+ extend Shavar::ClassMethods
4
5
 
5
6
  self.table_name = 'gsb_sub_shavars'
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module GoogleSafeBrowsing
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_safe_browsing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Marshall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-02 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails