github_api 0.4.11 → 0.5.0.rc1

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 (109) hide show
  1. data/README.md +76 -72
  2. data/features/cassettes/gists/starred.yml +48 -0
  3. data/features/cassettes/pagination/repos/commits/list.yml +193 -0
  4. data/features/cassettes/pagination/repos/commits/next.yml +183 -0
  5. data/features/cassettes/pagination/repos/diff/next.yml +45 -0
  6. data/features/cassettes/pagination/repos/list.yml +176 -0
  7. data/features/cassettes/pagination/repos/list/next.yml +222 -0
  8. data/features/cassettes/pagination/repos/per_page/each_page.yml +45 -0
  9. data/features/cassettes/repos/list.yml +92 -0
  10. data/features/error_codes.feature +1 -1
  11. data/features/gists.feature +12 -3
  12. data/features/gists/comments.feature +3 -3
  13. data/features/github_api.feature +13 -2
  14. data/features/pagination.feature +40 -39
  15. data/features/repos.feature +2 -2
  16. data/features/step_definitions/common_steps.rb +12 -0
  17. data/features/step_definitions/github_api_steps.rb +12 -1
  18. data/lib/github_api.rb +1 -1
  19. data/lib/github_api/api.rb +4 -2
  20. data/lib/github_api/api_factory.rb +11 -5
  21. data/lib/github_api/authorizations.rb +23 -32
  22. data/lib/github_api/client.rb +1 -0
  23. data/lib/github_api/events.rb +38 -38
  24. data/lib/github_api/filter.rb +1 -1
  25. data/lib/github_api/gists.rb +47 -42
  26. data/lib/github_api/gists/comments.rb +77 -84
  27. data/lib/github_api/git_data.rb +25 -6
  28. data/lib/github_api/git_data/blobs.rb +48 -45
  29. data/lib/github_api/git_data/commits.rb +76 -73
  30. data/lib/github_api/git_data/references.rb +137 -118
  31. data/lib/github_api/git_data/tags.rb +74 -70
  32. data/lib/github_api/git_data/trees.rb +88 -85
  33. data/lib/github_api/issues.rb +43 -31
  34. data/lib/github_api/issues/comments.rb +116 -119
  35. data/lib/github_api/issues/events.rb +20 -19
  36. data/lib/github_api/issues/labels.rb +200 -197
  37. data/lib/github_api/issues/milestones.rb +137 -134
  38. data/lib/github_api/orgs.rb +27 -23
  39. data/lib/github_api/orgs/members.rb +105 -108
  40. data/lib/github_api/orgs/teams.rb +236 -237
  41. data/lib/github_api/paged_request.rb +1 -1
  42. data/lib/github_api/pull_requests.rb +40 -42
  43. data/lib/github_api/pull_requests/comments.rb +140 -143
  44. data/lib/github_api/repos.rb +101 -67
  45. data/lib/github_api/repos/collaborators.rb +64 -68
  46. data/lib/github_api/repos/commits.rb +50 -39
  47. data/lib/github_api/repos/downloads.rb +107 -110
  48. data/lib/github_api/repos/forks.rb +38 -39
  49. data/lib/github_api/repos/hooks.rb +161 -167
  50. data/lib/github_api/repos/keys.rb +86 -86
  51. data/lib/github_api/repos/pub_sub_hubbub.rb +99 -87
  52. data/lib/github_api/repos/watching.rb +80 -82
  53. data/lib/github_api/request.rb +5 -9
  54. data/lib/github_api/users.rb +26 -16
  55. data/lib/github_api/users/emails.rb +47 -47
  56. data/lib/github_api/users/followers.rb +85 -86
  57. data/lib/github_api/users/keys.rb +73 -75
  58. data/lib/github_api/validations.rb +25 -0
  59. data/lib/github_api/validations/format.rb +23 -0
  60. data/lib/github_api/validations/presence.rb +25 -0
  61. data/lib/github_api/validations/required.rb +21 -0
  62. data/lib/github_api/validations/token.rb +41 -0
  63. data/lib/github_api/version.rb +3 -3
  64. data/spec/fixtures/repos/commit_comparison.json +112 -0
  65. data/spec/github/api_factory_spec.rb +17 -1
  66. data/spec/github/authorizations_spec.rb +36 -34
  67. data/spec/github/gists/comments_spec.rb +39 -45
  68. data/spec/github/gists_spec.rb +50 -53
  69. data/spec/github/git_data/blobs_spec.rb +27 -20
  70. data/spec/github/git_data/commits_spec.rb +20 -19
  71. data/spec/github/git_data/references_spec.rb +83 -46
  72. data/spec/github/git_data/tags_spec.rb +16 -15
  73. data/spec/github/git_data/trees_spec.rb +20 -19
  74. data/spec/github/git_data_spec.rb +10 -1
  75. data/spec/github/issues/comments_spec.rb +78 -68
  76. data/spec/github/issues/events_spec.rb +42 -34
  77. data/spec/github/issues/labels_spec.rb +89 -101
  78. data/spec/github/issues/milestones_spec.rb +76 -54
  79. data/spec/github/issues_spec.rb +53 -57
  80. data/spec/github/orgs/members_spec.rb +64 -49
  81. data/spec/github/orgs/teams_spec.rb +112 -101
  82. data/spec/github/orgs_spec.rb +41 -31
  83. data/spec/github/paged_request_spec.rb +6 -5
  84. data/spec/github/pull_requests/comments_spec.rb +39 -44
  85. data/spec/github/pull_requests_spec.rb +32 -48
  86. data/spec/github/repos/collaborators_spec.rb +40 -29
  87. data/spec/github/repos/commits_spec.rb +108 -64
  88. data/spec/github/repos/downloads_spec.rb +46 -45
  89. data/spec/github/repos/forks_spec.rb +23 -24
  90. data/spec/github/repos/hooks_spec.rb +69 -71
  91. data/spec/github/repos/keys_spec.rb +39 -34
  92. data/spec/github/repos/pub_sub_hubbub_spec.rb +4 -4
  93. data/spec/github/repos/watching_spec.rb +31 -33
  94. data/spec/github/repos_spec.rb +74 -83
  95. data/spec/github/request_spec.rb +31 -2
  96. data/spec/github/users/emails_spec.rb +19 -17
  97. data/spec/github/users/followers_spec.rb +30 -28
  98. data/spec/github/users/keys_spec.rb +37 -33
  99. data/spec/github/users_spec.rb +124 -125
  100. data/spec/github/validations/format_spec.rb +42 -0
  101. data/spec/github/validations/presence_spec.rb +18 -0
  102. data/spec/github/validations/required_spec.rb +28 -0
  103. data/spec/github/validations/token_spec.rb +19 -0
  104. data/spec/github/validations_spec.rb +23 -0
  105. metadata +33 -10
  106. data/features/cassettes/pagination/repos.yml +0 -177
  107. data/features/cassettes/pagination/repos/next.yml +0 -177
  108. data/lib/github_api/validation.rb +0 -53
  109. data/spec/github/validation_spec.rb +0 -62
@@ -1,102 +1,114 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Github
4
- class Repos
5
- module PubSubHubbub
4
+ class Repos::PubSubHubbub < API
6
5
 
7
- # Subscribe to existing topic through pubsubhubbub
8
- #
9
- # = Parameters
10
- # * topic - Required string - The URI of the GitHub repository to subscribe to. The path must be in the format of /:user/:repo/events/:event.
11
- # * callback - Required string - The URI to receive the updates to the topic.
12
- #
13
- # = Examples
14
- # @github = Github.new :oauth_token => '...'
15
- # @github.subscribe 'https://github.com/:user/:repo/events/push',
16
- # 'github://Email?address=peter-murach@gmail.com',
17
- # :verify => 'sync',
18
- # :secret => '...'
19
- #
20
- def subscribe(topic, callback, params={})
21
- _validate_presence_of topic, callback
22
- _normalize_params_keys(params)
23
- _merge_action!("subscribe", topic, callback, params)
6
+ # Subscribe to existing topic/event through pubsubhubbub
7
+ #
8
+ # = Parameters
9
+ # * topic - Required string - The URI of the GitHub repository to subscribe to. The path must be in the format of /:user/:repo/events/:event.
10
+ # * callback - Required string - The URI to receive the updates to the topic.
11
+ #
12
+ # = Examples
13
+ # github = Github.new :oauth_token => '...'
14
+ # github.repos.pubsubhubbub.subscribe
15
+ # 'https://github.com/:user/:repo/events/push',
16
+ # 'github://Email?address=peter-murach@gmail.com',
17
+ # :verify => 'sync',
18
+ # :secret => '...'
19
+ #
20
+ def subscribe(topic, callback, params={})
21
+ _validate_presence_of topic, callback
22
+ _normalize_params_keys(params)
23
+ _merge_action!("subscribe", topic, callback, params)
24
24
 
25
- post("/hub", params)
26
- end
25
+ post_request("/hub", params)
26
+ end
27
27
 
28
- # Unsubscribe from existing topic though pubsubhubbub
29
- #
30
- #
31
- def unsubscribe(topic, callback, params={})
32
- _validate_presence_of topic, callback
33
- _normalize_params_keys(params)
34
- _merge_action!("unsubscribe", topic, callback, params)
28
+ # Unsubscribe from existing topic/event through pubsubhubbub
29
+ #
30
+ # = Parameters
31
+ # * topic - Required string - The URI of the GitHub repository to unsubscribe from. The path must be in the format of /:user/:repo/events/:event.
32
+ # * callback - Required string - The URI to unsubscribe the topic from.
33
+ #
34
+ # = Examples
35
+ # github = Github.new :oauth_token => '...'
36
+ # github.repos.pubsubhubbub.unsubscribe
37
+ # 'https://github.com/:user/:repo/events/push',
38
+ # 'github://Email?address=peter-murach@gmail.com',
39
+ # :verify => 'sync',
40
+ # :secret => '...'
41
+ #
42
+ def unsubscribe(topic, callback, params={})
43
+ _validate_presence_of topic, callback
44
+ _normalize_params_keys(params)
45
+ _merge_action!("unsubscribe", topic, callback, params)
35
46
 
36
- post("/hub", params)
37
- end
47
+ post_request("/hub", params)
48
+ end
38
49
 
39
- # Subscribe repository to service hook through pubsubhubbub
40
- #
41
- # = Parameters
42
- # * repo-name - Required string,
43
- # * service-name - Required string
44
- # * <tt>:event</tt> - Required hash key for the type of event. The default event is <tt>push</tt>
45
- #
46
- # = Examples
47
- # @github = Github.new :oauth_token => '...'
48
- # @github.repos.subscribe_service 'user-name', 'repo-name', 'campfire',
49
- # :subdomain => 'github',
50
- # :room => 'Commits',
51
- # :token => 'abc123',
52
- # :event => 'watch'
53
- #
54
- def subscribe_service(user_name, repo_name, service_name, params={})
55
- _validate_presence_of user_name, repo_name, service_name
56
- _normalize_params_keys(params)
57
- event = params.delete('event') || 'push'
58
- topic = "https://github.com/#{user_name}/#{repo_name}/events/#{event}"
59
- callback = "github://#{service_name}?#{params.serialize}"
50
+ # Subscribe repository to service hook through pubsubhubbub
51
+ #
52
+ # = Parameters
53
+ # * repo-name - Required string,
54
+ # * service-name - Required string
55
+ # * <tt>:event</tt> - Required hash key for the type of event. The default event is <tt>push</tt>
56
+ #
57
+ # = Examples
58
+ # github = Github.new :oauth_token => '...'
59
+ # github.repos.pubsubhubbub.subscribe_service 'user-name', 'repo-name', 'campfire',
60
+ # :subdomain => 'github',
61
+ # :room => 'Commits',
62
+ # :token => 'abc123',
63
+ # :event => 'watch'
64
+ #
65
+ def subscribe_service(user_name, repo_name, service_name, params={})
66
+ _validate_presence_of user_name, repo_name, service_name
67
+ _normalize_params_keys(params)
68
+ event = params.delete('event') || 'push'
69
+ topic = "https://github.com/#{user_name}/#{repo_name}/events/#{event}"
70
+ callback = "github://#{service_name}?#{params.serialize}"
60
71
 
61
- subscribe(topic, callback)
62
- end
63
- alias :subscribe_repository :subscribe_service
72
+ subscribe(topic, callback)
73
+ end
74
+ alias :subscribe_repository :subscribe_service
75
+ alias :subscribe_repo :subscribe_service
64
76
 
