subordinate 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,7 @@ require "subordinate/client/queue"
10
10
  require "subordinate/client/load"
11
11
  require "subordinate/client/people"
12
12
  require "subordinate/client/view"
13
+ require "subordinate/client/executor"
13
14
 
14
15
  module Subordinate
15
16
  class Client
@@ -49,5 +50,6 @@ module Subordinate
49
50
  include Subordinate::Client::Load
50
51
  include Subordinate::Client::People
51
52
  include Subordinate::Client::View
53
+ include Subordinate::Client::Executor
52
54
  end
53
55
  end
@@ -0,0 +1,23 @@
1
+ # Executor
2
+ module Subordinate
3
+ class Client
4
+ # Executor information
5
+ #
6
+ # @see https://ci.jenkins-ci.org/computer/api/
7
+ module Executor
8
+ # Returns the current build executor for the system
9
+ #
10
+ # @see http://ci.jenkins-ci.org/computer/api/json?pretty=true
11
+ #
12
+ # @return [Hashie::Mash] build executor response
13
+ #
14
+ # @example Get information about the build executor
15
+ # Subordinate::Client.build_executor
16
+ #
17
+ # @author Jason Truluck
18
+ def build_executor(options = {})
19
+ get("computer/api/json", options)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Subordinate
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -0,0 +1,107 @@
1
+ require "spec_helper"
2
+
3
+ # Build Executor Spec
4
+ describe Subordinate::Client do
5
+ before do
6
+ Subordinate.reset!
7
+ Subordinate.configure do |c|
8
+ c.subdomain = ENV["SUBDOMAIN"]
9
+ c.domain = ENV["DOMAIN"]
10
+ c.port = ENV["PORT"]
11
+ c.ssl = false
12
+ end
13
+ end
14
+ let(:subordinate) { Subordinate::Client.new(:username => ENV["USERNAME"], :api_token => ENV["TOKEN"]) }
15
+
16
+ describe "#build_executor", :vcr do
17
+ let(:current_response) { subordinate.build_executor }
18
+
19
+ it "returns the build_executor response" do
20
+ current_response.should_not be_nil
21
+ end
22
+
23
+ context "methods" do
24
+ it "responds to .busyExecutors" do
25
+ current_response.should respond_to(:busyExecutors)
26
+ end
27
+
28
+ it "responds to .computer" do
29
+ current_response.should respond_to(:computer)
30
+ end
31
+
32
+ it "responds to .displayName" do
33
+ current_response.should respond_to(:displayName)
34
+ end
35
+
36
+ it "responds to .totalExecutors" do
37
+ current_response.should respond_to(:totalExecutors)
38
+ end
39
+
40
+ describe "within .computer" do
41
+ it "responds to .actions" do
42
+ current_response.computer.first.should respond_to(:actions)
43
+ end
44
+
45
+ it "responds to .displayName" do
46
+ current_response.computer.first.should respond_to(:displayName)
47
+ end
48
+
49
+ it "responds to .executors" do
50
+ current_response.computer.first.should respond_to(:executors)
51
+ end
52
+
53
+ it "responds to .icon" do
54
+ current_response.computer.first.should respond_to(:icon)
55
+ end
56
+
57
+ it "responds to .idle" do
58
+ current_response.computer.first.should respond_to(:idle)
59
+ end
60
+
61
+ it "responds to .jnlpAgent" do
62
+ current_response.computer.first.should respond_to(:jnlpAgent)
63
+ end
64
+
65
+ it "responds to .launchSupported" do
66
+ current_response.computer.first.should respond_to(:launchSupported)
67
+ end
68
+
69
+ it "responds to .loadStatistics" do
70
+ current_response.computer.first.should respond_to(:loadStatistics)
71
+ end
72
+
73
+ it "responds to .manualLaunchAllowed" do
74
+ current_response.computer.first.should respond_to(:manualLaunchAllowed)
75
+ end
76
+
77
+ it "responds to .monitorData" do
78
+ current_response.computer.first.should respond_to(:monitorData)
79
+ end
80
+
81
+ it "responds to .numExecutors" do
82
+ current_response.computer.first.should respond_to(:numExecutors)
83
+ end
84
+
85
+ it "responds to .offline" do
86
+ current_response.computer.first.should respond_to(:offline)
87
+ end
88
+
89
+ it "responds to .offlineCause" do
90
+ current_response.computer.first.should respond_to(:offlineCause)
91
+ end
92
+
93
+ it "responds to .offlineCauseReason" do
94
+ current_response.computer.first.should respond_to(:offlineCauseReason)
95
+ end
96
+
97
+ it "responds to .oneOffExecutors" do
98
+ current_response.computer.first.should respond_to(:oneOffExecutors)
99
+ end
100
+
101
+ it "responds to .temporarilyOffline" do
102
+ current_response.computer.first.should respond_to(:temporarilyOffline)
103
+ end
104
+ end
105
+ end
106
+ end
107
+ 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.1
4
+ version: 0.5.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-29 00:00:00.000000000 Z
12
+ date: 2013-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -236,6 +236,7 @@ files:
236
236
  - lib/subordinate/authentication.rb
237
237
  - lib/subordinate/client.rb
238
238
  - lib/subordinate/client/build.rb
239
+ - lib/subordinate/client/executor.rb
239
240
  - lib/subordinate/client/job.rb
240
241
  - lib/subordinate/client/load.rb
241
242
  - lib/subordinate/client/people.rb
@@ -249,6 +250,7 @@ files:
249
250
  - spec/fixtures/authentications.yml.sample
250
251
  - spec/spec_helper.rb
251
252
  - spec/subordinate/client/build_spec.rb
253
+ - spec/subordinate/client/executor_spec.rb
252
254
  - spec/subordinate/client/job_spec.rb
253
255
  - spec/subordinate/client/load_spec.rb
254
256
  - spec/subordinate/client/people_spec.rb
@@ -271,7 +273,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
273
  version: '0'
272
274
  segments:
273
275
  - 0
274
- hash: 4562863513787901160
276
+ hash: 2873629329486478111
275
277
  required_rubygems_version: !ruby/object:Gem::Requirement
276
278
  none: false
277
279
  requirements:
@@ -280,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
282
  version: '0'
281
283
  segments:
282
284
  - 0
283
- hash: 4562863513787901160
285
+ hash: 2873629329486478111
284
286
  requirements: []
285
287
  rubyforge_project:
286
288
  rubygems_version: 1.8.24
@@ -291,6 +293,7 @@ test_files:
291
293
  - spec/fixtures/authentications.yml.sample
292
294
  - spec/spec_helper.rb
293
295
  - spec/subordinate/client/build_spec.rb
296
+ - spec/subordinate/client/executor_spec.rb
294
297
  - spec/subordinate/client/job_spec.rb
295
298
  - spec/subordinate/client/load_spec.rb
296
299
  - spec/subordinate/client/people_spec.rb