Skip to content

Commit 6f44bbf

Browse files
committed
Change org to client namespace.
1 parent 86b8d7f commit 6f44bbf

33 files changed

Lines changed: 49 additions & 56 deletions

features/arguments_parsing.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Feature: Github API arguments parsing
66

77
Scenario: Invoking multiple calls for organization information
88

9-
Given I have "Github::Orgs" instance
9+
Given I have "Github::Client::Orgs" instance
1010
When I want to get resource with the following arguments:
1111
| org |
1212
| thoughtbot |

features/github_api.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ Feature: Github API components
1212
Scenario: Accessing organizations API
1313
Given I have github instance
1414
When I fetch "orgs"
15-
Then I will have access to "Github::Orgs" API
15+
Then I will have access to "Github::Client::Orgs" API
1616

1717
Scenario: Accessing members API
18-
Given I have "Github::Orgs" instance
18+
Given I have "Github::Client::Orgs" instance
1919
When I call members
20-
Then I will have access to "Github::Orgs::Members" API
20+
Then I will have access to "Github::Client::Orgs::Members" API
2121

2222
Scenario: Accessing teams API
23-
Given I have "Github::Orgs" instance
23+
Given I have "Github::Client::Orgs" instance
2424
When I call teams
25-
Then I will have access to "Github::Orgs::Teams" API
25+
Then I will have access to "Github::Client::Orgs::Teams" API
2626

2727
Scenario: Accessing gists API
2828
Given I have github instance

features/orgs.feature

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

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

66
Scenario: List for the user
77

features/orgs/members.feature

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

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

66
Scenario: List
77

lib/github_api/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class Client < API
1212
'git_data',
1313
'issues',
1414
'markdown',
15-
'meta'
15+
'meta',
16+
'orgs'
1617

1718
require_all 'github_api',
18-
'orgs',
1919
'pull_requests',
2020
'repos',
2121
'say',
@@ -51,7 +51,7 @@ class Client < API
5151
namespace :oauth, full_name: :authorizations
5252
alias :authorizations :oauth
5353

54-
namespace :orgs, root: true
54+
namespace :orgs
5555
alias :organizations :orgs
5656

5757
namespace :pull_requests, root: true
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# encoding: utf-8
22

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

6-
require_all 'github_api/orgs',
6+
require_all 'github_api/client/orgs',
77
'members',
88
'teams'
99

@@ -15,10 +15,10 @@ class Orgs < API
1515
name
1616
].freeze
1717

18-
# Access to Orgs::Members API
18+
# Access to Client::Orgs::Members API
1919
namespace :members
2020

21-
# Access to Orgs::Teams API
21+
# Access to Client::Orgs::Teams API
2222
namespace :teams
2323

2424
# List all public organizations for a user.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# encoding: utf-8
22

33
module Github
4-
class Orgs::Members < API
4+
class Client::Orgs::Members < API
55

66
# List members
77
#
@@ -103,6 +103,5 @@ def conceal(*args)
103103
delete_request("/orgs/#{org_name}/public_members/#{user}", arguments.params)
104104
end
105105
alias :conceal_membership :conceal
106-
107-
end # Orgs::Members
106+
end # Client::Orgs::Members
108107
end # Github
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# encoding: utf-8
22

33
module Github
4-
class Orgs::Teams < API
4+
class Client::Orgs::Teams < API
55
# All actions against teams require at a minimum an authenticated user
66
# who is a member of the owner’s team in the :org being managed.
77
# Api calls that require explicit permissions are noted.
@@ -238,6 +238,5 @@ def remove_repo(*args)
238238
delete_request("/teams/#{team_id}/repos/#{user}/#{repo}", arguments.params)
239239
end
240240
alias :remove_repository :remove_repo
241-
242-
end # Orgs::Teams
241+
end # Client::Orgs::Teams
243242
end # Github
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'spec_helper'
44

5-
describe Github::Orgs, '#edit' do
5+
describe Github::Client::Orgs, '#edit' do
66
let(:org) { 'github' }
77
let(:request_path) { "/orgs/#{org}" }
88
let(:body) { fixture("orgs/org.json") }
@@ -50,5 +50,4 @@
5050
it_should_behave_like 'request failure' do
5151
let(:requestable) { subject.edit org }
5252
end
53-
5453
end # edit
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'spec_helper'
44

5-
describe Github::Orgs, '#get' do
5+
describe Github::Client::Orgs, '#get' do
66
let(:org) { 'github' }
77
let(:request_path) { "/orgs/#{org}" }
88
let(:body) { fixture('orgs/org.json') }
@@ -40,5 +40,4 @@
4040
it_should_behave_like 'request failure' do
4141
let(:requestable) { subject.get org }
4242
end
43-
4443
end # get

0 commit comments

Comments
 (0)