Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BowenMa
committed
Aug 31, 2011
1 parent
eab793a
commit 97f4ef2
Showing
4 changed files
with
32 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
require 'mechanize' | ||
require 'libxml' | ||
Dir[File.dirname(__FILE__) + '/jenkins-remote-api/*.rb'].each {|file| require file } | ||
Dir[File.dirname(__FILE__) + '/jenkins-remote-api/ci/*.rb'].each {|file| require file } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module Ci | ||
class Jenkins | ||
include LibXML | ||
|
||
def self.set_ci_addr(url) | ||
@@ci_addr = url.end_with?("/") ? url : url + "/" | ||
end | ||
|
||
def self.ci_addr | ||
@@ci_addr | ||
end | ||
|
||
def self.list_all_job_names | ||
xml = "" | ||
Mechanize.new.get(ci_addr + "api/xml") do |page| | ||
xml = page.body | ||
end | ||
parser = LibXML::XML::Parser.string(xml) | ||
doc = parser.parse | ||
doc.find('//job').collect{|job| job.find_first('name').content } | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters