rubhub 0.0.3

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.
Files changed (36) hide show
  1. data/README.md +0 -0
  2. data/lib/github/events/events.rb +45 -0
  3. data/lib/github/gists/gists.rb +66 -0
  4. data/lib/github/gists/gists_comments.rb +35 -0
  5. data/lib/github/gitdata/gitdata.rb +12 -0
  6. data/lib/github/gitdata/gitdata_blobs.rb +24 -0
  7. data/lib/github/gitdata/gitdata_commits.rb +42 -0
  8. data/lib/github/gitdata/gitdata_references.rb +44 -0
  9. data/lib/github/gitdata/gitdata_tags.rb +33 -0
  10. data/lib/github/gitdata/gitdata_trees.rb +25 -0
  11. data/lib/github/github.rb +95 -0
  12. data/lib/github/issues/issues.rb +84 -0
  13. data/lib/github/issues/issues_comments.rb +40 -0
  14. data/lib/github/issues/issues_events.rb +22 -0
  15. data/lib/github/issues/issues_labels.rb +76 -0
  16. data/lib/github/issues/issues_milestones.rb +54 -0
  17. data/lib/github/orgs/orgs.rb +32 -0
  18. data/lib/github/orgs/orgs_members.rb +40 -0
  19. data/lib/github/orgs/orgs_teams.rb +78 -0
  20. data/lib/github/pullreqs/pullreqs.rb +76 -0
  21. data/lib/github/pullreqs/pullreqs_reviewcomments.rb +53 -0
  22. data/lib/github/repos/repos.rb +104 -0
  23. data/lib/github/repos/repos_collaborators.rb +27 -0
  24. data/lib/github/repos/repos_commits.rb +72 -0
  25. data/lib/github/repos/repos_downloads.rb +55 -0
  26. data/lib/github/repos/repos_forks.rb +25 -0
  27. data/lib/github/repos/repos_hooks.rb +57 -0
  28. data/lib/github/repos/repos_keys.rb +43 -0
  29. data/lib/github/repos/repos_watching.rb +33 -0
  30. data/lib/github/users/users.rb +34 -0
  31. data/lib/github/users/users_emails.rb +22 -0
  32. data/lib/github/users/users_followers.rb +31 -0
  33. data/lib/github/users/users_keys.rb +37 -0
  34. data/lib/rubhub.rb +38 -0
  35. data/test/test.rb +9 -0
  36. metadata +101 -0
