buddy 2.2.2 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- buddy (2.0.0)
4
+ buddy (2.3.0)
5
+ httparty
6
+ mini_fb (>= 0.2.2)
7
+ yajl-ruby
5
8
 
6
9
  GEM
7
10
  remote: http://rubygems.org/
8
11
  specs:
12
+ hashie (1.2.0)
13
+ httparty (0.8.3)
14
+ multi_json (~> 1.0)
15
+ multi_xml
16
+ mime-types (1.19)
17
+ mini_fb (1.1.7)
18
+ hashie
19
+ rest-client
20
+ multi_json (1.3.6)
21
+ multi_xml (0.5.1)
22
+ rake (0.9.2.2)
23
+ rest-client (1.6.7)
24
+ mime-types (>= 1.16)
25
+ yajl-ruby (1.1.0)
9
26
 
10
27
  PLATFORMS
11
28
  ruby
12
29
 
13
30
  DEPENDENCIES
14
31
  buddy!
32
+ rake
@@ -1,25 +1,23 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "buddy/version"
2
+ require File.expand_path('../lib/buddy/version', __FILE__)
4
3
 
5
- Gem::Specification.new do |s|
6
- s.name = "buddy"
7
- s.version = Buddy::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["Ole Riesenberg"]
10
- s.email = ["or@buddybrand.com"]
11
- s.homepage = "http://rubygems.org/gems/buddy"
12
- s.summary = %q{Facebook library focusing on getting the work done.}
13
- s.description = %q{Facebook library focusing on getting the work done.}
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Ole Riesenberg"]
6
+ gem.email = ["or@oleriesenberg.com"]
7
+ gem.description = %q{Facebook library focusing on getting the work done.}
8
+ gem.summary = %q{Facebook library focusing on getting the work done.}
9
+ gem.homepage = "http://rubygems.org/gems/buddy"
14
10
 
15
- s.files = `git ls-files`.split("\n")
16
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
- s.require_paths = ["lib"]
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "buddy"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Buddy::VERSION
19
17
 
20
- Gem::Specification.new do |s|
21
- s.add_runtime_dependency('mini_fb', '>= 0.2.2')
22
- s.add_runtime_dependency('yajl-ruby', '>= 0')
23
- s.add_runtime_dependency('httparty', '>= 0')
24
- end
18
+ gem.add_runtime_dependency "mini_fb", ">= 0.2.2"
19
+ gem.add_runtime_dependency "yajl-ruby", ">= 0"
20
+ gem.add_runtime_dependency "httparty", ">= 0"
21
+
22
+ gem.add_development_dependency "rake"
25
23
  end
@@ -23,15 +23,26 @@ module Buddy
23
23
 
24
24
  private
25
25
  def call_graph(method, resource, params)
26
+ opts = extract_options(params)
27
+
26
28
  result = nil
27
29
  time = Benchmark.realtime do
28
- result = GraphApiClient.send(method, resource, :query => params).parsed_response
30
+ result = GraphApiClient.send(method, resource, {:query => params}.merge(opts)).parsed_response
29
31
  end
30
32
  Buddy.logger.info("GraphAPI: #{method} #{resource} - #{time}") if Buddy.config['logging_enabled']
31
33
 
32
34
  raise OAuthException.new(result["error"]["message"]) if result.is_a?(Hash) && result["error"]
33
35
  result
34
36
  end
37
+
38
+ def extract_options(params)
39
+ opts = {}
40
+ opts[:base_uri] = HTTParty.normalize_base_uri(params.delete(:base_uri)) unless params[:base_uri].nil?
41
+ [:format, :headers, :maintain_method_across_redirects, :no_follow, :parser].each do |option|
42
+ opts[option] = params.delete(option) unless params[option].nil?
43
+ end
44
+ opts
45
+ end
35
46
  end
36
47
 
37
48
  class GraphApiClient
@@ -1,3 +1,3 @@
1
1
  module Buddy
2
- VERSION = "2.2.2"
2
+ VERSION = "2.3.0"
3
3
  end
metadata CHANGED
@@ -1,33 +1,87 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: buddy
3
- version: !ruby/object:Gem::Version
4
- hash: 3
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.3.0
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 2
9
- - 2
10
- version: 2.2.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Ole Riesenberg
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-12-12 00:00:00 Z
19
- dependencies: []
20
-
12
+ date: 2012-08-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: mini_fb
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.2.2
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.2.2
30
+ - !ruby/object:Gem::Dependency
31
+ name: yajl-ruby
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: httparty
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
21
78
  description: Facebook library focusing on getting the work done.
22
- email:
23
- - or@buddybrand.com
79
+ email:
80
+ - or@oleriesenberg.com
24
81
  executables: []
25
-
26
82
  extensions: []
27
-
28
83
  extra_rdoc_files: []
29
-
30
- files:
84
+ files:
31
85
  - .gitignore
32
86
  - Gemfile
33
87
  - Gemfile.lock
@@ -52,36 +106,33 @@ files:
52
106
  - test/test_buddy.rb
53
107
  homepage: http://rubygems.org/gems/buddy
54
108
  licenses: []
55
-
56
109
  post_install_message:
57
110
  rdoc_options: []
58
-
59
- require_paths:
111
+ require_paths:
60
112
  - lib
61
- required_ruby_version: !ruby/object:Gem::Requirement
113
+ required_ruby_version: !ruby/object:Gem::Requirement
62
114
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- hash: 3
67
- segments:
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ segments:
68
120
  - 0
69
- version: "0"
70
- required_rubygems_version: !ruby/object:Gem::Requirement
121
+ hash: 992047182944063666
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
123
  none: false
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- hash: 3
76
- segments:
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ segments:
77
129
  - 0
78
- version: "0"
130
+ hash: 992047182944063666
79
131
  requirements: []
80
-
81
132
  rubyforge_project:
82
- rubygems_version: 1.8.10
133
+ rubygems_version: 1.8.24
83
134
  signing_key:
84
135
  specification_version: 3
85
136
  summary: Facebook library focusing on getting the work done.
86
- test_files:
137
+ test_files:
87
138
  - test/test_buddy.rb