google-search 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +4 -0
- data/google-search.gemspec +2 -2
- data/lib/google-search/search/base.rb +3 -3
- data/spec/search_web_spec.rb +8 -1
- metadata +38 -39
data/History.rdoc
CHANGED
data/google-search.gemspec
CHANGED
@@ -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.
|
5
|
+
s.version = "1.0.3"
|
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{
|
9
|
+
s.date = %q{2012-08-29}
|
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"]
|
@@ -203,10 +203,10 @@ module Google
|
|
203
203
|
# Url encode _string_.
|
204
204
|
|
205
205
|
def self.url_encode string
|
206
|
-
string.to_s.gsub(/([^ a-zA-Z0-9_.-]+)/
|
207
|
-
'%' + $1.unpack('H2' * $1.
|
206
|
+
string.to_s.gsub(/([^ a-zA-Z0-9_.-]+)/) {
|
207
|
+
'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
|
208
208
|
}.tr(' ', '+')
|
209
209
|
end
|
210
210
|
|
211
211
|
end
|
212
|
-
end
|
212
|
+
end
|
data/spec/search_web_spec.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
|
2
3
|
require File.dirname(__FILE__) + '/spec_helper'
|
3
4
|
|
@@ -38,5 +39,11 @@ describe Google::Search::Web do
|
|
38
39
|
@search.get_uri.should include('filter=0')
|
39
40
|
end
|
40
41
|
end
|
42
|
+
describe "multibyte string query" do
|
43
|
+
it "url encoding" do
|
44
|
+
@search.query = "日本語"
|
45
|
+
@search.get_uri.should include('%E6%97%A5%E6%9C%AC%E8%AA%9E')
|
46
|
+
end
|
47
|
+
end
|
41
48
|
end
|
42
|
-
end
|
49
|
+
end
|
metadata
CHANGED
@@ -1,34 +1,37 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-search
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
+
authors:
|
7
8
|
- TJ Holowaychuk
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-08-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: json
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
17
22
|
type: :runtime
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
description: Google Search API
|
26
31
|
email: tj@vision-media.ca
|
27
32
|
executables: []
|
28
|
-
|
29
33
|
extensions: []
|
30
|
-
|
31
|
-
extra_rdoc_files:
|
34
|
+
extra_rdoc_files:
|
32
35
|
- lib/google-search/item/base.rb
|
33
36
|
- lib/google-search/item/blog.rb
|
34
37
|
- lib/google-search/item/book.rb
|
@@ -60,7 +63,7 @@ extra_rdoc_files:
|
|
60
63
|
- tasks/docs.rake
|
61
64
|
- tasks/gemspec.rake
|
62
65
|
- tasks/spec.rake
|
63
|
-
files:
|
66
|
+
files:
|
64
67
|
- examples/image.rb
|
65
68
|
- examples/images.html
|
66
69
|
- examples/web.rb
|
@@ -131,38 +134,34 @@ files:
|
|
131
134
|
- tasks/docs.rake
|
132
135
|
- tasks/gemspec.rake
|
133
136
|
- tasks/spec.rake
|
134
|
-
has_rdoc: true
|
135
137
|
homepage: http://github.com/visionmedia/google-search
|
136
138
|
licenses: []
|
137
|
-
|
138
139
|
post_install_message:
|
139
|
-
rdoc_options:
|
140
|
+
rdoc_options:
|
140
141
|
- --line-numbers
|
141
142
|
- --inline-source
|
142
143
|
- --title
|
143
144
|
- Google-search
|
144
145
|
- --main
|
145
146
|
- README.rdoc
|
146
|
-
require_paths:
|
147
|
+
require_paths:
|
147
148
|
- lib
|
148
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
|
+
none: false
|
157
|
+
requirements:
|
158
|
+
- - ! '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '1.2'
|
160
161
|
requirements: []
|
161
|
-
|
162
162
|
rubyforge_project: google-search
|
163
|
-
rubygems_version: 1.
|
163
|
+
rubygems_version: 1.8.23
|
164
164
|
signing_key:
|
165
165
|
specification_version: 3
|
166
166
|
summary: Google Search API
|
167
167
|
test_files: []
|
168
|
-
|