@@ -0,0 +1,22 @@
1
+ class UsersEmails
2
+ attr_accessor :github
3
+
4
+ def initialize(github)
5
+ @github = github
6
+ end
7
+
8
+ def listEmails()
9
+ @github.get('user/emails')
10
+ end
11
+
12
+ def addEmails(emails)
13
+ data = emails.to_json
14
+ puts data
15
+ @github.post('user/emails', data)
16
+ end
17
+
18
+ def deleteEmails(emails)
19
+ data = emails.to_json
20
+ @github.delete('user/emails', data)
21
+ end
22
+ end
@@ -0,0 +1,31 @@
1
+ class UsersFollowers
2
+ attr_accessor :github
3
+
4
+ def initialize(github)
5
+ @github = github
6
+ end
7
+
8
+ def listFollowers(user=nil)
9
+ url = (user != nil and user != @github.username) ?
10
+ 'users/%s/followers' % user : 'user/followers'
11
+ @github.get(url)
12
+ end
13
+
14
+ def listFollowing(user=nil)
15
+ url = (user != nil and user != @github.username) ?
16
+ 'users/%s/following' % user : 'user/following'
17
+ @github.get(url)
18
+ end
19
+
20
+ def checkIfFollowing(user)
21
+ @github.get('user/following/%s' % user)
22
+ end
23
+
24
+ def followUser(user)
25
+ @github.put('user/following/%s' % user)
26
+ end
27
+
28
+ def unfollowUser(user)
29
+ @github.delete('user/following/%s' % user)
30
+ end
31
+ end
@@ -0,0 +1,37 @@
1
+ class UsersKeys
2
+ attr_accessor :github
3
+
4
+ def initialize(github)
5
+ @github = github
6
+ end
7
+
8
+ def listPublicKeys()
9
+ @github.get('user/keys')
10
+ end
11
+
12
+ def getPublicKey(id)
13
+ @github.get('user/keys/%s' % id)
14
+ end
15
+
16
+ def createPublicKey(title, key)
17
+ params = {
18
+ :title => title,
19
+ :key => key
20
+ }
21
+ data = params.to_json
22
+ @github.post('user/keys', data)
23
+ end
24
+
25
+ def updatePublicKey(id, title, key)
26
+ params = {
27
+ :title => title,
28
+ :key => key
29
+ }
30
+ data = params.to_json
31
+ @github.patch('user/keys/%s' % id, data)
32
+ end
33
+
34
+ def deletePublicKey(id)
35
+ @github.delete('user/keys/%s' % id)
36
+ end
37
+ end
@@ -0,0 +1,38 @@
1
+ require 'base64'
2
+ require 'json'
3
+ require 'net/http'
4
+ require 'pathname'
5
+ require 'rest_client'
6
+
7
+ require 'github/github'
8
+ require 'github/events/events'
9
+ require 'github/gists/gists'
10
+ require 'github/gists/gists_comments'
11
+ require 'github/gitdata/gitdata'
12
+ require 'github/gitdata/gitdata_blobs'
13
+ require 'github/gitdata/gitdata_commits'
14
+ require 'github/gitdata/gitdata_references'
15
+ require 'github/gitdata/gitdata_tags'
16
+ require 'github/gitdata/gitdata_trees'
17
+ require 'github/issues/issues'
18
+ require 'github/issues/issues_comments'
19
+ require 'github/issues/issues_events'
20
+ require 'github/issues/issues_labels'
21
+ require 'github/issues/issues_milestones'
22
+ require 'github/orgs/orgs'
23
+ require 'github/orgs/orgs_members'
24
+ require 'github/orgs/orgs_teams'
25
+ require 'github/pullreqs/pullreqs'
26
+ require 'github/pullreqs/pullreqs_reviewcomments'
27
+ require 'github/repos/repos'
28
+ require 'github/repos/repos_collaborators'
29
+ require 'github/repos/repos_commits'
30
+ require 'github/repos/repos_downloads'
31
+ require 'github/repos/repos_forks'
32
+ require 'github/repos/repos_hooks'
33
+ require 'github/repos/repos_keys'
34
+ require 'github/repos/repos_watching'
35
+ require 'github/users/users'
36
+ require 'github/users/users_emails'
37
+ require 'github/users/users_followers'
38
+ require 'github/users/users_keys'
@@ -0,0 +1,9 @@
1
+ $LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
2
+ require 'rubhub'
3
+
4
+ username = 'csphere'
5
+ password = 'Asdf1597531`1'
6
+
7
+ g = Github.new(username, password)
8
+
9
+ #puts g.users.getUser()
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubhub
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sean Kennedy
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: json
16
+ requirement: &22155984 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.5.4
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *22155984
25
+ - !ruby/object:Gem::Dependency
26
+ name: rest-client
27
+ requirement: &22155660 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 1.6.7
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *22155660
36
+ description: An intuitive wrapper for the Github Api v3.
37
+ email: cspheregreen@gmail.com
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files: []
41
+ files:
42
+ - README.md
43
+ - lib/rubhub.rb
44
+ - lib/github/github.rb
45
+ - lib/github/events/events.rb
46
+ - lib/github/gists/gists.rb
47
+ - lib/github/gists/gists_comments.rb
48
+ - lib/github/gitdata/gitdata.rb
49
+ - lib/github/gitdata/gitdata_blobs.rb
50
+ - lib/github/gitdata/gitdata_commits.rb
51
+ - lib/github/gitdata/gitdata_references.rb
52
+ - lib/github/gitdata/gitdata_tags.rb
53
+ - lib/github/gitdata/gitdata_trees.rb
54
+ - lib/github/issues/issues.rb
55
+ - lib/github/issues/issues_comments.rb
56
+ - lib/github/issues/issues_events.rb
57
+ - lib/github/issues/issues_labels.rb
58
+ - lib/github/issues/issues_milestones.rb
59
+ - lib/github/orgs/orgs.rb
60
+ - lib/github/orgs/orgs_members.rb
61
+ - lib/github/orgs/orgs_teams.rb
62
+ - lib/github/pullreqs/pullreqs.rb
63
+ - lib/github/pullreqs/pullreqs_reviewcomments.rb
64
+ - lib/github/repos/repos.rb
65
+ - lib/github/repos/repos_collaborators.rb
66
+ - lib/github/repos/repos_commits.rb
67
+ - lib/github/repos/repos_downloads.rb
68
+ - lib/github/repos/repos_forks.rb
69
+ - lib/github/repos/repos_hooks.rb
70
+ - lib/github/repos/repos_keys.rb
71
+ - lib/github/repos/repos_watching.rb
72
+ - lib/github/users/users.rb
73
+ - lib/github/users/users_emails.rb
74
+ - lib/github/users/users_followers.rb
75
+ - lib/github/users/users_keys.rb
76
+ - test/test.rb
77
+ homepage: http://rubygems.org/gems/rubhub
78
+ licenses: []
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 1.8.17
98
+ signing_key:
99
+ specification_version: 3
100
+ summary: Intuitive wrapper for the Github Api v3.
101
+ test_files: []