bucketface 0.1.1 → 0.2.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.
- data/lib/bucketface/client.rb +6 -1
- data/lib/bucketface/version.rb +1 -1
- data/test/bucketface_test.rb +7 -0
- metadata +4 -4
data/lib/bucketface/client.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Bucketface
|
2
2
|
class Client
|
3
|
-
include HTTParty
|
3
|
+
include HTTParty
|
4
4
|
format :json
|
5
5
|
base_uri "https://api.bitbucket.org/1.0"
|
6
6
|
|
@@ -15,6 +15,11 @@ module Bucketface
|
|
15
15
|
@login = auth[:login]
|
16
16
|
self.class.basic_auth(@login, auth[:password])
|
17
17
|
end
|
18
|
+
@@api = self
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.api
|
22
|
+
@@api
|
18
23
|
end
|
19
24
|
|
20
25
|
def user(login=self.login)
|
data/lib/bucketface/version.rb
CHANGED
data/test/bucketface_test.rb
CHANGED
@@ -13,6 +13,13 @@ class BucketfaceTest < Test::Unit::TestCase
|
|
13
13
|
user.is_private?.should == false
|
14
14
|
end
|
15
15
|
|
16
|
+
should "extract api from Bucketface module" do
|
17
|
+
stub_get('https://cored:2U812@api.bitbucket.org/1.0/users/cored/?', 'full_user.json')
|
18
|
+
Bucketface::Client.new(:login => 'cored', :password => '2U812')
|
19
|
+
api = Bucketface::Client.api
|
20
|
+
api.user.username.should be_eql('cored')
|
21
|
+
end
|
22
|
+
|
16
23
|
should "return followers for an user authenticated user" do
|
17
24
|
stub_get('/users/cored/followers/?', 'followers.json')
|
18
25
|
followers = @client.followers
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bucketface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 2
|
8
9
|
- 1
|
9
|
-
|
10
|
-
version: 0.1.1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rafael George
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-15 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|