bitly 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/Manifest +1 -0
- data/README.md +2 -0
- data/bitly.gemspec +3 -3
- data/lib/bitly/client.rb +2 -2
- data/lib/bitly/version.rb +1 -1
- data/test/bitly/test_client.rb +18 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0b30bb481709d6c1a9755ef8dcfc7c9bae88f3f
|
4
|
+
data.tar.gz: 3a772a1f8efdfbcf7eb8f155c5f6f53c12584daa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 304cd99d95d96fcfe27c70376d5186def5f8840b116c4eb6b4aaf59704b12f7f818c26510e4def3f86f4cb487e092a256c70b0b6a921687b6497b801d84d90b5
|
7
|
+
data.tar.gz: ff7094ffd7548d4bead9f6bce4478195253d61aadd645765460c75dc27cf19ce0d5457c06ec1fcb476b689f7e364611d1334744cde68c3a1af85f68c6d16b551
|
data/Manifest
CHANGED
data/README.md
CHANGED
@@ -6,6 +6,8 @@ A Ruby API for [http://bitly.com](http://bitly.com)
|
|
6
6
|
|
7
7
|
[http://dev.bitly.com](http://dev.bitly.com)
|
8
8
|
|
9
|
+
[](https://travis-ci.org/philnash/bitly)
|
10
|
+
|
9
11
|
## NOTE:
|
10
12
|
|
11
13
|
Bitly recently released their version 3 API. From this 0.5.0 release, the gem will continue to work the same but also provide a V3 module, using the version 3 API. The standard module will become deprecated, as Bitly do not plan to keep the version 2 API around forever.
|
data/bitly.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: bitly 1.0.
|
2
|
+
# stub: bitly 1.0.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "bitly".freeze
|
6
|
-
s.version = "1.0.
|
6
|
+
s.version = "1.0.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Phil Nash".freeze]
|
11
|
-
s.date = "2016-
|
11
|
+
s.date = "2016-11-03"
|
12
12
|
s.description = "Use the bit.ly API to shorten or expand URLs".freeze
|
13
13
|
s.email = "philnash@gmail.com".freeze
|
14
14
|
s.extra_rdoc_files = ["LICENSE.md".freeze, "README.md".freeze, "lib/bitly.rb".freeze, "lib/bitly/client.rb".freeze, "lib/bitly/config.rb".freeze, "lib/bitly/url.rb".freeze, "lib/bitly/utils.rb".freeze, "lib/bitly/v3.rb".freeze, "lib/bitly/v3/bitly.rb".freeze, "lib/bitly/v3/client.rb".freeze, "lib/bitly/v3/country.rb".freeze, "lib/bitly/v3/day.rb".freeze, "lib/bitly/v3/missing_url.rb".freeze, "lib/bitly/v3/oauth.rb".freeze, "lib/bitly/v3/realtime_link.rb".freeze, "lib/bitly/v3/referrer.rb".freeze, "lib/bitly/v3/url.rb".freeze, "lib/bitly/v3/user.rb".freeze, "lib/bitly/version.rb".freeze]
|
data/lib/bitly/client.rb
CHANGED
@@ -16,11 +16,11 @@ module Bitly
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.use_api_version_3
|
19
|
-
api_version = 3
|
19
|
+
self.api_version = 3
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.use_api_version_2
|
23
|
-
api_version = 2
|
23
|
+
self.api_version = 2
|
24
24
|
end
|
25
25
|
|
26
26
|
# get and initialize a client if configured using Config
|
data/lib/bitly/version.rb
CHANGED
data/test/bitly/test_client.rb
CHANGED
@@ -34,6 +34,24 @@ class TestClient < Minitest::Test
|
|
34
34
|
url = client.authorize_url('http://www.example.com/oauth_callback', 'some_state')
|
35
35
|
assert_equal "https://bitly.com/oauth/authorize?client_id=CLIENT_ID&redirect_uri=http%3A%2F%2Fwww.example.com%2Foauth_callback&response_type=code&state=some_state", url
|
36
36
|
end
|
37
|
+
|
38
|
+
context "setting api versions" do
|
39
|
+
teardown do
|
40
|
+
Bitly.api_version = nil
|
41
|
+
end
|
42
|
+
|
43
|
+
should "set the api version to 2" do
|
44
|
+
Bitly.use_api_version_2
|
45
|
+
assert_equal Bitly.api_version, 2
|
46
|
+
assert_kind_of Bitly::Client, Bitly.client
|
47
|
+
end
|
48
|
+
|
49
|
+
should "set the api version to 3" do
|
50
|
+
Bitly.use_api_version_3
|
51
|
+
assert_equal Bitly.api_version, 3
|
52
|
+
assert_kind_of Bitly::V3::Client, Bitly.client
|
53
|
+
end
|
54
|
+
end
|
37
55
|
end
|
38
56
|
context "using the bitly client" do
|
39
57
|
setup do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phil Nash
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -42,22 +42,22 @@ dependencies:
|
|
42
42
|
name: oauth2
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.5.0
|
48
45
|
- - "<"
|
49
46
|
- !ruby/object:Gem::Version
|
50
47
|
version: '2.0'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.5.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
|
-
- - ">="
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: 0.5.0
|
58
55
|
- - "<"
|
59
56
|
- !ruby/object:Gem::Version
|
60
57
|
version: '2.0'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.5.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: echoe
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|