tumblr_client 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ *.gem
2
+ .DS_Store
data/.path ADDED
@@ -0,0 +1 @@
1
+ /.__pathr_start_project__:/.__pathr_end_project__:/.__pathr_start_tools@^__:/.__pathr_end_tools@^__:/.__pathr_start_tools@active_tools__:/Users/richard/active_tools:/Users/richard/active_tools/src:/Users/richard/active_tools/src/common:/.__pathr_end_tools@active_tools__:/.__pathr_start_tools@$__:/.__pathr_end_tools@$__:/.__pathr_start_global__:/Users/richard/.rvm/gems/ruby-1.9.3-p125/bin:/Users/richard/.rvm/gems/ruby-1.9.3-p125@global/bin:/Users/richard/.rvm/rubies/ruby-1.9.3-p125/bin:/Users/richard/.rvm/bin:/Users/richard/scripts:/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/Applications/Shoes.app/Contents/MacOS:/Users/richard/bin:/Users/richard/jruby/bin:/usr/local/mysql/bin:/.__pathr_end_global__:/.__pathr_start_utilities@^__:/.__pathr_end_utilities@^__:/.__pathr_start_utilities@gitget__:/Users/richard/projects/gitget/src:/.__pathr_end_utilities@gitget__:/.__pathr_start_utilities@pathr__:/Users/richard/projects/pathr/src:/.__pathr_end_utilities@pathr__:/.__pathr_start_utilities@$__:/.__pathr_end_utilities@$__
data/lib/tumblr/blog.rb CHANGED
@@ -26,6 +26,20 @@ module Tumblr
26
26
  get("v2/blog/#{blog_name}/followers", options)
27
27
  end
28
28
  end
29
+
30
+ #
31
+ # Gets the list of likes for the blog
32
+ #
33
+ def blog_likes(blog_name, options={})
34
+ if valid_options([:limit, :offset], options)
35
+ url = "v2/blog/#{blog_name}/likes"
36
+ params = {:api_key => Tumblr::consumer_key}
37
+ unless options.empty?
38
+ params.merge!(options)
39
+ end
40
+ get(url, params)
41
+ end
42
+ end
29
43
 
30
44
  def posts(blog_name, options={})
31
45
  url = "v2/blog/#{blog_name}/posts"
@@ -9,8 +9,8 @@ module Tumblr
9
9
  req.url path
10
10
  req.params = params
11
11
  end
12
- #check for errors and encapsulate
13
- response.body['response']
12
+ #Check for errors and encapsulate
13
+ respond(response)
14
14
  end
15
15
 
16
16
  #Performs post request
@@ -20,7 +20,16 @@ module Tumblr
20
20
  req.body = params unless params.empty?
21
21
  end
22
22
  #Check for errors and encapsulate
23
- response.body['response']
23
+ respond(response)
24
24
  end
25
+
26
+ def respond(response)
27
+ if [201, 200].include?(response.status)
28
+ response.body['response']
29
+ else
30
+ response.body['meta']
31
+ end
32
+ end
33
+
25
34
  end
26
35
  end
@@ -9,7 +9,7 @@ module Tumblr
9
9
  class TumblrOAuth < Faraday::Middleware
10
10
  def call(env)
11
11
  if env[:method].to_s == "get"
12
- params = env[:url].query_values || {}
12
+ params = Faraday::Utils.parse_query(env[:url].query) || {}
13
13
  url = "#{env[:url].scheme}://#{env[:url].host}#{env[:url].path}"
14
14
  else
15
15
  params = env[:body] || {}
data/lib/tumblr/user.rb CHANGED
@@ -2,7 +2,7 @@ module Tumblr
2
2
  class Client
3
3
  module User
4
4
  def info
5
- info = post("v2/user/info")
5
+ info = get("v2/user/info")
6
6
  end
7
7
 
8
8
  def dashboard(options={})
data/tumblr.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  Gem::Specification.new do |gem|
4
- gem.add_dependency 'faraday', '0.7.6'
4
+ gem.add_dependency 'faraday', '>= 0.8'
5
5
  gem.add_dependency 'faraday_middleware'
6
6
  gem.add_dependency 'json'
7
7
  gem.add_development_dependency 'rake'
@@ -18,5 +18,5 @@ Gem::Specification.new do |gem|
18
18
  gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6')
19
19
  gem.summary = %q{Tumblr API wrapper}
20
20
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
- gem.version = "0.6.7"
21
+ gem.version = "0.6.8"
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tumblr_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.6.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-15 00:00:00.000000000 Z
12
+ date: 2013-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - '='
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.7.6
21
+ version: '0.8'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - '='
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.7.6
29
+ version: '0.8'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: faraday_middleware
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -115,6 +115,8 @@ executables:
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - .gitignore
119
+ - .path
118
120
  - Gemfile
119
121
  - LICENSE.md
120
122
  - README.md