subordinate 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/README.md +12 -0
- data/lib/subordinate/client/people.rb +23 -0
- data/lib/subordinate/client/queue.rb +1 -1
- data/lib/subordinate/client.rb +2 -0
- data/lib/subordinate/version.rb +1 -1
- data/spec/subordinate/client/people_spec.rb +66 -0
- metadata +7 -4
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -71,6 +71,18 @@ Currently can retrieve information, console output, and timestamps
|
|
71
71
|
client.build("Job-Name", 1)
|
72
72
|
```
|
73
73
|
|
74
|
+
### [Views](http://rdoc.info/github/jasontruluck/subordinate/master/Subordinate/Client/View)
|
75
|
+
|
76
|
+
Currently can retrieve all views, information about a single view, add jobs to a view, and remove jobs from a view
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
client.all_views
|
80
|
+
```
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
client.view("My-Awesome-View-Name")
|
84
|
+
```
|
85
|
+
|
74
86
|
###[System](http://rdoc.info/github/jasontruluck/subordinate/Subordinate/Client/System)
|
75
87
|
|
76
88
|
Currently can safe restart, restart, and quiet down
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# People
|
2
|
+
module Subordinate
|
3
|
+
class Client
|
4
|
+
# View Users on the Jenkins server
|
5
|
+
#
|
6
|
+
# @see https://ci.jenkins-ci.org/asynchPeople/api/json?pretty=true
|
7
|
+
module People
|
8
|
+
# Returns the users on the Jenkins server
|
9
|
+
#
|
10
|
+
# @see http://ci.jenkins-ci.org/asynchPeople/api/json?pretty=true
|
11
|
+
#
|
12
|
+
# @return [Hashie::Mash] users on the Jenkins server
|
13
|
+
#
|
14
|
+
# @example Get the users on the Jenkins server
|
15
|
+
# Subordinate::Client.people
|
16
|
+
#
|
17
|
+
# @author Jason Truluck
|
18
|
+
def people(options = {})
|
19
|
+
get("asynchPeople/api/json", options)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/subordinate/client.rb
CHANGED
@@ -8,6 +8,7 @@ require "subordinate/client/system"
|
|
8
8
|
require "subordinate/client/build"
|
9
9
|
require "subordinate/client/queue"
|
10
10
|
require "subordinate/client/load"
|
11
|
+
require "subordinate/client/people"
|
11
12
|
require "subordinate/client/view"
|
12
13
|
|
13
14
|
module Subordinate
|
@@ -46,6 +47,7 @@ module Subordinate
|
|
46
47
|
include Subordinate::Client::Build
|
47
48
|
include Subordinate::Client::Queue
|
48
49
|
include Subordinate::Client::Load
|
50
|
+
include Subordinate::Client::People
|
49
51
|
include Subordinate::Client::View
|
50
52
|
end
|
51
53
|
end
|
data/lib/subordinate/version.rb
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
auth = YAML::load(File.open(File.expand_path("../../../fixtures/authentications.yml", __FILE__)))
|
4
|
+
|
5
|
+
# Queue Spec
|
6
|
+
describe Subordinate::Client do
|
7
|
+
before do
|
8
|
+
Subordinate.reset!
|
9
|
+
Subordinate.configure do |c|
|
10
|
+
c.subdomain = auth["subdomain"]
|
11
|
+
c.domain = auth["domain"]
|
12
|
+
c.port = auth["port"]
|
13
|
+
c.ssl = false
|
14
|
+
end
|
15
|
+
end
|
16
|
+
let(:subordinate) { Subordinate::Client.new(:username => auth["username"], :api_token => auth["token"]) }
|
17
|
+
|
18
|
+
describe "#people", :vcr do
|
19
|
+
let(:current_response) { subordinate.people }
|
20
|
+
|
21
|
+
it "returns the users response" do
|
22
|
+
current_response.should_not be_nil
|
23
|
+
end
|
24
|
+
|
25
|
+
context "methods" do
|
26
|
+
|
27
|
+
it "responds to .users" do
|
28
|
+
current_response.should respond_to(:users)
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "within .users" do
|
32
|
+
it "responds to .lastChange" do
|
33
|
+
current_response.users.first.should respond_to(:lastChange)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "responds to .project" do
|
37
|
+
current_response.users.first.should respond_to(:project)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "responds to .user" do
|
41
|
+
current_response.users.first.should respond_to(:user)
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "within .project" do
|
45
|
+
it "responds to .name" do
|
46
|
+
current_response.users.first.project.should respond_to(:name)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "responds to .url" do
|
50
|
+
current_response.users.first.project.should respond_to(:url)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "within .user" do
|
55
|
+
it "responds to .absoluteUrl" do
|
56
|
+
current_response.users.first.user.should respond_to(:absoluteUrl)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "responds to .fullName" do
|
60
|
+
current_response.users.first.user.should respond_to(:fullName)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subordinate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- lib/subordinate/client/build.rb
|
238
238
|
- lib/subordinate/client/job.rb
|
239
239
|
- lib/subordinate/client/load.rb
|
240
|
+
- lib/subordinate/client/people.rb
|
240
241
|
- lib/subordinate/client/queue.rb
|
241
242
|
- lib/subordinate/client/system.rb
|
242
243
|
- lib/subordinate/client/view.rb
|
@@ -249,6 +250,7 @@ files:
|
|
249
250
|
- spec/subordinate/client/build_spec.rb
|
250
251
|
- spec/subordinate/client/job_spec.rb
|
251
252
|
- spec/subordinate/client/load_spec.rb
|
253
|
+
- spec/subordinate/client/people_spec.rb
|
252
254
|
- spec/subordinate/client/queue_spec.rb
|
253
255
|
- spec/subordinate/client/system_spec.rb
|
254
256
|
- spec/subordinate/client/view_spec.rb
|
@@ -268,7 +270,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
268
270
|
version: '0'
|
269
271
|
segments:
|
270
272
|
- 0
|
271
|
-
hash:
|
273
|
+
hash: -3998792838865044570
|
272
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
273
275
|
none: false
|
274
276
|
requirements:
|
@@ -277,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
277
279
|
version: '0'
|
278
280
|
segments:
|
279
281
|
- 0
|
280
|
-
hash:
|
282
|
+
hash: -3998792838865044570
|
281
283
|
requirements: []
|
282
284
|
rubyforge_project:
|
283
285
|
rubygems_version: 1.8.24
|
@@ -290,6 +292,7 @@ test_files:
|
|
290
292
|
- spec/subordinate/client/build_spec.rb
|
291
293
|
- spec/subordinate/client/job_spec.rb
|
292
294
|
- spec/subordinate/client/load_spec.rb
|
295
|
+
- spec/subordinate/client/people_spec.rb
|
293
296
|
- spec/subordinate/client/queue_spec.rb
|
294
297
|
- spec/subordinate/client/system_spec.rb
|
295
298
|
- spec/subordinate/client/view_spec.rb
|