yelpster 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.rdoc +8 -0
- data/lib/yelpster/v1/phone/request/number.rb +2 -1
- data/lib/yelpster/v1/request.rb +2 -2
- data/lib/yelpster/version.rb +1 -1
- data/spec/business_search_spec.rb +11 -11
- data/spec/phone_search_spec.rb +7 -0
- metadata +12 -24
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ea5f96fd6a51f4571eb7f1db0f3aba2f9ec74097
|
4
|
+
data.tar.gz: 1e8ae7365887cba09c1e5eebc66cdaefe672264c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7f53b513568ba71f13f43eb17f012d3cd904dd6c3dd12e5d775fca756e2b181a517c4df2516142d8b5f05563d8eb875d0b928eb502b8b07f44c07321bcc58956
|
7
|
+
data.tar.gz: 1102dd29d49374dce029cdff0d085ad76f6178569baba4ebaac123bf11112e6f06d7b0f63c58b6b6c19e402e2242fb84b1c55f4211d28663c2431c6adf5ad6ef
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== YELPSTER_20141010_1_2_1
|
2
|
+
* [Leslie Viljoen] Add cc (country_code) parameter to v1 phone search
|
3
|
+
|
4
|
+
* [naveed] Check encoding before uncompressing v1 responses
|
5
|
+
|
6
|
+
== YELPSTER_20131013_1_2_0
|
7
|
+
* [naveed] Allow one-time client configuration
|
8
|
+
|
1
9
|
== YELPSTER_20130629_1_1_4
|
2
10
|
* [naveed] Convert Yelp to a module
|
3
11
|
|
@@ -11,13 +11,14 @@ module Yelp
|
|
11
11
|
# the phone number of the business to search for, formatted as
|
12
12
|
# '1112223333'. Make sure you don't have any hyphens or parentheses.
|
13
13
|
attr_reader :phone_number
|
14
|
+
attr_reader :cc
|
14
15
|
|
15
16
|
def base_url
|
16
17
|
'http://api.yelp.com/phone_search'
|
17
18
|
end
|
18
19
|
|
19
20
|
def to_yelp_params
|
20
|
-
super.merge(:phone => phone_number)
|
21
|
+
super.merge(:phone => phone_number, :cc => cc)
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
data/lib/yelpster/v1/request.rb
CHANGED
@@ -47,8 +47,8 @@ module Yelp
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def pull_results (url, http_params)
|
50
|
-
|
51
|
-
|
50
|
+
response = open(url, http_params)
|
51
|
+
response.content_encoding.include?('gzip') ? Zlib::GzipReader.new(response).read : response.read
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
data/lib/yelpster/version.rb
CHANGED
@@ -9,17 +9,17 @@ module Yelp::V2::Search::Request
|
|
9
9
|
let(:client) { Yelp::Base.client }
|
10
10
|
let(:latitude) { 37.7821868 }
|
11
11
|
let(:longitude) { -122.4841149 }
|
12
|
-
let(:location)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
let(:location) { {
|
13
|
+
"cross_streets"=>"21st Ave & 22nd Ave",
|
14
|
+
"city"=>"San Francisco",
|
15
|
+
"coordinate" => {"latitude"=>37.78221, "longitude"=>-122.480624},
|
16
|
+
"display_address"=>["2001 Clement St", "(b/t 21st Ave & 22nd Ave)", "Outer Richmond", "San Francisco, CA 94121"],
|
17
|
+
"geo_accuracy" => 9,
|
18
|
+
"neighborhoods"=>["Outer Richmond"],
|
19
|
+
"postal_code"=>"94121",
|
20
|
+
"country_code"=>"US",
|
21
|
+
"address"=>["2001 Clement St"],
|
22
|
+
"state_code"=>"CA"
|
23
23
|
} }
|
24
24
|
|
25
25
|
describe 'by Bounding Box' do
|
data/spec/phone_search_spec.rb
CHANGED
@@ -9,5 +9,12 @@ module Yelp::V1::Phone::Request
|
|
9
9
|
request = Number.new(:phone_number => '4155666011')
|
10
10
|
expect(client.search(request)).to be_valid_response_hash
|
11
11
|
end
|
12
|
+
|
13
|
+
it 'returns a business in another country' do
|
14
|
+
request = Number.new(:phone_number => '098460655', :cc => 'NZ')
|
15
|
+
response = client.search(request)
|
16
|
+
expect(response).to be_valid_response_hash
|
17
|
+
expect(response['businesses'].count).to eq(1)
|
18
|
+
end
|
12
19
|
end
|
13
20
|
end
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yelpster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Naveed Siddiqui
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-05-10 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: json
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 1.1.1
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 1.1.1
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: oauth
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 0.4.5
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 0.4.5
|
46
41
|
description: Wrapper for Yelp Developer API
|
@@ -52,6 +47,7 @@ files:
|
|
52
47
|
- CHANGELOG.rdoc
|
53
48
|
- LICENSE.txt
|
54
49
|
- README.md
|
50
|
+
- lib/yelpster.rb
|
55
51
|
- lib/yelpster/base.rb
|
56
52
|
- lib/yelpster/client.rb
|
57
53
|
- lib/yelpster/record.rb
|
@@ -72,7 +68,6 @@ files:
|
|
72
68
|
- lib/yelpster/v2/search/request/geo_point.rb
|
73
69
|
- lib/yelpster/v2/search/request/location.rb
|
74
70
|
- lib/yelpster/version.rb
|
75
|
-
- lib/yelpster.rb
|
76
71
|
- spec/business_retrieve_spec.rb
|
77
72
|
- spec/business_search_spec.rb
|
78
73
|
- spec/client_spec.rb
|
@@ -84,33 +79,26 @@ files:
|
|
84
79
|
homepage: https://github.com/nvd/yelpster
|
85
80
|
licenses:
|
86
81
|
- LGPL
|
82
|
+
metadata: {}
|
87
83
|
post_install_message:
|
88
84
|
rdoc_options: []
|
89
85
|
require_paths:
|
90
86
|
- lib
|
91
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
-
none: false
|
93
88
|
requirements:
|
94
|
-
- -
|
89
|
+
- - ">="
|
95
90
|
- !ruby/object:Gem::Version
|
96
91
|
version: '0'
|
97
|
-
segments:
|
98
|
-
- 0
|
99
|
-
hash: 3290065746868731034
|
100
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
93
|
requirements:
|
103
|
-
- -
|
94
|
+
- - ">="
|
104
95
|
- !ruby/object:Gem::Version
|
105
96
|
version: '0'
|
106
|
-
segments:
|
107
|
-
- 0
|
108
|
-
hash: 3290065746868731034
|
109
97
|
requirements: []
|
110
98
|
rubyforge_project:
|
111
|
-
rubygems_version:
|
99
|
+
rubygems_version: 2.2.2
|
112
100
|
signing_key:
|
113
|
-
specification_version:
|
101
|
+
specification_version: 4
|
114
102
|
summary: Wrapper for Yelp Developer API
|
115
103
|
test_files:
|
116
104
|
- spec/business_retrieve_spec.rb
|