google-safe-browsing-lookup 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 97ab8ad5e2567301fb5deff4f363e983b4631ae7
4
+ data.tar.gz: 713cea07d4f26c954802c161a07e673e33ad1bbe
5
+ SHA512:
6
+ metadata.gz: e31826e8c750b49102e70b9f14ffe167b2b13805a7ce94f6ea955e48f09614ed15d0df23fa595b6c041f6318cc0b5b2aa460d7dd415000032b3afe6a0b6e6287
7
+ data.tar.gz: e9546cdbfb80324c4956bdd20d76050ab5f9a4c56caf876bd5729d47e124b576b70256b7b8c40c29b3515d667bd088adefe75008d6881d7d3448e8a2881c2b69
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source "http://rubygems.org"
5
5
  # Dependencies to develop google-safe-browsing-lookup.
6
6
  group :development do
7
7
  gem "shoulda", ">= 0"
8
- gem "bundler", "~> 1.0.0"
9
- gem "jeweler", "~> 1.6.4"
10
- gem "rcov", ">= 0"
8
+ gem "bundler", ">= 0"
9
+ gem "jeweler", ">= 0"
10
+ gem "simplecov", ">= 0"
11
11
  end
@@ -36,8 +36,8 @@ class SafeBrowsingLookup
36
36
  @error = error || false
37
37
  @last_error = ''
38
38
 
39
- @version = '0.1'
40
- @api_version = '3.0'
39
+ @version = '0.2'
40
+ @api_version = '3.1'
41
41
 
42
42
 
43
43
  raise ArgumentError, "Missing API key" if (@key == '')
@@ -66,8 +66,8 @@ class SafeBrowsingLookup
66
66
  body = body + "\n" + canonical(url)
67
67
  end
68
68
 
69
- debug("BODY:\n#{body}\n\n");
70
- uri = URI.parse("https://sb-ssl.google.com/safebrowsing/api/lookup?client=ruby&apikey=#{@key}&appver=#{@version}&pver=#{@api_version}")
69
+ debug("BODY:\n#{body}\n\n")
70
+ uri = URI.parse("https://sb-ssl.google.com/safebrowsing/api/lookup?client=ruby&key=#{@key}&appver=#{@version}&pver=#{@api_version}")
71
71
 
72
72
  http = Net::HTTP.new(uri.host, uri.port)
73
73
  http.open_timeout = 30
@@ -122,7 +122,7 @@ class SafeBrowsingLookup
122
122
  url = "http://#{url}"
123
123
  end
124
124
 
125
- uri = URI.new(url)
125
+ uri = URI.parse(url)
126
126
 
127
127
  return uri.to_s
128
128
  end
@@ -132,9 +132,9 @@ class SafeBrowsingLookup
132
132
  lines = response.split("\n")
133
133
 
134
134
  if (urls.length != lines.length)
135
- error("Number of URLs in the reponse does not match the number of URLs in the request");
136
- error("#{urls.length} / #{lines.length}");
137
- error(response);
135
+ error("Number of URLs in the reponse does not match the number of URLs in the request")
136
+ debug("#{urls.length} / #{lines.length}")
137
+ debug(response);
138
138
  return errors(urls);
139
139
  end
140
140
 
metadata CHANGED
@@ -1,104 +1,112 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-safe-browsing-lookup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Julien Sobrier
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-12-14 00:00:00.000000000 Z
11
+ date: 2015-02-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: shoulda
16
- requirement: &192622840 !ruby/object:Gem::Requirement
17
- none: false
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: '1.5'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *192622840
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
25
27
  - !ruby/object:Gem::Dependency
26
- name: bundler
27
- requirement: &192639400 !ruby/object:Gem::Requirement
28
- none: false
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ~>
31
+ - - ">="
31
32
  - !ruby/object:Gem::Version
32
- version: 1.0.0
33
+ version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *192639400
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  - !ruby/object:Gem::Dependency
37
- name: jeweler
38
- requirement: &192638880 !ruby/object:Gem::Requirement
39
- none: false
42
+ name: shoulda
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ~>
45
+ - - ">="
42
46
  - !ruby/object:Gem::Version
43
- version: 1.6.4
47
+ version: '0'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *192638880
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
47
55
  - !ruby/object:Gem::Dependency
