foursquare2 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/foursquare2.gemspec +2 -2
- data/lib/foursquare2/client.rb +8 -3
- data/test/test_client.rb +10 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.6
|
data/foursquare2.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{foursquare2}
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Mueller", "Marco Moura"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-27}
|
13
13
|
s.description = %q{Gives access to all endpoints in version 2 of foursquare's API with syntax that will be familiar to those who used the original foursquare gem by Jeremy Welch.}
|
14
14
|
s.email = ["muellermr@gmail.com", "email@marcomoura.com"]
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/foursquare2/client.rb
CHANGED
@@ -22,14 +22,19 @@ module Foursquare2
|
|
22
22
|
# @option options String :client_id Your foursquare app's client_id
|
23
23
|
# @option options String :client_secret Your foursquare app's client_secret
|
24
24
|
# @option options String :oauth_token A valid oauth token for a user (or the 'secret' value from api v1)
|
25
|
+
# @option options Hash :ssl Additional SSL options (like the path to certificate file)
|
25
26
|
|
26
27
|
def initialize(options={})
|
27
28
|
@client_id = options[:client_id]
|
28
29
|
@client_secret = options[:client_secret]
|
29
30
|
@oauth_token = options[:oauth_token]
|
31
|
+
@ssl = options[:ssl].nil? ? Hash.new : options[:ssl]
|
30
32
|
end
|
31
|
-
|
32
|
-
|
33
|
+
|
34
|
+
def ssl
|
35
|
+
@ssl
|
36
|
+
end
|
37
|
+
|
33
38
|
# Sets up the connection to be used for all requests based on options passed during initialization.
|
34
39
|
|
35
40
|
def connection
|
@@ -37,7 +42,7 @@ module Foursquare2
|
|
37
42
|
params[:client_id] = @client_id if @client_id
|
38
43
|
params[:client_secret] = @client_secret if @client_secret
|
39
44
|
params[:oauth_token] = @oauth_token if @oauth_token
|
40
|
-
@connection ||= Faraday::Connection.new(:url => api_url, :params => params, :headers => default_headers) do |builder|
|
45
|
+
@connection ||= Faraday::Connection.new(:url => api_url, :ssl => @ssl, :params => params, :headers => default_headers) do |builder|
|
41
46
|
builder.adapter Faraday.default_adapter
|
42
47
|
builder.use Faraday::Response::Mashify
|
43
48
|
builder.use Faraday::Response::ParseJson
|
data/test/test_client.rb
CHANGED
@@ -18,5 +18,15 @@ class TestClient < Test::Unit::TestCase
|
|
18
18
|
@client.client_id.should == 'awesome'
|
19
19
|
@client.client_secret.should == 'sauce'
|
20
20
|
end
|
21
|
+
|
22
|
+
should "retain SSL option for requests when you don't pass it as param" do
|
23
|
+
@client = Foursquare2::Client.new(:client_id => 'awesome', :client_secret => 'sauce')
|
24
|
+
@client.ssl.should == {}
|
25
|
+
end
|
26
|
+
|
27
|
+
should "retain SSL option for requests" do
|
28
|
+
@client = Foursquare2::Client.new(:client_id => 'awesome', :client_secret => 'sauce', :ssl => {:ca_file => 'path_to_ca_file'})
|
29
|
+
@client.ssl[:ca_file].should == 'path_to_ca_file'
|
30
|
+
end
|
21
31
|
end
|
22
32
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foursquare2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 6
|
10
|
+
version: 0.9.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Mueller
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-04-
|
19
|
+
date: 2011-04-27 00:00:00 -05:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|