mlangenberg-googlesearch 0.0.1 → 0.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.
data/googlesearch.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'googlesearch'
3
- s.version = '0.0.1'
4
- s.date = '2009-01-07'
3
+ s.version = '0.0.2'
4
+ s.date = '2009-01-13'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.has_rdoc = false
7
7
  s.summary = 'Google CSE implementation'
data/lib/googlesearch.rb CHANGED
@@ -7,7 +7,7 @@ class GoogleSearch
7
7
  attr_reader :response
8
8
 
9
9
  def initialize(options, search_request = SearchRequest.new)
10
- @response = SearchResponse.new search_request.get("http://www.google.com/search?&q=#{options[:q]}&client=google-csbe&output=xml&cx=#{options[:cx]}")
10
+ @response = SearchResponse.new search_request.get("http://www.google.com/search?&q=#{options[:q]}&client=google-csbe&output=xml&cx=#{options[:cx]}&cr=lang_#{options[:cr]}")
11
11
  end
12
12
  end
13
13
 
@@ -4,11 +4,11 @@ describe GoogleSearch do
4
4
  it do
5
5
  request_mock = mock('request')
6
6
  request_mock.should_receive(:get).with(
7
- 'http://www.google.com/search?&q=adres&client=google-csbe&output=xml&cx=unique-cse-id'
7
+ 'http://www.google.com/search?&q=adres&client=google-csbe&output=xml&cx=unique-cse-id&cr=lang_nl'
8
8
  ).and_return('wat_xml')
9
9
 
10
10
  SearchResponse.should_receive(:new).with('wat_xml').and_return('search-response-object')
11
- search = GoogleSearch.new({:cx => 'unique-cse-id', :q => 'adres'}, request_mock)
11
+ search = GoogleSearch.new({:cx => 'unique-cse-id', :q => 'adres', :cr => 'nl'}, request_mock)
12
12
  search.response.should == 'search-response-object'
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mlangenberg-googlesearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rene Heino
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-01-07 00:00:00 -08:00
13
+ date: 2009-01-13 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency