mosaic-foursquare 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzhiMjBkNTQ5YWIwYTA4Y2I1ZmM4YTJlYjQ4ODE0ZjU2OGM0OTk4MA==
4
+ ODk3YTJhYTEwMDBkZjNkZTcxZjFhNDNlZjU5MTVkYjA4ZWE3MjA3YQ==
5
5
  data.tar.gz: !binary |-
6
- ZGE3MTIxMmVjZTQ0NGU2ZTU2MzA0NjcxNzVjMDc2NWZiMWQwMGUzMA==
6
+ ZTBmNTUzNjJiMzA3YmM2Y2M2NjVhNDVhYjk4NTQ0NGVmZTk2N2RhZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NGU1ODBkOTE5MDUzMmQwYTk0NTMwOWI1NDI0ZjRlM2RkYTEyMmI2ZDdlYjhl
10
- YTJkMDU0MWUzMWI2NWFiOGZkMmIyNTViZWU4Mjk1ZDhlY2QwZDBkMTU1MDJl
11
- MmQwOGZlZDlhZTg2MzhmNTkyMmVkYzYwNzAwY2VkMmZiMWQwZTE=
9
+ NmI1MmViZjU4YjliMWM0ZGY2OWU5NDYwM2M2ODZkZWU1ZjFiMTE0OGU1ODk4
10
+ NjAyYmE1ZGE1MmQ2NmFhMmQ0ZmI3Mjg4NjNhMjJiNmQ0NWFiOGFlNDBiMmMw
11
+ OWMwYTFkMWZiZGUwNGQ0YTllMWQ2MWQyY2FkNDYwOTU4YmNmYTU=
12
12
  data.tar.gz: !binary |-
13
- NzFmNWRlMDUyODc5MDMxNTgyYmY0ZWRiNjc1ODRhZTcyNTZlMTZjMzk1Nzky
14
- N2Y0YTk5OTM3MmExOTg2MWEwOWQyMzgzNDIxNWQxN2JmNzA3MjhlMTFlNmYy
15
- YjYxYjYzYzY3MDNiYTFjZDc5YjMzNmExODcyYTEyN2E3OTdkYzQ=
13
+ Nzg5MWQxYTE0ODFlNmQxOTNjZTcwNDM3OWQwOThjYjI3ODMyYjdkYzFmZmM4
14
+ N2FhMjdjMzU5NTNiNzkyODlmOTMwMWEzZDZjMjA4YmJiZDgyNDBmYWY4NTYy
15
+ MmY3NTQyNGIyYTBlYjliYjkzZmIzY2NlZjNkNTY3OTA2NzJlY2M=
@@ -7,7 +7,7 @@ module Mosaic
7
7
 
8
8
  class << self
9
9
  def find(id, options = {})
10
- response = query("/checkins/#{id}", options)
10
+ response = query("checkins/#{id}", options)
11
11
  self.new response['response']['checkin']
12
12
  end
13
13
  end
@@ -1,21 +1,27 @@
1
- require 'httparty'
1
+ require 'faraday'
2
+ require 'faraday_middleware'
2
3
 
3
4
  module Mosaic
4
5
  module Foursquare
5
6
  class Object
6
7
  include Mosaic::Utils::Helpers
7
- include HTTParty
8
- base_uri 'https://api.foursquare.com/v2'
9
8
 
10
9
  class << self
10
+ def conn
11
+ @conn ||= Faraday.new('https://api.foursquare.com/v2/') do |faraday|
12
+ faraday.request :url_encoded
13
+ faraday.response :json, :content_type => /\bjson$/
14
+ faraday.use Faraday::Response::RaiseError
15
+
16
+ faraday.adapter Faraday.default_adapter
17
+ end
18
+ end
19
+
11
20
  def query(path, options)
12
21
  options = Mosaic::Foursquare.config.merge(options)
13
22
  self.request_count += 1
14
- # STDERR.puts "REQUEST[#{self.request_count}]: #{path} with #{options.inspect}"
15
- response = get(path, :query => options.merge(:v =>20130614))
16
- # STDERR.puts "RESPONSE[#{self.request_count}]: #{response.inspect}"
17
- response.error! unless response.success?
18
- response
23
+ response = conn.get path, options.merge(:v =>20130614)
24
+ response.body
19
25
  end
20
26
 
21
27
  def request_count
@@ -6,7 +6,7 @@ module Mosaic
6
6
  attr_accessor :created_at, :id, :text, :venue, :user
7
7
  class << self
8
8
  def find(id, options = {})
9
- response = query("/tips/#{id}", options)
9
+ response = query("tips/#{id}", options)
10
10
  self.new response['response']['tip']
11
11
  end
12
12
  end
@@ -7,7 +7,7 @@ module Mosaic
7
7
 
8
8
  class << self
9
9
  def find(id, options = {})
10
- response = query("/venues/#{id}", options)
10
+ response = query("venues/#{id}", options)
11
11
  self.new response['response']['venue']
12
12
  end
13
13
  end
@@ -37,17 +37,17 @@ module Mosaic
37
37
  end
38
38
 
39
39
  def herenow(options = {})
40
- response = self.class.query("/venues/#{id}/herenow", options)
40
+ response = self.class.query("venues/#{id}/herenow", options)
41
41
  response['response']['hereNow']['items'].collect { |item| Mosaic::Foursquare::Checkin.new(item) }
42
42
  end
43
43
 
44
44
  def photos(options = {})
45
- response = self.class.query("/venues/#{id}/photos", options)
45
+ response = self.class.query("venues/#{id}/photos", options)
46
46
  response['response']['photos']['items'].collect { |item| Mosaic::Foursquare::Photo.new(item) }
47
47
  end
48
48
 
49
49
  def tips(options = {})
50
- response = self.class.query("/venues/#{id}/tips", options)
50
+ response = self.class.query("venues/#{id}/tips", options)
51
51
  response['response']['tips']['items'].collect { |item| Mosaic::Foursquare::Tip.new(item) }
52
52
  end
53
53
  end
@@ -1,5 +1,5 @@
1
1
  module Mosaic
2
2
  module Foursquare
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
@@ -16,7 +16,8 @@ Gem::Specification.new do |s|
16
16
  s.files =`git ls-files`.split($/)
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
 
19
- s.add_dependency "httparty", "~> 0.10.2"
19
+ s.add_dependency "faraday", "~> 0.8.7"
20
+ s.add_dependency "faraday_middleware", "~> 0.9.0"
20
21
 
21
22
  s.add_development_dependency "rspec"
22
23
  s.add_development_dependency "rake"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mosaic-foursquare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - S. Brent Faulkner
@@ -35,22 +35,36 @@ cert_chain:
35
35
  cWkwT1ZqMjAvRCsvcjJxRkNqV2cwVjAzdTdGNDg2UkwKbkVBa3lXL3NaTjRX
36
36
  Q29RbmpoeDF3MmYrd2FnVURBTzY4L0E1U0kxaUdyZVlRb3VvN1lRS0xNWC9p
37
37
  WlFKYng2QwpzTERtRXdUcgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
38
- date: 2013-06-18 00:00:00.000000000 Z
38
+ date: 2013-06-24 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
- name: httparty
41
+ name: faraday
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
- version: 0.10.2
46
+ version: 0.8.7
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 0.10.2
53
+ version: 0.8.7
54
+ - !ruby/object:Gem::Dependency
55
+ name: faraday_middleware
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ version: 0.9.0
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ~>
66
+ - !ruby/object:Gem::Version
67
+ version: 0.9.0
54
68
  - !ruby/object:Gem::Dependency
55
69
  name: rspec
56
70
  requirement: !ruby/object:Gem::Requirement