65
- # Subscribe repository to service hook through pubsubhubbub
66
- #
67
- # = Parameters
68
- # * repo-name - Required string,
69
- # * service-name - Required string
70
- # * <tt>:event</tt> - Optional hash key for the type of event. The default event is <tt>push</tt>
71
- #
72
- # = Examples
73
- # @github = Github.new :oauth_token => '...'
74
- # @github.repos.unsubscribe_service 'user-name', 'repo-name', 'campfire'
75
- #
76
- def unsubscribe_service(user_name, repo_name, service_name, params={})
77
- _validate_presence_of user_name, repo_name, service_name
78
- _normalize_params_keys(params)
79
- event = params.delete('event') || 'push'
80
- topic = "https://github.com/#{user_name}/#{repo_name}/events/#{event}"
81
- callback = "github://#{service_name}"
77
+ # Subscribe repository to service hook through pubsubhubbub
78
+ #
79
+ # = Parameters
80
+ # * repo-name - Required string,
81
+ # * service-name - Required string
82
+ # * <tt>:event</tt> - Optional hash key for the type of event. The default event is <tt>push</tt>
83
+ #
84
+ # = Examples
85
+ # github = Github.new :oauth_token => '...'
86
+ # github.repos.pubsubhubbub.unsubscribe_service 'user-name', 'repo-name', 'campfire'
87
+ #
88
+ def unsubscribe_service(user_name, repo_name, service_name, params={})
89
+ _validate_presence_of user_name, repo_name, service_name
90
+ _normalize_params_keys(params)
91
+ event = params.delete('event') || 'push'
92
+ topic = "https://github.com/#{user_name}/#{repo_name}/events/#{event}"
93
+ callback = "github://#{service_name}"
82
94
 
83
- unsubscribe(topic, callback)
84
- end
85
- alias :unsubscribe_repository :unsubscribe_service
95
+ unsubscribe(topic, callback)
96
+ end
97
+ alias :unsubscribe_repository :unsubscribe_service
98
+ alias :unsubscribe_repo :unsubscribe_service
86
99
 
87
- private
100
+ private
88
101
 
89
- def _merge_action!(action, topic, callback, params) # :nodoc:
90
- options = {
91
- "hub.mode" => action.to_s,
92
- "hub.topic" => topic.to_s,
93
- "hub.callback" => callback,
94
- "hub.verify" => params.delete('verify') || 'sync',
95
- "hub.secret" => params.delete('secret') || ''
96
- }
97
- params.merge! options
98
- end
102
+ def _merge_action!(action, topic, callback, params) # :nodoc:
103
+ options = {
104
+ "hub.mode" => action.to_s,
105
+ "hub.topic" => topic.to_s,
106
+ "hub.callback" => callback,
107
+ "hub.verify" => params.delete('verify') || 'sync',
108
+ "hub.secret" => params.delete('secret') || ''
109
+ }
110
+ params.merge! options
111
+ end
99
112
 
100
- end # PubSubHubbub
101
- end # Repos
113
+ end # Repos::PubSubHubbub
102
114
  end # Github
@@ -1,95 +1,93 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Github
4
- class Repos
5
- module Watching
4
+ class Repos::Watching < API
6
5
 
7
- # List repo watchers
8
- #
9
- # = Examples
10
- # @github = Github.new :user => 'user-name', :repo => 'repo-name'
11
- # @github.repos.watchers
12
- # @github.repos.watchers { |watcher| ... }
13
- #
14
- def watchers(user_name, repo_name, params={})
15
- _update_user_repo_params(user_name, repo_name)
16
- _validate_user_repo_params(user, repo) unless user? && repo?
17
- _normalize_params_keys(params)
6
+ # List repo watchers
7
+ #
8
+ # = Examples
9
+ # github = Github.new :user => 'user-name', :repo => 'repo-name'
10
+ # github.repos.watching.watchers
11
+ # github.repos.watching.watchers { |watcher| ... }
12
+ #
13
+ def watchers(user_name, repo_name, params={})
14
+ _update_user_repo_params(user_name, repo_name)
15
+ _validate_user_repo_params(user, repo) unless user? && repo?
16
+ _normalize_params_keys(params)
18
17
 
19
- response = get("/repos/#{user}/#{repo}/watchers", params)
20
- return response unless block_given?
21
- response.each { |el| yield el }
22
- end
18
+ response = get_request("/repos/#{user}/#{repo}/watchers", params)
19
+ return response unless block_given?
20
+ response.each { |el| yield el }
21
+ end
23
22
 
