Skip to content

Commit dd9ad10

Browse files
committed
Change users to client namespace.
1 parent 6f44bbf commit dd9ad10

27 files changed

Lines changed: 34 additions & 38 deletions

features/github_api.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Feature: Github API components
4747
Scenario: Accessing users API
4848
Given I have github instance
4949
When I fetch "users"
50-
Then I will have access to "Github::Users" API
50+
Then I will have access to "Github::Client::Users" API
5151

5252
Scenario: Accessing activity API
5353
Given I have github instance

features/users.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Feature: Users API
22

33
Background:
4-
Given I have "Github::Users" instance
4+
Given I have "Github::Client::Users" instance
55

66
Scenario: List all users
77

features/users/emails.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Feature: Accessing Users Emails API
55
Should return the expected results depending on passed parameters
66

77
Background:
8-
Given I have "Github::Users::Emails" instance
8+
Given I have "Github::Client::Users::Emails" instance
99

1010
Scenario: Lists all emails for the authenticated user
1111

features/users/keys.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Feature: Accessing Users Keys API
55
Should return the expected results depending on passed parameters
66

77
Background:
8-
Given I have "Github::Users::Keys" instance
8+
Given I have "Github::Client::Users::Keys" instance
99

1010
Scenario: Lists all public keys for a user
1111

lib/github_api/client.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ class Client < API
1313
'issues',
1414
'markdown',
1515
'meta',
16-
'orgs'
16+
'orgs',
17+
'users'
1718

1819
require_all 'github_api',
1920
'pull_requests',
2021
'repos',
2122
'say',
2223
'scopes',
23-
'search',
24-
'users'
24+
'search'
2525

2626
# Serving up the ‘social’ in Social Coding™, the Activity APIs
2727
# provide access to notifications, subscriptions, and timelines.
@@ -68,8 +68,6 @@ class Client < API
6868

6969
# Many of the resources on the users API provide a shortcut for getting
7070
# information about the currently authenticated user.
71-
#
72-
namespace :users, root: true
73-
71+
namespace :users
7472
end # Client
7573
end # Github
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# encoding: utf-8
22

33
module Github
4-
class Users < API
5-
4+
class Client::Users < API
65
# Load all the modules after initializing Repos to avoid superclass mismatch
7-
require_all 'github_api/users',
6+
require_all 'github_api/client/users',
87
'emails',
98
'followers',
109
'keys'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'cgi'
33

44
module Github
5-
class Users::Emails < API
5+
class Client::Users::Emails < API
66

77
# List email addresses for the authenticated user
88
#
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# encoding: utf-8
22

33
module Github
4-
class Users::Followers < API
4+
class Client::Users::Followers < API
55

66
# List a user's followers
77
#
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# encoding: utf-8
22

33
module Github
4-
class Users::Keys < API
4+
class Client::Users::Keys < API
55

66
VALID_KEY_PARAM_NAMES = %w[ title key ].freeze
77

spec/github/users/emails/add_spec.rb renamed to spec/github/client/users/emails/add_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'spec_helper'
44

5-
describe Github::Users::Emails, '#add' do
5+
describe Github::Client::Users::Emails, '#add' do
66
let(:email) { "[email protected]" }
77
let(:request_path) { "/user/emails" }
88

0 commit comments

Comments
 (0)