google-site-search 0.0.3 → 0.0.5
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/Gemfile +1 -0
- data/lib/google-site-search.rb +14 -9
- data/lib/google-site-search/search.rb +17 -11
- data/lib/google-site-search/version.rb +1 -1
- data/test/data/utf8_results.xml +127 -0
- data/test/test_google_site_search.rb +70 -0
- data/test/test_helper.rb +2 -0
- data/test/test_search.rb +1 -16
- metadata +8 -6
data/Gemfile
CHANGED
data/lib/google-site-search.rb
CHANGED
@@ -15,7 +15,6 @@ require "xml"
|
|
15
15
|
# A module to help query and parse the google site search api.
|
16
16
|
#
|
17
17
|
module GoogleSiteSearch
|
18
|
-
|
19
18
|
|
20
19
|
GOOGLE_SEARCH_URL = "http://www.google.com"
|
21
20
|
DEFAULT_PARAMS = {
|
@@ -31,16 +30,22 @@ module GoogleSiteSearch
|
|
31
30
|
end
|
32
31
|
|
33
32
|
# See Search - This is a convienence method for creating and querying.
|
34
|
-
|
35
|
-
|
33
|
+
# This method can except a block which can access the resulting search object.
|
34
|
+
def query url, result_class = Result, &block
|
35
|
+
search_result = Search.new(url, result_class).query
|
36
|
+
yield(search_result) if block_given?
|
37
|
+
search_result
|
36
38
|
end
|
37
39
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
# See Search - This allows you to retrieve up to (times) number of searchs if they
|
41
|
+
# are available (i.e. Stops if a search has no next_results_url).
|
42
|
+
# This method can except a block which can access the resulting search object.
|
43
|
+
def query_multiple times, url, result_class = Result, &block
|
44
|
+
searchs = [query(url, result_class, &block).query]
|
45
|
+
while (times=times-1) > 0
|
46
|
+
next_results_url = searchs.last.try(:next_results_url)
|
47
|
+
break if next_results_url.blank?
|
48
|
+
searchs << search_result = query(url, result_class, &block).query
|
44
49
|
end
|
45
50
|
searchs
|
46
51
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module GoogleSiteSearch
|
2
2
|
|
3
|
+
class ParsingError < StandardError; end;
|
4
|
+
|
3
5
|
# Search is responsible for parsing the returned xml from
|
4
6
|
# google's API.
|
5
7
|
#
|
@@ -56,18 +58,22 @@ module GoogleSiteSearch
|
|
56
58
|
private
|
57
59
|
|
58
60
|
def parse_xml
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
61
|
+
begin
|
62
|
+
doc = ::XML::Parser.string(@xml).parse
|
63
|
+
doc.find("//GSP/RES/R").each do |result_node|
|
64
|
+
@results << result_class.new(result_node)
|
65
|
+
end
|
63
66
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
spelling_node = doc.find_first("Spelling/Suggestion")
|
68
|
+
@spelling = spelling_node.try(:content)
|
69
|
+
@spelling_q = spelling_node.try(:attributes).try(:[],:q)
|
70
|
+
@estimated_results_total = doc.find_first("RES/M").try(:content)
|
71
|
+
@next_results_url = doc.find_first("RES/NB/NU").try(:content)
|
72
|
+
@previous_results_url = doc.find_first("RES/NB/PU").try(:content)
|
73
|
+
@search_query = doc.find_first("Q").try(:content)
|
74
|
+
rescue Exception => e
|
75
|
+
raise ParsingError, "#{e.message} URL:[#{@url}] XML:[#{@xml}]"
|
76
|
+
end
|
71
77
|
end
|
72
78
|
end
|
73
79
|
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<GSP VER="3.2">
|
3
|
+
<TM>0.075037</TM>
|
4
|
+
<Q>rails</Q>
|
5
|
+
<PARAM name="q" value="rails" original_value="rails" url_escaped_value="rails" js_escaped_value="rails"/>
|
6
|
+
<PARAM name="num" value="2" original_value="2" url_escaped_value="2" js_escaped_value="2"/>
|
7
|
+
<PARAM name="hl" value="en" original_value="en" url_escaped_value="en" js_escaped_value="en"/>
|
8
|
+
<PARAM name="client" value="google-csbe" original_value="google-csbe" url_escaped_value="google-csbe" js_escaped_value="google-csbe"/>
|
9
|
+
<PARAM name="boostcse" value="0" original_value="0" url_escaped_value="0" js_escaped_value="0"/>
|
10
|
+
<PARAM name="output" value="xml_no_dtd" original_value="xml_no_dtd" url_escaped_value="xml_no_dtd" js_escaped_value="xml_no_dtd"/>
|
11
|
+
<PARAM name="ie" value="UTF-8" original_value="UTF-8" url_escaped_value="UTF-8" js_escaped_value="UTF-8"/>
|
12
|
+
<PARAM name="oe" value="UTF-8" original_value="UTF-8" url_escaped_value="UTF-8" js_escaped_value="UTF-8"/>
|
13
|
+
<PARAM name="prmd" value="ivnslb" original_value="ivnslb" url_escaped_value="ivnslb" js_escaped_value="ivnslb"/>
|
14
|
+
<PARAM name="ei" value="PYSNUNWAKKea2AXH0YDYDA" original_value="PYSNUNWAKKea2AXH0YDYDA" url_escaped_value="PYSNUNWAKKea2AXH0YDYDA" js_escaped_value="PYSNUNWAKKea2AXH0YDYDA"/>
|
15
|
+
<PARAM name="start" value="2" original_value="2" url_escaped_value="2" js_escaped_value="2"/>
|
16
|
+
<PARAM name="sa" value="N" original_value="N" url_escaped_value="N" js_escaped_value="N"/>
|
17
|
+
<SEARCH_MODES>
|
18
|
+
<PROMOTED_MODES/>
|
19
|
+
<UNPROMOTED_MODES/>
|
20
|
+
<MORE_TEXT>More</MORE_TEXT>
|
21
|
+
<LESS_TEXT>Fewer</LESS_TEXT>
|
22
|
+
</SEARCH_MODES>
|
23
|
+
<Spelling>
|
24
|
+
<Suggestion q="fake suggestion escaped">fake suggestion not escaped</Suggestion>
|
25
|
+
</Spelling>
|
26
|
+
<Context>
|
27
|
+
<title>Info-Tech Research Group</title>
|
28
|
+
<Facet>
|
29
|
+
<FacetItem>
|
30
|
+
<label>test_refinement</label>
|
31
|
+
<anchor_text>Test Refinement</anchor_text>
|
32
|
+
</FacetItem>
|
33
|
+
</Facet>
|
34
|
+
</Context>
|
35
|
+
<RES SN="3" EN="4">
|
36
|
+
<M>29</M>
|
37
|
+
<NB>
|
38
|
+
<PU>/previous</PU>
|
39
|
+
<NU>/next</NU>
|
40
|
+
</NB>
|
41
|
+
<RG START="1" SIZE="2"/>
|
42
|
+
<RG START="1" SIZE="1"> </RG>
|
43
|
+
<R N="3">
|
44
|
+
<U>http://www.infotech.com/research/web-app-dev-trade-in-j2ee-for-ruby-on-rails</U>
|
45
|
+
<UE>http://www.infotech.com/research/web-app-dev-trade-in-j2ee-for-ruby-on-rails</UE>
|
46
|
+
<T>Web App Dev: Trade in J2EE for Ruby on <b>Rails</b> | Info-Tech Research <b>...</b></T>
|
47
|
+
<RK>0</RK>
|
48
|
+
<BYLINEDATE>1144738800</BYLINEDATE>
|
49
|
+
<S>11 Apr 2006 <b>...</b> Ruby is gaining a lot of attention as more Web developers report shorter learning <br> curves and development cycles using the language.</S>
|
50
|
+
<LANG>en</LANG>
|
51
|
+
<PageMap>
|
52
|
+
<DataObject type="metatags">
|
53
|
+
<Attribute name="viewport" value="width=device-width, initial-scale=1.0"/>
|
54
|
+
<Attribute name="csrf-param" value="authenticity_token"/>
|
55
|
+
<Attribute name="csrf-token" value="33G4AEWugnU0gp6lDmF/Ct527Yi16df7TR3qST8t52I="/>
|
56
|
+
<Attribute name="product" value="itap|"/>
|
57
|
+
<Attribute name="product_slug" value="web-app-dev-trade-in-j2ee-for-ruby-on-rails"/>
|
58
|
+
<Attribute name="publicationtype" value="note"/>
|
59
|
+
<Attribute name="lifecycle" value="MakeDecisions|Evaluate|"/>
|
60
|
+
<Attribute name="categories" value="|applications|application-web-development-maintenance|development|"/>
|
61
|
+
<Attribute name="publishdate" value="2006-04-11"/>
|
62
|
+
<Attribute name="authors" value="Curtis Gittens|"/>
|
63
|
+
<Attribute name="title" value="Web App Dev: Trade in J2EE for Ruby on Rails"/>
|
64
|
+
</DataObject>
|
65
|
+
</PageMap>
|
66
|
+
<HAS>
|
67
|
+
<L/>
|
68
|
+
<C SZ="40k" CID="6P9DT50RDYIJ"/>
|
69
|
+
<RT/>
|
70
|
+
</HAS>
|
71
|
+
</R>
|
72
|
+
<RG START="2" SIZE="1"> </RG>
|
73
|
+
<R N="4">
|
74
|
+
<U>http://hr.mcleanco.com/research/hr-craft-effective-performance-improvement-plans</U>
|
75
|
+
<UE>http://hr.mcleanco.com/research/hr-craft-effective-performance-improvement-plans</UE>
|
76
|
+
<T>Implement Performance Improvement Plans | McLean &amp; Company</T>
|
77
|
+
<RK>0</RK>
|
78
|
+
<BYLINEDATE>1313996400</BYLINEDATE>
|
79
|
+
<S>22 Aug 2011 <b>...</b> 1. Implement Performance Improvement Plans. Get employee performance on <br> track before it rides off the <b>rails</b>. McLean &amp; Company. / 12. 00:00 <b>...</b></S>
|
80
|
+
<LANG>en</LANG>
|
81
|
+
<PageMap>
|
82
|
+
<DataObject type="publication">
|
83
|
+
<Attribute name="type">solution-set</Attribute>
|
84
|
+
<Attribute name="type-title">Solution Set</Attribute>
|
85
|
+
<Attribute name="attachment-icons">http://static.infotech.com/images/css/icons/ppt_icon-14x14.png|http://static.infotech.com/images/css/icons/doc_icon-14x14.png</Attribute>
|
86
|
+
<Attribute name="product_type_bias">1</Attribute>
|
87
|
+
<Attribute name="product_families">hr</Attribute>
|
88
|
+
<Attribute name="slug">hr-craft-effective-performance-improvement-plans</Attribute>
|
89
|
+
<Attribute name="categories">talent-management|coaching-and-development</Attribute>
|
90
|
+
<Attribute name="publishdate">2011-05-26</Attribute>
|
91
|
+
<Attribute name="authors">Susanna Hunter</Attribute>
|
92
|
+
<Attribute name="title">Implement Performance Improvement Plans</Attribute>
|
93
|
+
<Attribute name="description">Managers dread implementing a Performance Improvement Plan (PIP) because they think it's a waste of time. However, in a recent McLean & Company survey, 68% of employees who were placed on a PIP were still with the organization. When a manager...</Attribute>
|
94
|
+
<Attribute name="keywords">performance management|Development|difficult employee|performance review|discrimination|termination|Coaching|poor performance|employee performance|Performance Improvement Plan|PIP|performance improvement|Performance appraisal|corrective action|development plans|corrective discipline|progressive discipline|performance issue</Attribute>
|
95
|
+
</DataObject>
|
96
|
+
<DataObject type="metatags">
|
97
|
+
<Attribute name="viewport" value="width=device-width, initial-scale=1.0"/>
|
98
|
+
<Attribute name="csrf-param" value="authenticity_token"/>
|
99
|
+
<Attribute name="csrf-token" value="9UbBckKIdrtN7Gn8ZFSuhOqvTcY/8JzUW34mXU4Cwiw="/>
|
100
|
+
<Attribute name="product" value="hr|"/>
|
101
|
+
<Attribute name="product_slug" value="hr-craft-effective-performance-improvement-plans"/>
|
102
|
+
<Attribute name="publicationtype" value="solution-set"/>
|
103
|
+
<Attribute name="categories" value="|talent-management|coaching-and-development|"/>
|
104
|
+
<Attribute name="publishdate" value="2011-05-26"/>
|
105
|
+
<Attribute name="authors" value="Susanna Hunter|"/>
|
106
|
+
<Attribute name="title" value="Implement Performance Improvement Plans"/>
|
107
|
+
</DataObject>
|
108
|
+
<DataObject type="cse_image">
|
109
|
+
<Attribute name="src" value="http://static.infotech.com/images/MCO-Thumb-SB6.jpg"/>
|
110
|
+
</DataObject>
|
111
|
+
<DataObject type="cse_thumbnail">
|
112
|
+
<Attribute name="width" value="280"/>
|
113
|
+
<Attribute name="height" value="160"/>
|
114
|
+
<Attribute name="src" value="http://t1.gstatic.com/images?q=tbn:ANd9GcSC2UdC2eeAKKC4nh_iWK8oiPjMI06QVKIKUgSwi3VbnlBEI4TmjiaG12IU"/>
|
115
|
+
</DataObject>
|
116
|
+
</PageMap>
|
117
|
+
<HAS>
|
118
|
+
<L/>
|
119
|
+
<C SZ="85k" CID="ffPBTuMTrTIJ"/>
|
120
|
+
<RT/>
|
121
|
+
</HAS>
|
122
|
+
</R>
|
123
|
+
<RHS_COLUMN>
|
124
|
+
<RG START="1" SIZE="0"/>
|
125
|
+
</RHS_COLUMN>
|
126
|
+
</RES>
|
127
|
+
</GSP>
|
@@ -84,4 +84,74 @@ describe GoogleSiteSearch do
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
+
describe ".query" do
|
88
|
+
it "creates a Search object and calls query on it" do
|
89
|
+
mock = MiniTest::Mock.new.expect(:query, mock)
|
90
|
+
Search.stub(:new, mock) do
|
91
|
+
GoogleSiteSearch.query("/doesnt_matter")
|
92
|
+
mock.verify
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
describe ".query_multiple" do
|
98
|
+
|
99
|
+
describe "when there are always next results available" do
|
100
|
+
before do
|
101
|
+
search = Search.new("fake_url",GoogleSiteSearch::Result)
|
102
|
+
search.stubs(:next_results_url).returns("next_url")
|
103
|
+
Search.any_instance.stubs(:query).returns(search)
|
104
|
+
end
|
105
|
+
|
106
|
+
let :result do
|
107
|
+
GoogleSiteSearch.query_multiple(3, "dosent_matter", Result)
|
108
|
+
end
|
109
|
+
|
110
|
+
it "returns an array of query results" do
|
111
|
+
result.must_be_instance_of Array
|
112
|
+
end
|
113
|
+
|
114
|
+
it "performs the correct number of searches" do
|
115
|
+
result.count.must_equal 3
|
116
|
+
end
|
117
|
+
|
118
|
+
describe "accepts and executes a block for each result" do
|
119
|
+
let :block_result do
|
120
|
+
block_result = []
|
121
|
+
GoogleSiteSearch.query_multiple(3, "dosent_matter", Result) do |search|
|
122
|
+
block_result << search.next_results_url
|
123
|
+
end
|
124
|
+
block_result
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should have the mocked next result value" do
|
128
|
+
block_result.select{|result| result == "next_url"}.count.must_equal 3
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
end
|
133
|
+
|
134
|
+
describe "when there are less results then asked for" do
|
135
|
+
|
136
|
+
before do
|
137
|
+
search = Search.new("fake_url",GoogleSiteSearch::Result)
|
138
|
+
search.stubs(:next_results_url).returns(nil)
|
139
|
+
Search.any_instance.stubs(:query).returns(search)
|
140
|
+
end
|
141
|
+
|
142
|
+
let :result do
|
143
|
+
GoogleSiteSearch.query_multiple(3, "dosent_matter", Result)
|
144
|
+
end
|
145
|
+
|
146
|
+
it "returns an array of query results" do
|
147
|
+
result.must_be_instance_of Array
|
148
|
+
end
|
149
|
+
|
150
|
+
it "performs only available searchs" do
|
151
|
+
#next_results stubed to nil so should only ever do 1
|
152
|
+
result.count.must_equal 1
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
end
|
87
157
|
end
|
data/test/test_helper.rb
CHANGED
data/test/test_search.rb
CHANGED
@@ -3,22 +3,7 @@ require_relative 'test_helper'
|
|
3
3
|
describe Search do
|
4
4
|
|
5
5
|
let :xml do
|
6
|
-
|
7
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
8
|
-
<GSP VER="3.2">
|
9
|
-
<TM>0.075037</TM><Q>rails</Q>
|
10
|
-
<PARAM name="q" value="rails" original_value="rails" url_escaped_value="rails" js_escaped_value="rails"></PARAM><PARAM name="num" value="2" original_value="2" url_escaped_value="2" js_escaped_value="2"></PARAM><PARAM name="hl" value="en" original_value="en" url_escaped_value="en" js_escaped_value="en"></PARAM><PARAM name="client" value="google-csbe" original_value="google-csbe" url_escaped_value="google-csbe" js_escaped_value="google-csbe"></PARAM><PARAM name="cx" value="009797329687680929468:y_saholjpsk" original_value="009797329687680929468:y_saholjpsk" url_escaped_value="009797329687680929468%3Ay_saholjpsk" js_escaped_value="009797329687680929468:y_saholjpsk"></PARAM><PARAM name="boostcse" value="0" original_value="0" url_escaped_value="0" js_escaped_value="0"></PARAM><PARAM name="output" value="xml_no_dtd" original_value="xml_no_dtd" url_escaped_value="xml_no_dtd" js_escaped_value="xml_no_dtd"></PARAM><PARAM name="ie" value="UTF-8" original_value="UTF-8" url_escaped_value="UTF-8" js_escaped_value="UTF-8"></PARAM><PARAM name="oe" value="UTF-8" original_value="UTF-8" url_escaped_value="UTF-8" js_escaped_value="UTF-8"></PARAM><PARAM name="prmd" value="ivnslb" original_value="ivnslb" url_escaped_value="ivnslb" js_escaped_value="ivnslb"></PARAM><PARAM name="ei" value="PYSNUNWAKKea2AXH0YDYDA" original_value="PYSNUNWAKKea2AXH0YDYDA" url_escaped_value="PYSNUNWAKKea2AXH0YDYDA" js_escaped_value="PYSNUNWAKKea2AXH0YDYDA"></PARAM><PARAM name="start" value="2" original_value="2" url_escaped_value="2" js_escaped_value="2"></PARAM><PARAM name="sa" value="N" original_value="N" url_escaped_value="N" js_escaped_value="N"></PARAM><SEARCH_MODES><PROMOTED_MODES></PROMOTED_MODES><UNPROMOTED_MODES></UNPROMOTED_MODES><MORE_TEXT>More</MORE_TEXT><LESS_TEXT>Fewer</LESS_TEXT></SEARCH_MODES><Spelling><Suggestion q="fake suggestion escaped">fake suggestion not escaped</Suggestion></Spelling><Context><title>Info-Tech Research Group</title><Facet><FacetItem><label>test_refinement</label><anchor_text>Test Refinement</anchor_text></FacetItem></Facet></Context><RES SN="3" EN="4">
|
11
|
-
it "contains the spelling suggestions" do
|
12
|
-
|
13
|
-
end
|
14
|
-
<M>29</M>
|
15
|
-
<NB><PU>/previous</PU><NU>/next</NU></NB>
|
16
|
-
<RG START="1" SIZE="2"></RG> <RG START="1" SIZE="1"> </RG> <R N="3"><U>http://www.infotech.com/research/web-app-dev-trade-in-j2ee-for-ruby-on-rails</U><UE>http://www.infotech.com/research/web-app-dev-trade-in-j2ee-for-ruby-on-rails</UE><T>Web App Dev: Trade in J2EE for Ruby on <b>Rails</b> | Info-Tech Research <b>...</b></T><RK>0</RK><BYLINEDATE>1144738800</BYLINEDATE><S>11 Apr 2006 <b>...</b> Ruby is gaining a lot of attention as more Web developers report shorter learning <br> curves and development cycles using the language.</S><LANG>en</LANG><Label>_cse_y_saholjpsk</Label><PageMap><DataObject type="metatags"><Attribute name="viewport" value="width=device-width, initial-scale=1.0"/><Attribute name="csrf-param" value="authenticity_token"/><Attribute name="csrf-token" value="33G4AEWugnU0gp6lDmF/Ct527Yi16df7TR3qST8t52I="/><Attribute name="product" value="itap|"/><Attribute name="product_slug" value="web-app-dev-trade-in-j2ee-for-ruby-on-rails"/><Attribute name="publicationtype" value="note"/><Attribute name="lifecycle" value="MakeDecisions|Evaluate|"/><Attribute name="categories" value="|applications|application-web-development-maintenance|development|"/><Attribute name="publishdate" value="2006-04-11"/><Attribute name="authors" value="Curtis Gittens|"/><Attribute name="title" value="Web App Dev: Trade in J2EE for Ruby on Rails"/></DataObject></PageMap><HAS><L/><C SZ="40k" CID="6P9DT50RDYIJ"/><RT/></HAS></R>
|
17
|
-
<RG START="2" SIZE="1"> </RG> <R N="4"><U>http://hr.mcleanco.com/research/hr-craft-effective-performance-improvement-plans</U><UE>http://hr.mcleanco.com/research/hr-craft-effective-performance-improvement-plans</UE><T>Implement Performance Improvement Plans | McLean &amp; Company</T><RK>0</RK><BYLINEDATE>1313996400</BYLINEDATE><S>22 Aug 2011 <b>...</b> 1. Implement Performance Improvement Plans. Get employee performance on <br> track before it rides off the <b>rails</b>. McLean &amp; Company. / 12. 00:00 <b>...</b></S><LANG>en</LANG><Label>_cse_y_saholjpsk</Label><PageMap><DataObject type="publication"><Attribute name="type">solution-set</Attribute><Attribute name="type-title">Solution Set</Attribute><Attribute name="attachment-icons">http://static.infotech.com/images/css/icons/ppt_icon-14x14.png|http://static.infotech.com/images/css/icons/doc_icon-14x14.png</Attribute><Attribute name="product_type_bias">1</Attribute><Attribute name="product_families">hr</Attribute><Attribute name="slug">hr-craft-effective-performance-improvement-plans</Attribute><Attribute name="categories">talent-management|coaching-and-development</Attribute><Attribute name="publishdate">2011-05-26</Attribute><Attribute name="authors">Susanna Hunter</Attribute><Attribute name="title">Implement Performance Improvement Plans</Attribute><Attribute name="description">Managers dread implementing a Performance Improvement Plan (PIP) because they think it's a waste of time. However, in a recent McLean & Company survey, 68% of employees who were placed on a PIP were still with the organization. When a manager...</Attribute><Attribute name="keywords">performance management|Development|difficult employee|performance review|discrimination|termination|Coaching|poor performance|employee performance|Performance Improvement Plan|PIP|performance improvement|Performance appraisal|corrective action|development plans|corrective discipline|progressive discipline|performance issue</Attribute></DataObject><DataObject type="metatags"><Attribute name="viewport" value="width=device-width, initial-scale=1.0"/><Attribute name="csrf-param" value="authenticity_token"/><Attribute name="csrf-token" value="9UbBckKIdrtN7Gn8ZFSuhOqvTcY/8JzUW34mXU4Cwiw="/><Attribute name="product" value="hr|"/><Attribute name="product_slug" value="hr-craft-effective-performance-improvement-plans"/><Attribute name="publicationtype" value="solution-set"/><Attribute name="categories" value="|talent-management|coaching-and-development|"/><Attribute name="publishdate" value="2011-05-26"/><Attribute name="authors" value="Susanna Hunter|"/><Attribute name="title" value="Implement Performance Improvement Plans"/></DataObject><DataObject type="cse_image"><Attribute name="src" value="http://static.infotech.com/images/MCO-Thumb-SB6.jpg"/></DataObject><DataObject type="cse_thumbnail"><Attribute name="width" value="280"/><Attribute name="height" value="160"/><Attribute name="src" value="http://t1.gstatic.com/images?q=tbn:ANd9GcSC2UdC2eeAKKC4nh_iWK8oiPjMI06QVKIKUgSwi3VbnlBEI4TmjiaG12IU"/></DataObject></PageMap><HAS><L/><C SZ="85k" CID="ffPBTuMTrTIJ"/><RT/></HAS></R>
|
18
|
-
<RHS_COLUMN><RG START="1" SIZE="0"></RG></RHS_COLUMN></RES>
|
19
|
-
</GSP>
|
20
|
-
xml
|
21
|
-
|
6
|
+
IO.read(File.join(File.dirname(__FILE__), "data", "utf8_results.xml"))
|
22
7
|
end
|
23
8
|
|
24
9
|
describe "#query" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-site-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &22916060 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *22916060
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: libxml-ruby
|
27
|
-
requirement: &
|
27
|
+
requirement: &22915560 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *22915560
|
36
36
|
description: A gem to aid in the consumption of the google site search service; querys
|
37
37
|
the service, populates a result object and has some related helper methods.
|
38
38
|
email:
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- lib/google-site-search/search.rb
|
54
54
|
- lib/google-site-search/url_builder.rb
|
55
55
|
- lib/google-site-search/version.rb
|
56
|
+
- test/data/utf8_results.xml
|
56
57
|
- test/test_google_site_search.rb
|
57
58
|
- test/test_helper.rb
|
58
59
|
- test/test_search.rb
|
@@ -83,6 +84,7 @@ specification_version: 3
|
|
83
84
|
summary: A gem to aid in the consumption of the google site search service; querys
|
84
85
|
the service, populates a result object and has some related helper methods.
|
85
86
|
test_files:
|
87
|
+
- test/data/utf8_results.xml
|
86
88
|
- test/test_google_site_search.rb
|
87
89
|
- test/test_helper.rb
|
88
90
|
- test/test_search.rb
|