Class: TCClient
- Inherits:
-
Object
- Object
- TCClient
- Defined in:
- lib/version.rb,
lib/tc-client.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
- #builds ⇒ Object
-
#initialize(project) ⇒ TCClient
constructor
A new instance of TCClient.
Constructor Details
#initialize(project) ⇒ TCClient
Returns a new instance of TCClient.
17 18 19 20 21 22 23 24 25 |
# File 'lib/tc-client.rb', line 17 def initialize(project) @count = 10 @project = projects[project] @base_url = config["base_url"] puts "last #{@count} (successful) builds for #{project} (#{@project})" @user = config["user"] @pwd = config["pwd"] end |
Instance Method Details
#builds ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/tc-client.rb', line 27 def builds xml = RestClient.get "http://#{@user}:#{@pwd}@#{@base_url}/httpAuth/app/rest/buildTypes/id:#{@project}/builds?status=SUCCESS&count=#{@count}" doc = REXML::Document.new xml builds = [] doc.elements.each("builds/build") do |build| builds << build.attributes["number"] end builds end |