tumblr_wrapper 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +7 -0
- data/README.md +22 -8
- data/lib/tumblr_wrapper/blog.rb +4 -3
- data/lib/tumblr_wrapper/blog_resource.rb +2 -14
- data/lib/tumblr_wrapper/client.rb +24 -30
- data/lib/tumblr_wrapper/http.rb +45 -0
- data/lib/tumblr_wrapper/post.rb +3 -3
- data/lib/tumblr_wrapper/resource.rb +3 -12
- data/lib/tumblr_wrapper/validators.rb +13 -0
- data/lib/tumblr_wrapper/version.rb +1 -1
- data/lib/tumblr_wrapper.rb +12 -2
- data/spec/blog_spec.rb +5 -5
- data/spec/integration/tumblr_wrapper_spec.rb +81 -0
- data/spec/post_spec.rb +3 -3
- data/spec/spec_helper.rb +10 -0
- data/spec/support/token_helper.rb.template +34 -0
- data/tumblr_wrapper.gemspec +5 -1
- metadata +65 -8
- data/lib/tumblr_wrapper/rest_client.rb +0 -2
data/.gitignore
CHANGED
@@ -15,3 +15,10 @@ spec/reports
|
|
15
15
|
test/tmp
|
16
16
|
test/version_tmp
|
17
17
|
tmp
|
18
|
+
spec/vcr_cassettes/access_token.yml
|
19
|
+
spec/vcr_cassettes/authorize_url.yml
|
20
|
+
spec/vcr_cassettes/blog_followers.yml
|
21
|
+
spec/vcr_cassettes/blog_info.yml
|
22
|
+
spec/vcr_cassettes/blog_posts.yml
|
23
|
+
spec/vcr_cassettes/post_create.yml
|
24
|
+
spec/support/token_helper.rb
|
data/README.md
CHANGED
@@ -32,37 +32,51 @@ then authorize in browser here:
|
|
32
32
|
|
33
33
|
client.authorize_url
|
34
34
|
|
35
|
-
|
35
|
+
request_token = client.request_token.token
|
36
|
+
request_token_secret = client.request_token.secret
|
36
37
|
|
37
|
-
|
38
|
-
|
38
|
+
tumblr oauth is strict, you need the oauth verifier from the response to get the access token:
|
39
|
+
|
40
|
+
client.build_request_token(request_token, request_token_secret)
|
41
|
+
access_token = client.request_access_token("OAUTH VERIFIER")
|
39
42
|
|
40
43
|
If you have the token and secret for your user:
|
41
44
|
|
42
|
-
access_token = client.
|
45
|
+
access_token = client.build_access_token("TOKEN", "SECRET")
|
43
46
|
|
44
47
|
The access token is memoized in either case, so you can call it again once it was set:
|
45
48
|
|
46
49
|
access_token = client.access_token
|
50
|
+
=> {
|
51
|
+
consumer_key: "YOUR APPLICATION KEY",
|
52
|
+
consumer_secret: "YOUR APPLICATION SECRET",
|
53
|
+
oauth_token: 'TOKEN',
|
54
|
+
oauth_secret: 'SECRET',
|
55
|
+
}
|
47
56
|
|
48
57
|
To get the first 40 posts of your blog:
|
49
58
|
|
50
59
|
blog_resource = TumblrWrapper::BlogResource.new('yourblog.tumblr.com', access_token)
|
51
60
|
|
52
|
-
blog_resource.
|
61
|
+
blog = blog_resource.blow
|
62
|
+
blog.posts(limit: 40)
|
53
63
|
|
54
64
|
or with pagination:
|
55
65
|
|
56
|
-
|
57
|
-
|
66
|
+
blog.posts(limit: 20, offset: 0)
|
67
|
+
blog.posts(limit: 20, offset: 20)
|
58
68
|
|
59
69
|
To post:
|
60
70
|
|
61
71
|
blog_resource.post.create({ type: 'text', body: "Hello world." })
|
62
72
|
|
73
|
+
To update a post:
|
74
|
+
|
75
|
+
post.update({id: "ID FROM TUMBLR", body: "Goodbye world."})
|
76
|
+
|
63
77
|
To delete a post:
|
64
78
|
|
65
|
-
|
79
|
+
post.delete({id: "ID FROM TUMBLR"})
|
66
80
|
|
67
81
|
## Contributing
|
68
82
|
|
data/lib/tumblr_wrapper/blog.rb
CHANGED
@@ -3,20 +3,21 @@ class TumblrWrapper::Blog < TumblrWrapper::BlogResource
|
|
3
3
|
# Required parameters: N/A
|
4
4
|
# http://www.tumblr.com/docs/en/api/v2#blog-info
|
5
5
|
def info
|
6
|
-
|
6
|
+
http_get('info')
|
7
7
|
end
|
8
8
|
|
9
9
|
##
|
10
10
|
# Required parameters: N/A
|
11
11
|
# http://www.tumblr.com/docs/en/api/v2#blog-followers
|
12
12
|
def followers(parameters={})
|
13
|
-
|
13
|
+
http_get('followers', {signed: true}, parameters)
|
14
14
|
end
|
15
15
|
|
16
16
|
##
|
17
17
|
# Required parameters: N/A
|
18
18
|
# http://www.tumblr.com/docs/en/api/v2#posts
|
19
19
|
def posts(parameters={})
|
20
|
-
|
20
|
+
# for some reason the / is needed for this endpoint... -RH
|
21
|
+
http_get('posts/', parameters)
|
21
22
|
end
|
22
23
|
end
|
@@ -15,21 +15,9 @@ class TumblrWrapper::BlogResource < TumblrWrapper::Resource
|
|
15
15
|
end
|
16
16
|
|
17
17
|
protected
|
18
|
-
def oauth_request(path, method_type = :get, body = {})
|
19
|
-
validate_oauth
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
access_token.request(method_type, url, body)
|
24
|
-
else
|
25
|
-
access_token.request(method_type, url)
|
26
|
-
end
|
19
|
+
def long_path(path)
|
20
|
+
"/#{TumblrWrapper.version}/blog/#{hostname}/#{path}"
|
27
21
|
end
|
28
22
|
|
29
|
-
def request(path, method_type = :get, parameters = {})
|
30
|
-
parameters.merge!({ api_key: TumblrWrapper.consumer_key })
|
31
|
-
params = (method_type == :get) ? { params: parameters } : parameters
|
32
|
-
|
33
|
-
TumblrWrapper::RestClient.send(method_type, "#{endpoint}/blog/#{hostname}/#{path}", params)
|
34
|
-
end
|
35
23
|
end
|
@@ -1,44 +1,38 @@
|
|
1
1
|
class TumblrWrapper::Client
|
2
|
-
attr_reader :
|
3
|
-
def initialize
|
4
|
-
@consumer = OAuth::Consumer.new(
|
5
|
-
TumblrWrapper.consumer_key,
|
6
|
-
TumblrWrapper.consumer_secret,
|
7
|
-
site: 'http://www.tumblr.com'
|
8
|
-
)
|
9
|
-
end
|
2
|
+
attr_reader :access_token, :request_token
|
10
3
|
|
11
4
|
def authorize_url
|
12
|
-
@request_token =
|
5
|
+
@request_token = consumer.get_request_token
|
13
6
|
@request_token.authorize_url
|
14
7
|
end
|
15
8
|
|
16
|
-
def
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
9
|
+
def request_access_token(oauth_verifier)
|
10
|
+
token = request_token.get_access_token({:oauth_verifier => oauth_verifier})
|
11
|
+
@access_token = {
|
12
|
+
consumer_key: TumblrWrapper.consumer_key,
|
13
|
+
consumer_secret: TumblrWrapper.consumer_secret,
|
14
|
+
token: token.token,
|
15
|
+
token_secret: token.secret
|
16
|
+
}
|
22
17
|
end
|
23
18
|
|
24
|
-
def
|
25
|
-
|
26
|
-
@request_token = OAuth::RequestToken.new(consumer, token, secret)
|
27
|
-
else
|
28
|
-
@request_token
|
29
|
-
end
|
30
|
-
@request_token
|
19
|
+
def build_request_token(token, secret)
|
20
|
+
@request_token = OAuth::RequestToken.new(consumer, token, secret)
|
31
21
|
end
|
32
22
|
|
33
|
-
def
|
34
|
-
@access_token =
|
23
|
+
def build_access_token(token, secret)
|
24
|
+
@access_token = {
|
25
|
+
consumer_key: TumblrWrapper.consumer_key,
|
26
|
+
consumer_secret: TumblrWrapper.consumer_secret,
|
27
|
+
oauth_token: token,
|
28
|
+
oauth_token_secret: secret }
|
35
29
|
end
|
36
30
|
|
37
|
-
def
|
38
|
-
@
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
31
|
+
def consumer
|
32
|
+
@consumer ||= OAuth::Consumer.new(
|
33
|
+
TumblrWrapper.consumer_key,
|
34
|
+
TumblrWrapper.consumer_secret,
|
35
|
+
site: 'http://www.tumblr.com'
|
36
|
+
)
|
43
37
|
end
|
44
38
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module TumblrWrapper::HTTP
|
2
|
+
|
3
|
+
def http_get(path, opts={signed: false}, params={})
|
4
|
+
validate_oauth if opts[:signed]
|
5
|
+
connection = Faraday.new TumblrWrapper.endpoint do |conn|
|
6
|
+
conn.request :oauth, access_token if opts[:signed]
|
7
|
+
conn.request :url_encoded
|
8
|
+
conn.adapter Faraday.default_adapter
|
9
|
+
end
|
10
|
+
if opts[:signed]
|
11
|
+
connection.get(long_path(path), params)
|
12
|
+
else
|
13
|
+
parameters = params.merge({api_key: TumblrWrapper.consumer_key})
|
14
|
+
connection.get(long_path(path), parameters)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def http_post(path, body)
|
19
|
+
validate_oauth
|
20
|
+
connection = Faraday.new TumblrWrapper.endpoint do |conn|
|
21
|
+
conn.request :oauth, access_token
|
22
|
+
conn.request :url_encoded
|
23
|
+
conn.adapter Faraday.default_adapter
|
24
|
+
end
|
25
|
+
|
26
|
+
connection.post long_path(path), body
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
def content_type
|
31
|
+
'application/json'
|
32
|
+
end
|
33
|
+
|
34
|
+
def accept
|
35
|
+
'application/json'
|
36
|
+
end
|
37
|
+
|
38
|
+
def long_path(path)
|
39
|
+
raise NotImplementedError
|
40
|
+
end
|
41
|
+
|
42
|
+
def blank?(thing)
|
43
|
+
thing.nil? || thing.length == 0
|
44
|
+
end
|
45
|
+
end
|
data/lib/tumblr_wrapper/post.rb
CHANGED
@@ -6,7 +6,7 @@ class TumblrWrapper::Post < TumblrWrapper::BlogResource
|
|
6
6
|
validate_present(:type, parameters)
|
7
7
|
validate_not_present(:id, parameters)
|
8
8
|
|
9
|
-
|
9
|
+
http_post('post', parameters)
|
10
10
|
end
|
11
11
|
|
12
12
|
##
|
@@ -14,7 +14,7 @@ class TumblrWrapper::Post < TumblrWrapper::BlogResource
|
|
14
14
|
# http://www.tumblr.com/docs/en/api/v2#editing
|
15
15
|
def update(parameters = {})
|
16
16
|
validate_present(:id, parameters)
|
17
|
-
|
17
|
+
http_post('post/edit', parameters)
|
18
18
|
end
|
19
19
|
|
20
20
|
##
|
@@ -22,6 +22,6 @@ class TumblrWrapper::Post < TumblrWrapper::BlogResource
|
|
22
22
|
# http://www.tumblr.com/docs/en/api/v2#editing
|
23
23
|
def delete(parameters = {})
|
24
24
|
validate_present(:id, parameters)
|
25
|
-
|
25
|
+
http_post('post/delete', parameters)
|
26
26
|
end
|
27
27
|
end
|
@@ -1,19 +1,10 @@
|
|
1
1
|
class TumblrWrapper::Resource
|
2
|
+
include TumblrWrapper::Validators
|
3
|
+
include TumblrWrapper::HTTP
|
4
|
+
|
2
5
|
attr_reader :access_token
|
3
6
|
|
4
7
|
def initialize(access_token)
|
5
8
|
@access_token = access_token
|
6
9
|
end
|
7
|
-
|
8
|
-
def validate_oauth
|
9
|
-
raise TumblrWrapper::OauthNeeded unless access_token
|
10
|
-
end
|
11
|
-
|
12
|
-
def validate_present(key, parameters)
|
13
|
-
raise TumblrWrapper::MissingRequiredParameter, key unless parameters[key]
|
14
|
-
end
|
15
|
-
|
16
|
-
def validate_not_present(key, parameters)
|
17
|
-
raise TumblrWrapper::InvalidParameter, key if parameters[key]
|
18
|
-
end
|
19
10
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module TumblrWrapper::Validators
|
2
|
+
def validate_oauth
|
3
|
+
raise TumblrWrapper::OauthNeeded unless access_token
|
4
|
+
end
|
5
|
+
|
6
|
+
def validate_present(key, parameters)
|
7
|
+
raise TumblrWrapper::MissingRequiredParameter, key unless parameters[key]
|
8
|
+
end
|
9
|
+
|
10
|
+
def validate_not_present(key, parameters)
|
11
|
+
raise TumblrWrapper::InvalidParameter, key if parameters[key]
|
12
|
+
end
|
13
|
+
end
|
data/lib/tumblr_wrapper.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
require 'json'
|
1
2
|
require 'oauth'
|
2
|
-
require '
|
3
|
+
require 'faraday'
|
4
|
+
require 'faraday_middleware'
|
5
|
+
|
3
6
|
require "tumblr_wrapper/version"
|
7
|
+
require "tumblr_wrapper/validators"
|
8
|
+
require "tumblr_wrapper/http"
|
4
9
|
require "tumblr_wrapper/client"
|
5
10
|
require "tumblr_wrapper/resource"
|
6
11
|
require "tumblr_wrapper/blog_resource"
|
@@ -8,8 +13,9 @@ require "tumblr_wrapper/blog"
|
|
8
13
|
require "tumblr_wrapper/post"
|
9
14
|
|
10
15
|
module TumblrWrapper
|
11
|
-
ENDPOINT = 'http://api.tumblr.com
|
16
|
+
ENDPOINT = 'http://api.tumblr.com'
|
12
17
|
OAUTH_ENPOINT = 'http://www.tumblr.com'
|
18
|
+
VERSION = 'v2'
|
13
19
|
|
14
20
|
def self.consumer_key=(key)
|
15
21
|
@@consumer_key = key
|
@@ -35,6 +41,10 @@ module TumblrWrapper
|
|
35
41
|
ENDPOINT
|
36
42
|
end
|
37
43
|
|
44
|
+
def self.version
|
45
|
+
VERSION
|
46
|
+
end
|
47
|
+
|
38
48
|
class NoAccessToken < StandardError
|
39
49
|
def initialize(message = "Oauth request. Set access_token")
|
40
50
|
super(message)
|
data/spec/blog_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe TumblrWrapper::Blog do
|
|
10
10
|
|
11
11
|
describe '.info' do
|
12
12
|
it "makes an api request" do
|
13
|
-
blog.should_receive(:
|
13
|
+
blog.should_receive(:http_get).with('info')
|
14
14
|
|
15
15
|
blog.info
|
16
16
|
end
|
@@ -18,13 +18,13 @@ describe TumblrWrapper::Blog do
|
|
18
18
|
|
19
19
|
describe "followers" do
|
20
20
|
it "makes an oauth request" do
|
21
|
-
blog.should_receive(:
|
21
|
+
blog.should_receive(:http_get).with('followers', {signed: true}, {})
|
22
22
|
|
23
23
|
blog.followers
|
24
24
|
end
|
25
25
|
|
26
26
|
it "accepts parameters" do
|
27
|
-
blog.should_receive(:
|
27
|
+
blog.should_receive(:http_get).with('followers', {signed: true}, { limit: 20, offset: 5 })
|
28
28
|
|
29
29
|
blog.followers({ limit: 20, offset: 5 })
|
30
30
|
end
|
@@ -32,13 +32,13 @@ describe TumblrWrapper::Blog do
|
|
32
32
|
|
33
33
|
describe "posts" do
|
34
34
|
it "makes an api request" do
|
35
|
-
blog.should_receive(:
|
35
|
+
blog.should_receive(:http_get).with('posts/', {})
|
36
36
|
|
37
37
|
blog.posts
|
38
38
|
end
|
39
39
|
|
40
40
|
it "accepts type parameter" do
|
41
|
-
blog.should_receive(:
|
41
|
+
blog.should_receive(:http_get).with('posts/', type: 'text')
|
42
42
|
|
43
43
|
blog.posts(type: 'text')
|
44
44
|
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe TumblrWrapper, type: :integration do
|
4
|
+
before do
|
5
|
+
TumblrWrapper.consumer_key = consumer_key
|
6
|
+
TumblrWrapper.consumer_secret = consumer_secret
|
7
|
+
end
|
8
|
+
|
9
|
+
it "can get an authorize url" do
|
10
|
+
VCR.use_cassette('authorize_url') do
|
11
|
+
client = TumblrWrapper::Client.new
|
12
|
+
client.authorize_url.should =~ /http\:\/\/www\.tumblr\.com\/oauth\/authorize\?oauth_token/
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "given a valid verifier and request token" do
|
17
|
+
it "can get an access token" do
|
18
|
+
VCR.use_cassette('access_token') do
|
19
|
+
client = TumblrWrapper::Client.new
|
20
|
+
client.build_request_token(request_token, request_secret)
|
21
|
+
|
22
|
+
token = client.request_access_token(oauth_verifier)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context "given an access token" do
|
28
|
+
describe "blog" do
|
29
|
+
it "can request blog info" do
|
30
|
+
VCR.use_cassette('blog_info') do
|
31
|
+
client = TumblrWrapper::Client.new
|
32
|
+
token = client.build_access_token(access_token, access_token_secret)
|
33
|
+
|
34
|
+
blog_resource = TumblrWrapper::Blog.new(blogname, token)
|
35
|
+
info = blog_resource.info
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it "can request followers" do
|
40
|
+
VCR.use_cassette('blog_followers') do
|
41
|
+
client = TumblrWrapper::Client.new
|
42
|
+
token = client.build_access_token(access_token, access_token_secret)
|
43
|
+
|
44
|
+
blog_resource = TumblrWrapper::Blog.new(blogname, token)
|
45
|
+
followers = blog_resource.followers
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
it "can request posts" do
|
50
|
+
VCR.use_cassette('blog_posts') do
|
51
|
+
client = TumblrWrapper::Client.new
|
52
|
+
token = client.build_access_token(access_token, access_token_secret)
|
53
|
+
|
54
|
+
blog_resource = TumblrWrapper::Blog.new(blogname, token)
|
55
|
+
posts = blog_resource.posts
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "post" do
|
61
|
+
it "can create a post" do
|
62
|
+
VCR.use_cassette('post_create') do
|
63
|
+
client = TumblrWrapper::Client.new
|
64
|
+
token = client.build_access_token(access_token, access_token_secret)
|
65
|
+
|
66
|
+
post = TumblrWrapper::Post.new(blogname, token)
|
67
|
+
post = post.create({
|
68
|
+
type: 'text',
|
69
|
+
body: "<p>hello world</p>"
|
70
|
+
})
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
xit "can delete a post" do
|
75
|
+
end
|
76
|
+
|
77
|
+
xit "can update a post" do
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/spec/post_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe TumblrWrapper::Post do
|
|
10
10
|
|
11
11
|
describe "create" do
|
12
12
|
it "makes an oauth request with parameters" do
|
13
|
-
post.should_receive(:
|
13
|
+
post.should_receive(:http_post).with('post', {:type => 'text'})
|
14
14
|
|
15
15
|
post.create({:type => 'text'})
|
16
16
|
end
|
@@ -30,7 +30,7 @@ describe TumblrWrapper::Post do
|
|
30
30
|
|
31
31
|
describe "update" do
|
32
32
|
it "makes an oauth request with parameters" do
|
33
|
-
post.should_receive(:
|
33
|
+
post.should_receive(:http_post).with('post/edit', {:id => '1234'})
|
34
34
|
|
35
35
|
post.update({:id => '1234'})
|
36
36
|
end
|
@@ -44,7 +44,7 @@ describe TumblrWrapper::Post do
|
|
44
44
|
|
45
45
|
describe "delete" do
|
46
46
|
it "makes an oauth request with parameters" do
|
47
|
-
post.should_receive(:
|
47
|
+
post.should_receive(:http_post).with('post/delete', {:id => '1234'})
|
48
48
|
|
49
49
|
post.delete({:id => '1234'})
|
50
50
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,9 +3,19 @@ require 'spork'
|
|
3
3
|
|
4
4
|
Spork.prefork do
|
5
5
|
require 'rspec'
|
6
|
+
require 'vcr'
|
7
|
+
require 'webmock'
|
6
8
|
require 'tumblr_wrapper'
|
9
|
+
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
|
10
|
+
|
11
|
+
VCR.configure do |c|
|
12
|
+
c.cassette_library_dir = 'spec/vcr_cassettes'
|
13
|
+
c.hook_into :webmock
|
14
|
+
end
|
7
15
|
|
8
16
|
RSpec.configure do |config|
|
9
17
|
config.mock_with :rspec
|
18
|
+
|
19
|
+
config.include TokenHelper, type: :integration
|
10
20
|
end
|
11
21
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module TokenHelper
|
2
|
+
def consumer_key
|
3
|
+
""
|
4
|
+
end
|
5
|
+
|
6
|
+
def consumer_secret
|
7
|
+
""
|
8
|
+
end
|
9
|
+
|
10
|
+
def blogname
|
11
|
+
""
|
12
|
+
end
|
13
|
+
|
14
|
+
def access_token
|
15
|
+
""
|
16
|
+
end
|
17
|
+
|
18
|
+
def access_token_secret
|
19
|
+
""
|
20
|
+
end
|
21
|
+
|
22
|
+
# these are all part of the auth request set...
|
23
|
+
def oauth_verifier
|
24
|
+
""
|
25
|
+
end
|
26
|
+
|
27
|
+
def request_token
|
28
|
+
""
|
29
|
+
end
|
30
|
+
|
31
|
+
def request_secret
|
32
|
+
""
|
33
|
+
end
|
34
|
+
end
|
data/tumblr_wrapper.gemspec
CHANGED
@@ -16,6 +16,10 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.version = TumblrWrapper::VERSION
|
17
17
|
gem.add_development_dependency 'spork'
|
18
18
|
gem.add_development_dependency 'rspec'
|
19
|
+
gem.add_development_dependency 'vcr'
|
20
|
+
gem.add_development_dependency 'webmock'
|
19
21
|
gem.add_dependency 'oauth'
|
20
|
-
gem.add_dependency '
|
22
|
+
gem.add_dependency 'faraday'
|
23
|
+
gem.add_dependency 'faraday_middleware'
|
24
|
+
gem.add_dependency 'simple_oauth'
|
21
25
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 0.0.3
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- rheaton
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-08-
|
17
|
+
date: 2012-08-02 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
type: :development
|
45
45
|
version_requirements: *id002
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
47
|
+
name: vcr
|
48
48
|
prerelease: false
|
49
49
|
requirement: &id003 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
segments:
|
55
55
|
- 0
|
56
56
|
version: "0"
|
57
|
-
type: :
|
57
|
+
type: :development
|
58
58
|
version_requirements: *id003
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
|
-
name:
|
60
|
+
name: webmock
|
61
61
|
prerelease: false
|
62
62
|
requirement: &id004 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
@@ -67,8 +67,60 @@ dependencies:
|
|
67
67
|
segments:
|
68
68
|
- 0
|
69
69
|
version: "0"
|
70
|
-
type: :
|
70
|
+
type: :development
|
71
71
|
version_requirements: *id004
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: oauth
|
74
|
+
prerelease: false
|
75
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
segments:
|
81
|
+
- 0
|
82
|
+
version: "0"
|
83
|
+
type: :runtime
|
84
|
+
version_requirements: *id005
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: faraday
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
96
|
+
type: :runtime
|
97
|
+
version_requirements: *id006
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: faraday_middleware
|
100
|
+
prerelease: false
|
101
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
109
|
+
type: :runtime
|
110
|
+
version_requirements: *id007
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simple_oauth
|
113
|
+
prerelease: false
|
114
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
segments:
|
120
|
+
- 0
|
121
|
+
version: "0"
|
122
|
+
type: :runtime
|
123
|
+
version_requirements: *id008
|
72
124
|
description: ruby wrapper for tumblr api
|
73
125
|
email:
|
74
126
|
- rachelmheaton@gmail.com
|
@@ -89,14 +141,17 @@ files:
|
|
89
141
|
- lib/tumblr_wrapper/blog.rb
|
90
142
|
- lib/tumblr_wrapper/blog_resource.rb
|
91
143
|
- lib/tumblr_wrapper/client.rb
|
144
|
+
- lib/tumblr_wrapper/http.rb
|
92
145
|
- lib/tumblr_wrapper/post.rb
|
93
146
|
- lib/tumblr_wrapper/resource.rb
|
94
|
-
- lib/tumblr_wrapper/
|
147
|
+
- lib/tumblr_wrapper/validators.rb
|
95
148
|
- lib/tumblr_wrapper/version.rb
|
96
149
|
- spec/blog_resource_spec.rb
|
97
150
|
- spec/blog_spec.rb
|
151
|
+
- spec/integration/tumblr_wrapper_spec.rb
|
98
152
|
- spec/post_spec.rb
|
99
153
|
- spec/spec_helper.rb
|
154
|
+
- spec/support/token_helper.rb.template
|
100
155
|
- tumblr_wrapper.gemspec
|
101
156
|
has_rdoc: true
|
102
157
|
homepage: ""
|
@@ -133,5 +188,7 @@ summary: ""
|
|
133
188
|
test_files:
|
134
189
|
- spec/blog_resource_spec.rb
|
135
190
|
- spec/blog_spec.rb
|
191
|
+
- spec/integration/tumblr_wrapper_spec.rb
|
136
192
|
- spec/post_spec.rb
|
137
193
|
- spec/spec_helper.rb
|
194
|
+
- spec/support/token_helper.rb.template
|