visionmedia-google-search 1.0.1 → 1.0.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.
@@ -1,4 +1,8 @@
1
1
 
2
+ === 1.0.2 / 2009-07-27
3
+
4
+ * Defaulting Item#uri to unescapedUrl
5
+
2
6
  === 1.0.0 / 2009-07-24
3
7
 
4
8
  * Initial release
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{google-search}
5
- s.version = "1.0.1"
5
+ s.version = "1.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["TJ Holowaychuk"]
9
- s.date = %q{2009-07-24}
9
+ s.date = %q{2009-07-30}
10
10
  s.description = %q{Google Search API}
11
11
  s.email = %q{tj@vision-media.ca}
12
12
  s.extra_rdoc_files = ["lib/google-search/item/base.rb", "lib/google-search/item/blog.rb", "lib/google-search/item/book.rb", "lib/google-search/item/image.rb", "lib/google-search/item/local.rb", "lib/google-search/item/news.rb", "lib/google-search/item/patent.rb", "lib/google-search/item/video.rb", "lib/google-search/item/web.rb", "lib/google-search/item.rb", "lib/google-search/response.rb", "lib/google-search/search/base.rb", "lib/google-search/search/blog.rb", "lib/google-search/search/book.rb", "lib/google-search/search/image.rb", "lib/google-search/search/local.rb", "lib/google-search/search/mixins/filter.rb", "lib/google-search/search/mixins/order_by.rb", "lib/google-search/search/mixins/safety_level.rb", "lib/google-search/search/mixins.rb", "lib/google-search/search/news.rb", "lib/google-search/search/patent.rb", "lib/google-search/search/video.rb", "lib/google-search/search/web.rb", "lib/google-search/search.rb", "lib/google-search/version.rb", "lib/google-search.rb", "README.rdoc", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
@@ -18,11 +18,6 @@ module Google
18
18
 
19
19
  attr_reader :uri
20
20
 
21
- ##
22
- # Unescaped uri.
23
-
24
- attr_reader :unescaped_uri
25
-
26
21
  ##
27
22
  # Visible uri.
28
23
 
@@ -54,9 +49,8 @@ module Google
54
49
  def initialize hash
55
50
  @index = hash['index']
56
51
  @title = hash['titleNoFormatting'] || hash['title']
57
- @uri = hash['url'] || hash['postUrl']
52
+ @uri = hash['unescapedUrl'] || hash['url'] || hash['postUrl']
58
53
  @content = hash['contentNoFormatting'] || hash['content']
59
- @unescaped_uri = hash['unescapedUrl']
60
54
  @thumbnail_uri = hash['tbUrl']
61
55
  @thumbnail_width = hash['tbWidth'].to_i
62
56
  @thumbnail_height = hash['tbHeight'].to_i
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Google
3
3
  class Search
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
6
6
  end
@@ -9,7 +9,7 @@ describe Google::Search::Item::Book do
9
9
  item.title.should include('Foo Fighters')
10
10
  item.author.should == '<b>Foo</b> Fighters (CRT), Hal Leonard Publishing Corporation'
11
11
  item.id.should == 'ISBN1423404580'
12
- item.uri.should == 'http://books.google.com/books%3Fid%3DvUoCAgAACAAJ%26dq%3Dfoo%26client%3Dinternal-uds%26source%3duds'
12
+ item.uri.should == 'http://books.google.com/books?id=vUoCAgAACAAJ&dq=foo&client=internal-uds&source=uds'
13
13
  item.thumbnail_uri.should == 'http://bks6.books.google.com/books?id=vUoCAgAACAAJ&printsec=frontcover&img=1&zoom=5&sig=ACfU3U1NHHhXuERH30Xfn0GC3A0BW5nMPg'
14
14
  item.published_year.should == 2006
15
15
  item.pages.should == 69
@@ -8,12 +8,11 @@ describe Google::Search::Item::News do
8
8
  item = Google::Search::Item::News.new hash
9
9
  item.title.should include('TICKET TO DINING')
10
10
  item.language.should == 'en'
11
- item.uri.should == 'http%3A%2F%2Fwww.montgomerynews.com%2Farticles%2F2009%2F07%2F22%2Fentertainment%2Fdoc4a672746b0941650009917.txt'
11
+ item.uri.should == 'http://www.montgomerynews.com/articles/2009/07/22/entertainment/doc4a672746b0941650009917.txt'
12
12
  item.published.should be_a(DateTime)
13
13
  item.publisher.should == 'Montgomery Newspapers'
14
14
  item.content.should include('After all, it was')
15
15
  item.redirect_uri.should == 'http://news.google.com/news/url?sa=T&ct=us/0-0-0&fd=S&url=http://www.montgomerynews.com/articles/2009/07/22/entertainment/doc4a672746b0941650009917.txt&cid=0&ei=4aFnSpnxK474rQPutNHRAQ&usg=AFQjCNGsuTniL5DY24lNJ8qy204ZWjQoKA'
16
- item.unescaped_uri.should == 'http://www.montgomerynews.com/articles/2009/07/22/entertainment/doc4a672746b0941650009917.txt'
17
16
  item.location.should == 'Fort Washington,PA,USA'
18
17
  end
19
18
  end
@@ -11,9 +11,8 @@ describe Google::Search::Item::Patent do
11
11
  item.content.should include('METHOD OF AND APPARATUS FOR DETERMINING RH')
12
12
  item.assignee.should == ''
13
13
  item.application_date.should be_a(DateTime)
14
- item.uri.should == 'http://www.google.com/patents/about%3Fid%3DGDMdAAAAEBAJ%26dq%3Dfoo%26client%3Dinternal-uds%26source%3duds'
14
+ item.uri.should == 'http://www.google.com/patents/about?id=GDMdAAAAEBAJ&dq=foo&client=internal-uds&source=uds'
15
15
  item.thumbnail_uri.should == 'http://bks9.books.google.com/patents?id=GDMdAAAAEBAJ&printsec=drawing&img=1&zoom=1&sig=ACfU3U10b3w-4hMfKTEykPmtqnoObaLhaA'
16
- item.unescaped_uri.should == 'http://www.google.com/patents/about?id=GDMdAAAAEBAJ&dq=foo&client=internal-uds&source=uds'
17
16
  item.status.should == 'issued'
18
17
  end
19
18
  end
@@ -13,7 +13,6 @@ describe Google::Search::Item::Web do
13
13
  item.uri.should == 'http://en.wikipedia.org/wiki/Foobar'
14
14
  item.cache_uri.should == 'http://www.google.com/search?q=cache:4styY9qq7tYJ:en.wikipedia.org'
15
15
  item.visible_uri.should == 'en.wikipedia.org'
16
- item.unescaped_uri.should == 'http://en.wikipedia.org/wiki/Foobar'
17
16
  end
18
17
  end
19
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: visionmedia-google-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Holowaychuk
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-24 00:00:00 -07:00
12
+ date: 2009-07-30 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -133,6 +133,7 @@ files:
133
133
  - tasks/spec.rake
134
134
  has_rdoc: false
135
135
  homepage: http://github.com/visionmedia/google-search
136
+ licenses:
136
137
  post_install_message:
137
138
  rdoc_options:
138
139
  - --line-numbers
@@ -158,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
159
  requirements: []
159
160
 
160
161
  rubyforge_project: google-search
161
- rubygems_version: 1.2.0
162
+ rubygems_version: 1.3.5
162
163
  signing_key:
163
164
  specification_version: 3
164
165
  summary: Google Search API