bitlyr 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bitlyr.gemspec +1 -1
- data/lib/bitlyr.rb +1 -1
- data/test/unit/test_bitly.rb +8 -0
- metadata +17 -17
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.1
|
data/bitlyr.gemspec
CHANGED
data/lib/bitlyr.rb
CHANGED
@@ -10,7 +10,7 @@ module Bitlyr
|
|
10
10
|
params.symbolize_keys!
|
11
11
|
if params.key?(:client_id) && params.key?(:client_secret)
|
12
12
|
strategy = Bitlyr::Strategy::OAuth.new(params[:client_id], params[:client_secret])
|
13
|
-
strategy.
|
13
|
+
strategy.set_access_token_from_token!(params[:token]) if params[:token]
|
14
14
|
Bitlyr::Client.new strategy
|
15
15
|
elsif params.key?(:login) && params.key?(:api_key)
|
16
16
|
Bitlyr::Client.new Bitlyr::Strategy::ApiKey.new(params[:login], params[:api_key])
|
data/test/unit/test_bitly.rb
CHANGED
@@ -21,6 +21,10 @@ class TestBitlyr < Test::Unit::TestCase
|
|
21
21
|
strategy = Bitlyr.new(:client_id => "client id", :client_secret => "client secret").send(:strategy)
|
22
22
|
assert strategy.is_a?(Bitlyr::Strategy::OAuth)
|
23
23
|
end
|
24
|
+
should "not create an access token for the client" do
|
25
|
+
strategy = Bitlyr.new(:client_id => "client id", :client_secret => "client secret").send(:strategy)
|
26
|
+
assert_equal nil, strategy.send(:access_token)
|
27
|
+
end
|
24
28
|
end
|
25
29
|
context "with a client id, client secret and token" do
|
26
30
|
should "create a new bitlyr client" do
|
@@ -31,6 +35,10 @@ class TestBitlyr < Test::Unit::TestCase
|
|
31
35
|
strategy = Bitlyr.new(:client_id => "client id", :client_secret => "client secret", :token => "token").send(:strategy)
|
32
36
|
assert strategy.is_a?(Bitlyr::Strategy::OAuth)
|
33
37
|
end
|
38
|
+
should "create have a bitlyr access token" do
|
39
|
+
strategy = Bitlyr.new(:client_id => "client id", :client_secret => "client secret", :token => "token").send(:strategy)
|
40
|
+
assert strategy.send(:access_token).is_a?(Bitlyr::Strategy::AccessToken)
|
41
|
+
end
|
34
42
|
end
|
35
43
|
context "with bad information" do
|
36
44
|
should "raise an error" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitlyr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-17 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &70192798923760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.7.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70192798923760
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: crack
|
27
|
-
requirement: &
|
27
|
+
requirement: &70192798923280 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.1.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70192798923280
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: oauth2
|
38
|
-
requirement: &
|
38
|
+
requirement: &70192798922780 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.1.1
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70192798922780
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: shoulda
|
49
|
-
requirement: &
|
49
|
+
requirement: &70192798922280 !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: *70192798922280
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: jeweler
|
60
|
-
requirement: &
|
60
|
+
requirement: &70192798921800 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.4.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70192798921800
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rcov
|
71
|
-
requirement: &
|
71
|
+
requirement: &70192798921320 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70192798921320
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: mocha
|
82
|
-
requirement: &
|
82
|
+
requirement: &70192798910400 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 0.10.0
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70192798910400
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: fakeweb
|
93
|
-
requirement: &
|
93
|
+
requirement: &70192798909680 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: 1.2.8
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70192798909680
|
102
102
|
description: ! 'A ruby wrapper for version 3 of the bit.ly API
|
103
103
|
|
104
104
|
Supports Login/ApiKey & OAuth authentication
|