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 CHANGED
@@ -1 +1 @@
1
- 0.9.0
1
+ 0.9.1
data/bitlyr.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bitlyr"
8
- s.version = "0.9.0"
8
+ s.version = "0.9.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jonstorer"]
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.get_access_token_from_token(params[:token]) if params[:token]
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])
@@ -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.0
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: &70221722565860 !ruby/object:Gem::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: *70221722565860
24
+ version_requirements: *70192798923760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: crack
27
- requirement: &70221722565380 !ruby/object:Gem::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: *70221722565380
35
+ version_requirements: *70192798923280
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: oauth2
38
- requirement: &70221722564860 !ruby/object:Gem::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: *70221722564860
46
+ version_requirements: *70192798922780
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: shoulda
49
- requirement: &70221722564380 !ruby/object:Gem::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: *70221722564380
57
+ version_requirements: *70192798922280
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &70221722563900 !ruby/object:Gem::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: *70221722563900
68
+ version_requirements: *70192798921800
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rcov
71
- requirement: &70221722563420 !ruby/object:Gem::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: *70221722563420
79
+ version_requirements: *70192798921320
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: mocha
82
- requirement: &70221722562940 !ruby/object:Gem::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: *70221722562940
90
+ version_requirements: *70192798910400
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: fakeweb
93
- requirement: &70221722562460 !ruby/object:Gem::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: *70221722562460
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