subordinate 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,23 @@
1
+ # Queue
2
+ module Subordinate
3
+ class Client
4
+ # Queue management and configuration
5
+ #
6
+ # @see https://ci.jenkins-ci.org/job/jenkins_rc_branch/api/
7
+ module Queue
8
+ # Returns the current build queue for the system
9
+ #
10
+ # @see http://jenkins.missioncontrol.io:8080/queue/api/
11
+ #
12
+ # @return [Hashie::Mash] job response
13
+ #
14
+ # @example Get the current build queue
15
+ # Subordinate::Client.build_queue
16
+ #
17
+ # @author Jason Truluck
18
+ def build_queue(options = {})
19
+ get("queue/api/json", options)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -6,6 +6,7 @@ require "subordinate/request"
6
6
  require "subordinate/client/job"
7
7
  require "subordinate/client/system"
8
8
  require "subordinate/client/build"
9
+ require "subordinate/client/queue"
9
10
 
10
11
  module Subordinate
11
12
  class Client
@@ -42,5 +43,6 @@ module Subordinate
42
43
  include Subordinate::Client::Job
43
44
  include Subordinate::Client::System
44
45
  include Subordinate::Client::Build
46
+ include Subordinate::Client::Queue
45
47
  end
46
48
  end
@@ -1,3 +1,3 @@
1
1
  module Subordinate
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,31 @@
1
+ require "spec_helper"
2
+
3
+ auth = authentications = 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 "#build_queue", :vcr do
19
+ let(:current_response) { subordinate.build_queue }
20
+
21
+ it "returns the job response" do
22
+ current_response.should_not be_nil
23
+ end
24
+
25
+ context "methods" do
26
+ it "responds to .items" do
27
+ current_response.should respond_to(:items)
28
+ end
29
+ end
30
+ end
31
+ 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.0.1
4
+ version: 0.1.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-26 00:00:00.000000000 Z
12
+ date: 2013-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -220,6 +220,7 @@ files:
220
220
  - lib/subordinate/client.rb
221
221
  - lib/subordinate/client/build.rb
222
222
  - lib/subordinate/client/job.rb
223
+ - lib/subordinate/client/queue.rb
223
224
  - lib/subordinate/client/system.rb
224
225
  - lib/subordinate/configuration.rb
225
226
  - lib/subordinate/connection.rb
@@ -229,6 +230,7 @@ files:
229
230
  - spec/spec_helper.rb
230
231
  - spec/subordinate/client/build_spec.rb
231
232
  - spec/subordinate/client/job_spec.rb
233
+ - spec/subordinate/client/queue_spec.rb
232
234
  - spec/subordinate/client/system_spec.rb
233
235
  - spec/subordinate/client_spec.rb
234
236
  - subordinate.gemspec
@@ -246,7 +248,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
246
248
  version: '0'
247
249
  segments:
248
250
  - 0
249
- hash: -3781609330606615692
251
+ hash: -2081698732068073333
250
252
  required_rubygems_version: !ruby/object:Gem::Requirement
251
253
  none: false
252
254
  requirements:
@@ -255,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
257
  version: '0'
256
258
  segments:
257
259
  - 0
258
- hash: -3781609330606615692
260
+ hash: -2081698732068073333
259
261
  requirements: []
260
262
  rubyforge_project:
261
263
  rubygems_version: 1.8.24
@@ -267,6 +269,7 @@ test_files:
267
269
  - spec/spec_helper.rb
268
270
  - spec/subordinate/client/build_spec.rb
269
271
  - spec/subordinate/client/job_spec.rb
272
+ - spec/subordinate/client/queue_spec.rb
270
273
  - spec/subordinate/client/system_spec.rb
271
274
  - spec/subordinate/client_spec.rb
272
275
  has_rdoc: