Skip to content

Commit

Permalink
Merge pull request #63 from mtchavez/remove-organization-endpoint
Browse files Browse the repository at this point in the history
Remove /organization endpoint
  • Loading branch information
mtchavez committed Mar 13, 2016
2 parents da04fc2 + e8f314a commit 5315fb7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 247 deletions.
160 changes: 0 additions & 160 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ end
* [Tests](#tests)
* [Recent Builds](#recent_builds)
* [Get](#recent_builds_get)
* [Organization](#organization)

### [User](#user)

Expand Down Expand Up @@ -1026,165 +1025,6 @@ res.body
}, ... ]
```
### [organization](#organization)
Endpoint: `/organization/:name`
Recent builds for an entire organization
```ruby
res = CircleCi.organization 'my-org'
res.succes?
res.body
```
```javascript
[
{
"dont_build":null,
"committer_name":"Chavez",
"usage_queued_at":"2014-04-12T10:29:59.352Z",
"branch":"master",
"body":"Update Missing ''e'' in CircleCi in README.md",
"author_date":"2014-03-12T23:14:53Z",
"node":[
{
"username":"ubuntu",
"ssh_enabled":null,
"port":64721,
"public_ip_addr":"54.82.224.94"
}
],
"committer_date":"2014-03-12T23:14:53Z",
"compare":null,
"retries":null,
"parallel":1,
"committer_email":"[email protected]",
"build_time_millis":16308,
"why":"retry",
"author_email":"[email protected]",
"ssh_enabled":null,
"start_time":"2014-04-12T10:29:59.587Z",
"stop_time":"2014-04-12T10:30:15.895Z",
"lifecycle":"finished",
"user":{
"is_user":true,
"login":"hwartig",
"name":"Harald Wartig",
"email":"[email protected]"
},
"subject":"Merge pull request #4 from Alex-Poon/master",
"messages":[

],
"job_name":null,
"retry_of":1,
"previous_successful_build":{
"build_time_millis":37685,
"status":"success",
"build_num":1
},
"outcome":"success",
"status":"success",
"vcs_revision":"f33617404dc392ddd676fdde87cd5c87369e1857",
"build_num":2,
"username":"hwartigcom",
"vcs_url":"https://github.com/hwartigcom/circleci",
"timedout":false,
"previous":{
"build_time_millis":37685,
"status":"success",
"build_num":1
},
"canceled":false,
"infrastructure_fail":false,
"failed":null,
"reponame":"circleci",
"build_url":"https://circleci.com/gh/hwartigcom/circleci/2",
"feature_flags":{

},
"author_name":"Chavez",
"queued_at":"2014-04-12T10:29:59.517Z"
},
{
"dont_build":null,
"committer_name":"Chavez",
"usage_queued_at":"2014-04-08T06:58:09.522Z",
"branch":"master",
"body":"Update Missing ''e'' in CircleCi in README.md",
"author_date":"2014-03-12T23:14:53Z",
"node":[
{
"username":"ubuntu",
"ssh_enabled":null,
"port":64775,
"public_ip_addr":"54.198.9.232"
}
],
"committer_date":"2014-03-12T23:14:53Z",
"compare":null,
"retries":[
2
],
"parallel":1,
"committer_email":"[email protected]",
"build_time_millis":37685,
"why":"first-build",
"author_email":"[email protected]",
"ssh_enabled":null,
"start_time":"2014-04-08T06:58:09.868Z",
"stop_time":"2014-04-08T06:58:47.553Z",
"lifecycle":"finished",
"user":{
"is_user":true,
"login":"hwartig",
"name":"Harald Wartig",
"email":"[email protected]"
},
"subject":"Merge pull request #4 from Alex-Poon/master",
"messages":[

],
"job_name":null,
"retry_of":null,
"previous_successful_build":null,
"outcome":"success",
"status":"success",
"vcs_revision":"f33617404dc392ddd676fdde87cd5c87369e1857",
"build_num":1,
"username":"hwartigcom",
"vcs_url":"https://github.com/hwartigcom/circleci",
"timedout":false,
"previous":null,
"all_commit_details":[
{
"committer_name":"Chavez",
"body":"Update Missing ''e'' in CircleCi in README.md",
"author_date":"2014-03-12T23:14:53Z",
"committer_date":"2014-03-12T23:14:53Z",
"commit_url":"https://github.com/hwartigcom/circleci/commit/f33617404dc392ddd676fdde87cd5c87369e1857",
"committer_email":"[email protected]",
"author_email":"[email protected]",
"subject":"Merge pull request #4 from Alex-Poon/master",
"commit":"f33617404dc392ddd676fdde87cd5c87369e1857",
"author_name":"Chavez"
}
],
"canceled":false,
"infrastructure_fail":false,
"failed":null,
"reponame":"circleci",
"build_url":"https://circleci.com/gh/hwartigcom/circleci/1",
"feature_flags":{

},
"author_name":"Chavez",
"queued_at":"2014-04-08T06:58:09.739Z"
}
]
```
### Tests
Tests are ran using Rspec and VCR for API interaction recording.
Expand Down
14 changes: 0 additions & 14 deletions lib/circleci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,4 @@ def config
def http # @private
Http.new(config)
end

##
#
# Get recent builds for an organization
#
# @param name [String] Name of the organization. Currently CircleCi treats
# the name case sensetive so make sure the spelling is the same
# as the github organisation.
# @param params [Hash] Additional query params.
# @return [CircleCi::Response] - Response object.

def organization(name, params = {})
http.get "/organization/#{name}", params
end
end
57 changes: 0 additions & 57 deletions spec/cassettes/organization.yml

This file was deleted.

16 changes: 0 additions & 16 deletions spec/circleci_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,4 @@
CircleCi.config.token.should eql 'new-key'
end
end

describe 'organization', vcr: { cassette_name: 'organization', record: :none } do
subject { CircleCi.organization(ENV['ORGANIZATION'] || 'orga-name') }
let(:body) { subject.body }

it { should be_an_instance_of(CircleCi::Response) }
it { should be_success }

it 'returns a list of recent builds' do
expect(body).to be_an_instance_of(Array)
expect(body.size).to eq(2)
expect(body.first).to have_key('username')
expect(body.first).to have_key('reponame')
expect(body.first).to have_key('vcs_url')
end
end
end

0 comments on commit 5315fb7

Please sign in to comment.