duck-duck-go 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ 1.1.2 03-05-2012
2
+ - Fix for URI parsing exceptions InvalidURIError [Chris Nicola - https://github.com/lucisferre]
3
+
1
4
  1.1.1 03-12-2011
2
5
  - Fix live tests after DDG results changed
3
6
 
@@ -39,6 +39,6 @@ API and design heavily influenced by WWW::DuckDuckGo[http://search.cpan.org/~get
39
39
 
40
40
  = Copyright and License
41
41
 
42
- Copyright (c) 2011 Andrew Jones (http://andrew-jones.com)
42
+ Copyright (c) 2012 Andrew Jones (http://andrew-jones.com)
43
43
 
44
44
  This code is available under the MIT License. See the LICENSE file for more details.
data/Rakefile CHANGED
@@ -52,6 +52,12 @@ Rake::RDocTask.new do |rdoc|
52
52
  rdoc.rdoc_files.include('lib/**/*.rb')
53
53
  end
54
54
 
55
+ desc "Run cane to check quality metrics"
56
+ task :quality do
57
+ puts `cane --abc-max 10 --gte coverage/covered_percent,99`
58
+ exit $?.exitstatus unless $?.exitstatus == 0
59
+ end
60
+
55
61
  # dumps out the result of the query, in JSON and Ruby
56
62
  # used during development
57
63
  task :search_dump do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{duck-duck-go}
8
- s.version = "1.1.1"
8
+ s.version = "1.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["andrewrjones"]
12
- s.date = %q{2011-12-05}
12
+ s.date = %q{2012-05-03}
13
13
  s.description = %q{A Ruby library to access the DuckDuckGo Zero Click Info API.}
14
14
  s.email = %q{andrew@arjones.co.uk}
15
15
  s.extra_rdoc_files = [
@@ -42,14 +42,14 @@ module DuckDuckGo
42
42
  abstract = result['Abstract'] unless result['Abstract'].empty?
43
43
  abstract_text = result['AbstractText'] unless result['AbstractText'].empty?
44
44
  abstract_source = result['AbstractSource'] unless result['AbstractSource'].empty?
45
- abstract_url = URI.parse(result['AbstractURL']) unless result['AbstractURL'].empty?
46
- image = URI.parse(result['Image']) unless result['Image'].empty?
45
+ abstract_url = URI.parse(URI.escape(result['AbstractURL'])) unless result['AbstractURL'].empty?
46
+ image = URI.parse(URI.escape(result['Image'])) unless result['Image'].empty?
47
47
  heading = result['Heading'] unless result['Heading'].empty?
48
48
  answer = result['Answer'] unless result['Answer'].empty?
49
49
  answer_type = result['AnswerType'] unless result['AnswerType'].empty?
50
50
  definition = result['Definition'] unless result['Definition'].empty?
51
51
  definition_source = result['DefinitionSource'] unless result['DefinitionSource'].empty?
52
- definition_url = URI.parse(result['DefinitionURL']) unless result['DefinitionURL'].empty?
52
+ definition_url = URI.parse(URI.escape(result['DefinitionURL'])) unless result['DefinitionURL'].empty?
53
53
  type = result['Type'] unless result['Type'].empty?
54
54
 
55
55
  if result['Results']
@@ -79,4 +79,4 @@ module DuckDuckGo
79
79
  end
80
80
  end
81
81
 
82
- end
82
+ end
@@ -799,7 +799,7 @@ class TestZCI < Test::Unit::TestCase
799
799
  "AbstractURL"=>"http://en.wikipedia.org/wiki/Lorem_Ipsum",
800
800
  "Image"=>"",
801
801
  "DefinitionURL"=>
802
- "http://www.thefreedictionary.com/_/search.aspx?pid=aff18&word=lorem%2520ipsum",
802
+ "http://www.merriam-webster.com/dictionary/lorem ipsum",
803
803
  "DefinitionSource"=>"TheFreeDictionary",
804
804
  "AbstractText"=>"",
805
805
  "Type"=>"E"}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duck-duck-go
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 1
10
- version: 1.1.1
9
+ - 2
10
+ version: 1.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - andrewrjones
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-05 00:00:00 +00:00
18
+ date: 2012-05-03 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency