hubruby 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -4,19 +4,21 @@
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- FIX (describe your package)
7
+ A simple Ruby library for accessing the current GitHub API (v2).
8
8
 
9
9
  == SYNOPSIS:
10
10
 
11
- FIX (code sample of usage)
11
+ user = GitHub.user('diogenes')
12
+ user.repositories
13
+ user.following
12
14
 
13
15
  == REQUIREMENTS:
14
16
 
15
- * FIX (list of requirements)
17
+ * httparty
16
18
 
17
19
  == INSTALL:
18
20
 
19
- * FIX (sudo gem install, anything else)
21
+ sudo gem install hubruby
20
22
 
21
23
  == LICENSE:
22
24
 
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ $hoe = Hoe.spec 'hubruby' do
14
14
  self.developer 'Diógenes Falcão', 'diogenes {d-o-t} araujo {at} gmail.com'
15
15
  self.rubyforge_name = self.name
16
16
  self.extra_deps = [['httparty','= 0.6.1']]
17
- self.version = '0.0.2'
17
+ self.version = '0.0.3'
18
18
  end
19
19
 
20
20
  require 'newgem/tasks'
@@ -1,41 +1,41 @@
1
1
  module GitHub
2
2
  module Finders
3
- def user(username)
4
- j = json("/user/show/#{username}", :user)
3
+ def user(login)
4
+ j = json("/user/show/#{login}", :user)
5
5
  User.from_json(j)
6
6
  end
7
7
 
8
- def following(username)
9
- j = json("/user/show/#{username}/following", :users)
8
+ def following(login)
9
+ j = json("/user/show/#{login}/following", :users)
10
10
  User.users_from_json(j)
11
11
  end
12
12
 
13
- def followers(username)
14
- j = json("/user/show/#{username}/followers", :users)
13
+ def followers(login)
14
+ j = json("/user/show/#{login}/followers", :users)
15
15
  User.users_from_json(j)
16
16
  end
17
17
 
18
- def repositories(username)
19
- j = json("/repos/show/#{username}", :repositories)
18
+ def repositories(login)
19
+ j = json("/repos/show/#{login}", :repositories)
20
20
  Repository.repositories_from_json(j)
21
21
  end
22
22
 
23
- def watched(username)
24
- j = json("/repos/watched/#{username}", :repositories)
23
+ def watched(login)
24
+ j = json("/repos/watched/#{login}", :repositories)
25
25
  Repository.repositories_from_json(j)
26
26
  end
27
27
 
28
- def repository(username, repository_name)
29
- j = json("/repos/show/#{username}/#{repository_name}", :repository)
28
+ def repository(login, repository_name)
29
+ j = json("/repos/show/#{login}/#{repository_name}", :repository)
30
30
  Repository.from_json(j)
31
31
  end
32
32
 
33
- def branches(username, repository_name)
34
- json("/repos/show/#{username}/#{repository_name}/branches", :branches)
33
+ def branches(login, repository_name)
34
+ json("/repos/show/#{login}/#{repository_name}/branches", :branches)
35
35
  end
36
36
 
37
- def network(username, repository_name)
38
- j = json("/repos/show/#{username}/#{repository_name}/network", :network)
37
+ def network(login, repository_name)
38
+ j = json("/repos/show/#{login}/#{repository_name}/network", :network)
39
39
  Repository.repositories_from_json(j)
40
40
  end
41
41
 
@@ -7,25 +7,25 @@ module GitHub
7
7
  end
8
8
 
9
9
  def self.users_from_json(json)
10
- json.inject([]) do |users, username|
11
- users << from_json(:username => username)
10
+ json.inject([]) do |users, login|
11
+ users << from_json(:login => login)
12
12
  end
13
13
  end
14
14
 
15
15
  def following
16
- @following ||= GitHub.following(self.username)
16
+ @following ||= GitHub.following(self.login)
17
17
  end
18
18
 
19
19
  def followers
20
- @followers ||= GitHub.followers(self.username)
20
+ @followers ||= GitHub.followers(self.login)
21
21
  end
22
22
 
23
23
  def repositories
24
- @repositories ||= GitHub.repositories(self.username)
24
+ @repositories ||= GitHub.repositories(self.login)
25
25
  end
26
26
 
27
27
  def watched
28
- @watched ||= GitHub.watched(self.username)
28
+ @watched ||= GitHub.watched(self.login)
29
29
  end
30
30
  end
31
31
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Di\xC3\xB3genes Falc\xC3\xA3o"
@@ -66,12 +66,9 @@ executables: []
66
66
 
67
67
  extensions: []
68
68
 
69
- extra_rdoc_files:
70
- - History.txt
71
- - Manifest.txt
69
+ extra_rdoc_files: []
70
+
72
71
  files:
73
- - History.txt
74
- - Manifest.txt
75
72
  - README.rdoc
76
73
  - Rakefile
77
74
  - TODO
data/History.txt DELETED
@@ -1,6 +0,0 @@
1
- === 1.0.0 / 2010-08-30
2
-
3
- * 1 major enhancement
4
-
5
- * Birthday!
6
-
data/Manifest.txt DELETED
@@ -1,14 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.rdoc
4
- Rakefile
5
- TODO
6
- lib/github/base.rb
7
- lib/github/finders.rb
8
- lib/github/models/repository.rb
9
- lib/github/models/user.rb
10
- lib/hubruby.rb
11
- script/console
12
- script/destroy
13
- script/generate
14
-