48
- name: rcov
49
- requirement: &192638340 !ruby/object:Gem::Requirement
50
- none: false
56
+ name: yard
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - ">="
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *192638340
58
- description: Google Safe Browsing v2 Lookup is a lighter alternative to the full API.
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Google Safe Browsing v3 Lookup is a lighter alternative to the full API.
59
70
  The service allows users to check up to 10,000 URLs a day against their list og
60
71
  phishing and malicious sites. A free API key is required.
61
72
  email: julien@sobrier.net
62
73
  executables: []
63
74
  extensions: []
64
- extra_rdoc_files:
65
- - LICENSE.txt
66
- - README.rdoc
75
+ extra_rdoc_files: []
67
76
  files:
68
77
  - Gemfile
69
- - LICENSE.txt
70
- - README.rdoc
71
78
  - Rakefile
72
- - VERSION
73
79
  - lib/google-safe-browsing-lookup.rb
74
80
  - test/helper.rb
75
81
  - test/test_google-safe-browsing-lookup.rb
76
- homepage: http://github.com/juliensobrier/google-safe-browsing-lookup-ruby
82
+ homepage: https://github.com/juliensobrier/google-safe-browsing-lookup-ruby
77
83
  licenses:
78
84
  - MIT
85
+ metadata: {}
79
86
  post_install_message:
80
87
  rdoc_options: []
81
88
  require_paths:
82
89
  - lib
83
90
  required_ruby_version: !ruby/object:Gem::Requirement
84
- none: false
85
91
  requirements:
86
- - - ! '>='
92
+ - - ">="
87
93
  - !ruby/object:Gem::Version
88
94
  version: '0'
89
- segments:
90
- - 0
91
- hash: -3349121500631348724
92
95
  required_rubygems_version: !ruby/object:Gem::Requirement
93
- none: false
94
96
  requirements:
95
- - - ! '>='
97
+ - - ">="
96
98
  - !ruby/object:Gem::Version
97
99
  version: '0'
98
100
  requirements: []
99
101
  rubyforge_project:
100
- rubygems_version: 1.8.11
102
+ rubygems_version: 2.2.1
101
103
  signing_key:
102
- specification_version: 3
103
- summary: Ruby library for the Google Safe Browsing v2 Lookup API
104
- test_files: []
104
+ specification_version: 4
105
+ summary: '["Library for the Google Saf Browsing Lookup API", "Google Safe Browsing
106
+ v3 Lookup is a lighter alternative to the full API. The service allows users to
107
+ check up to 10,000 URLs a day against their list og phishing and malicious sites.
108
+ A free API key is required."]'
109
+ test_files:
110
+ - test/helper.rb
111
+ - test/test_google-safe-browsing-lookup.rb
112
+ has_rdoc:
@@ -1,20 +0,0 @@
1
- Copyright (c) 2011 Julien Sobrier
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,36 +0,0 @@
1
- = google-safe-browsing-lookup
2
-
3
- Google Safe Browsing Lookup library for Ruby.
4
-
5
- If you need to check less than 10,000 URLs a day against the Google Safe Browsing v2 API (http://code.google.com/apis/safebrowsing/), you can use the Lookup API (http://code.google.com/apis/safebrowsing/lookup_guide.html) as a lighter alternative to the more complex API (http://code.google.com/apis/safebrowsing/developers_guide_v2.html).
6
-
7
- You need to get an API key from Google at http://code.google.com/apis/safebrowsing/key_signup.html
8
-
9
- == Build and install google-safe-browsing-lookup
10
-
11
- git clone https://github.com/juliensobrier/google-safe-browsing-lookup-ruby
12
- rake build
13
- rake test
14
- rake install
15
-
16
- Or
17
-
18
- gem install google-safe-browsing-lookup
19
-
20
-
21
-
22
- == Contributing to google-safe-browsing-lookup
23
-
24
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
25
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
26
- * Fork the project
27
- * Start a feature/bugfix branch
28
- * Commit and push until you are happy with your contribution
29
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
30
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
31
-
32
- == Copyright
33
-
34
- Copyright (c) 2011 Julien Sobrier. See LICENSE.txt for
35
- further details.
36
-
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.3