24
- # List repos being watched by a user
25
- #
26
- # = Examples
27
- # @github = Github.new
28
- # @github.repos.watched :user => 'user-name'
29
- #
30
- # List repos being watched by the authenticated user
31
- #
32
- # = Examples
33
- # @github = Github.new :oauth_token => '...'
34
- # @github.repos.watched
35
- #
36
- def watched(*args)
37
- params = args.last.is_a?(Hash) ? args.pop : {}
38
- _normalize_params_keys(params)
39
- _merge_user_into_params!(params) unless params.has_key?('user')
23
+ # List repos being watched by a user
24
+ #
25
+ # = Examples
26
+ # github = Github.new
27
+ # github.repos.watching.watched :user => 'user-name'
28
+ #
29
+ # List repos being watched by the authenticated user
30
+ #
31
+ # = Examples
32
+ # github = Github.new :oauth_token => '...'
33
+ # github.repos.watching.watched
34
+ #
35
+ def watched(*args)
36
+ params = args.last.is_a?(Hash) ? args.pop : {}
37
+ _normalize_params_keys(params)
38
+ _merge_user_into_params!(params) unless params.has_key?('user')
40
39
 
41
- response = if (user_name = params.delete('user'))
42
- get("/users/#{user_name}/watched", params)
43
- else
44
- get("/user/watched", params)
45
- end
46
- return response unless block_given?
47
- response.each { |el| yield el }
40
+ response = if (user_name = params.delete('user'))
41
+ get_request("/users/#{user_name}/watched", params)
42
+ else
43
+ get_request("/user/watched", params)
48
44
  end
45
+ return response unless block_given?
46
+ response.each { |el| yield el }
47
+ end
49
48
 
50
- # Check if you are watching a repository
51
- #
52
- # Returns <tt>true</tt> if this repo is watched by you, <tt>false</tt> otherwise
53
- # = Examples
54
- # @github = Github.new
55
- # @github.repos.watching? 'user-name', 'repo-name'
56
- #
57
- def watching?(user_name, repo_name, params={})
58
- _validate_presence_of user_name, repo_name
59
- _normalize_params_keys(params)
60
- get("/user/watched/#{user_name}/#{repo_name}", params)
61
- true
62
- rescue Github::Error::NotFound
63
- false
64
- end
49
+ # Check if you are watching a repository
50
+ #
51
+ # Returns <tt>true</tt> if this repo is watched by you, <tt>false</tt> otherwise
52
+ # = Examples
53
+ # github = Github.new
54
+ # github.repos.watching.watching? 'user-name', 'repo-name'
55
+ #
56
+ def watching?(user_name, repo_name, params={})
57
+ _validate_presence_of user_name, repo_name
58
+ _normalize_params_keys(params)
59
+ get_request("/user/watched/#{user_name}/#{repo_name}", params)
60
+ true
61
+ rescue Github::Error::NotFound
62
+ false
63
+ end
65
64
 
66
- # Watch a repository
67
- #
68
- # You need to be authenticated to watch a repository
69
- #
70
- # = Examples
71
- # @github = Github.new
72
- # @github.repos.start_watching 'user-name', 'repo-name'
73
- #
74
- def start_watching(user_name, repo_name, params={})
75
- _validate_presence_of user_name, repo_name
76
- _normalize_params_keys(params)
77
- put("/user/watched/#{user_name}/#{repo_name}", params)
78
- end
65
+ # Watch a repository
66
+ #
67
+ # You need to be authenticated to watch a repository
68
+ #
69
+ # = Examples
70
+ # github = Github.new
71
+ # github.repos.watching.start_watching 'user-name', 'repo-name'
72
+ #
73
+ def start_watching(user_name, repo_name, params={})
74
+ _validate_presence_of user_name, repo_name
75
+ _normalize_params_keys(params)
76
+ put_request("/user/watched/#{user_name}/#{repo_name}", params)
77
+ end
79
78
 
80
- # Stop watching a repository
81
- #
82
- # You need to be authenticated to stop watching a repository.
83
- # = Examples
84
- # @github = Github.new
85
- # @github.repos.start_watching 'user-name', 'repo-name'
86
- #
87
- def stop_watching(user_name, repo_name, params={})
88
- _validate_presence_of user_name, repo_name
89
- _normalize_params_keys(params)
90
- delete("/user/watched/#{user_name}/#{repo_name}", params)
91
- end
79
+ # Stop watching a repository
80
+ #
81
+ # You need to be authenticated to stop watching a repository.
82
+ # = Examples
83
+ # github = Github.new
84
+ # github.repos.watching.start_watching 'user-name', 'repo-name'
85
+ #
86
+ def stop_watching(user_name, repo_name, params={})
87
+ _validate_presence_of user_name, repo_name
88
+ _normalize_params_keys(params)
89
+ delete_request("/user/watched/#{user_name}/#{repo_name}", params)
90
+ end
92
91
 
