dailymotion 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dailymotion/api.rb +1 -1
- data/lib/dailymotion/version.rb +1 -1
- data/spec/dailymotion/api_spec.rb +5 -5
- metadata +15 -20
data/lib/dailymotion/api.rb
CHANGED
@@ -66,7 +66,7 @@ module Dailymotion
|
|
66
66
|
def refresh_token!
|
67
67
|
raise StandardError, "client_id, client_secret and refresh_token in options hash are mandatory" unless options[:client_id] && options[:client_secret] && options[:refresh_token]
|
68
68
|
|
69
|
-
refresh_request = @faraday_post.post "#{API_BASE_URL}/oauth/token", { grant_type
|
69
|
+
refresh_request = @faraday_post.post "#{API_BASE_URL}/oauth/token", { :grant_type => "refresh_token", :client_id => @options[:client_id], :client_secret => @options[:client_secret], :refresh_token => @options[:refresh_token] }
|
70
70
|
@options[:token] = refresh_request.body.access_token
|
71
71
|
|
72
72
|
set_faradays
|
data/lib/dailymotion/version.rb
CHANGED
@@ -4,13 +4,13 @@ require "pry"
|
|
4
4
|
|
5
5
|
describe Dailymotion::API do
|
6
6
|
it "should be initialized with an options hash" do
|
7
|
-
@api = Dailymotion::API.new(token
|
7
|
+
@api = Dailymotion::API.new(:token => "ABCD")
|
8
8
|
|
9
9
|
@api.options[:token].should eq("ABCD")
|
10
10
|
end
|
11
11
|
|
12
12
|
describe "with a token" do
|
13
|
-
subject { Dailymotion::API.new(token
|
13
|
+
subject { Dailymotion::API.new(:token => "ABCD") }
|
14
14
|
|
15
15
|
describe "#get_object" do
|
16
16
|
it "should get object" do
|
@@ -66,16 +66,16 @@ describe Dailymotion::API do
|
|
66
66
|
|
67
67
|
describe "#refresh_token!" do
|
68
68
|
it "should fail if client_id, client_secret or refresh_token are not set" do
|
69
|
-
@api = Dailymotion::API.new(token
|
69
|
+
@api = Dailymotion::API.new(:token => "ABCD")
|
70
70
|
|
71
71
|
expect { @api.refresh_token! }.to raise_error(StandardError)
|
72
72
|
end
|
73
73
|
|
74
74
|
describe "with all options" do
|
75
75
|
it "should refresh the token" do
|
76
|
-
@api = Dailymotion::API.new(client_id
|
76
|
+
@api = Dailymotion::API.new(:client_id => "pipo", :client_secret => "molo", :refresh_token => "ahah")
|
77
77
|
|
78
|
-
response_mock = mock(:faraday, body
|
78
|
+
response_mock = mock(:faraday, :body => Hashie::Mash.new(:access_token => "new_token"))
|
79
79
|
@api.faraday_post.should_receive(:post).and_return(response_mock)
|
80
80
|
@api.should_receive(:set_faradays).once
|
81
81
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dailymotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
16
|
-
requirement: &
|
16
|
+
requirement: &70162867405700 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70162867405700
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: hashie
|
27
|
-
requirement: &
|
27
|
+
requirement: &70162867404600 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70162867404600
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: faraday_middleware
|
38
|
-
requirement: &
|
38
|
+
requirement: &70162867403680 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70162867403680
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: pry
|
49
|
-
requirement: &
|
49
|
+
requirement: &70162867402660 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70162867402660
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &70162867401380 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70162867401380
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
|
-
requirement: &
|
71
|
+
requirement: &70162867426360 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: 2.10.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70162867426360
|
80
80
|
description: Dailymotion Open Graph API for Ruby
|
81
81
|
email:
|
82
82
|
- slainer68@gmail.com
|
@@ -109,18 +109,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
109
|
- - ! '>='
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
|
-
segments:
|
113
|
-
- 0
|
114
|
-
hash: 981270364239254124
|
115
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
113
|
none: false
|
117
114
|
requirements:
|
118
115
|
- - ! '>='
|
119
116
|
- !ruby/object:Gem::Version
|
120
117
|
version: '0'
|
121
|
-
segments:
|
122
|
-
- 0
|
123
|
-
hash: 981270364239254124
|
124
118
|
requirements: []
|
125
119
|
rubyforge_project:
|
126
120
|
rubygems_version: 1.8.11
|
@@ -130,3 +124,4 @@ summary: Dailymotion Open Graph API for Ruby
|
|
130
124
|
test_files:
|
131
125
|
- spec/dailymotion/api_spec.rb
|
132
126
|
- spec/spec_helper.rb
|
127
|
+
has_rdoc:
|