93
- end # Watching
94
- end # Repos
92
+ end # Repos::Watching
95
93
  end # Github
@@ -11,27 +11,23 @@ module Github
11
11
  METHODS = [:get, :post, :put, :delete, :patch]
12
12
  METHODS_WITH_BODIES = [ :post, :put, :patch ]
13
13
 
14
- TOKEN_REQUIRED_REGEXP = [
15
- /repos\/.*\/.*\/comments/,
16
- ]
17
-
18
- def get(path, params={}, options={})
14
+ def get_request(path, params={}, options={})
19
15
  request(:get, path, params, options)
20
16
  end
21
17
 
22
- def patch(path, params={}, options={})
18
+ def patch_request(path, params={}, options={})
23
19
  request(:patch, path, params, options)
24
20
  end
25
21
 
26
- def post(path, params={}, options={})
22
+ def post_request(path, params={}, options={})
27
23
  request(:post, path, params, options)
28
24
  end
29
25
 
30
- def put(path, params={}, options={})
26
+ def put_request(path, params={}, options={})
31
27
  request(:put, path, params, options)
32
28
  end
33
29
 
34
- def delete(path, params={}, options={})
30
+ def delete_request(path, params={}, options={})
35
31
  request(:delete, path, params, options)
36
32
  end
37
33
 
@@ -10,10 +10,6 @@ module Github
10
10
  :Followers => 'followers',
11
11
  :Keys => 'keys'
12
12
 
13
- include Github::Users::Emails
14
- include Github::Users::Followers
15
- include Github::Users::Keys
16
-
17
13
  VALID_USER_PARAMS_NAMES = %w[
18
14
  name
19
15
  email
@@ -29,27 +25,42 @@ module Github
29
25
  super(options)
30
26
  end
31
27
 
28
+ # Access to Users::Emails API
29
+ def emails
30
+ @emails ||= ApiFactory.new 'Users::Emails'
31
+ end
32
+
33
+ # Access to Users::Followers API
34
+ def followers
35
+ @followers ||= ApiFactory.new 'Users::Followers'
36
+ end
37
+
38
+ # Access to Users::Keys API
39
+ def keys
40
+ @keys ||= ApiFactory.new 'Users::Keys'
41
+ end
42
+
32
43
  # Get a single unauthenticated user
33
44
  #
34
45
  # = Examples
35
- # @github = Github.new
36
- # @github.users.get_user 'user-name'
46
+ # github = Github.new
47
+ # github.users.get 'user-name'
37
48
  #
38
49
  # Get the authenticated user
39
50
  #
40
51
  # = Examples
41
52
  # @github = Github.new :oauth_token => '...'
42
- # @github.users.get_user
53
+ # @github.users.get
43
54
  #
44
- def get_user(user_name=nil, params={})
55
+ def get(user_name=nil, params={})
45
56
  _normalize_params_keys(params)
46
57
  if user_name
47
- get("/users/#{user_name}", params)
58
+ get_request("/users/#{user_name}", params)
48
59
  else
49
- get("/user", params)
60
+ get_request("/user", params)
50
61
  end
51
62
  end
52
- alias :get_auth_user :get_user
63
+ alias :find :get
53
64
 
54
65
  # Update the authenticated user
55
66
  #
@@ -63,8 +74,8 @@ module Github
63
74
  # * <tt>:bio</tt> - Optional string
64
75
  #
65
76
  # = Examples
66
- # @github = Github.new :oauth_token => '..'
67
- # @github.users.update_user
77
+ # github = Github.new :oauth_token => '..'
78
+ # github.users.update
68
79
  # "name" => "monalisa octocat",
69
80
  # "email" => "octocat@github.com",
70
81
  # "blog" => "https://github.com/blog",
@@ -73,12 +84,11 @@ module Github
73
84
  # "hireable" => true,
74
85
  # "bio" => "There once..."
75
86
  #
76
- def update_user(params={})
87
+ def update(params={})
77
88
  _normalize_params_keys(params)
78
89
  _filter_params_keys(VALID_USER_PARAMS_NAMES, params)
79
- patch("/user", params)
90
+ patch_request("/user", params)
80
91
  end
81
- alias :update_authenticated_user :update_user
82
92
 
83
93
  end # Users
84
94
  end # Github