Class: AgileNotifier::Jenkins
- Extended by:
- ResponseHelper
- Defined in:
- lib/agile_notifier/jenkins.rb
Defined Under Namespace
Classes: Job
Constant Summary collapse
- JSON_API =
'/api/json'
Instance Attribute Summary
Attributes inherited from CI
Class Method Summary collapse
Instance Method Summary collapse
- #get_all_jobs ⇒ Object
-
#initialize(url, job_name, build_number = nil) ⇒ Jenkins
constructor
A new instance of Jenkins.
Methods included from ResponseHelper
Methods inherited from CI
#is_available?, #original_is_available?
Methods included from Servable
Constructor Details
#initialize(url, job_name, build_number = nil) ⇒ Jenkins
18 19 20 21 22 |
# File 'lib/agile_notifier/jenkins.rb', line 18 def initialize(url, job_name, build_number = nil) @url = url job_url = URI.encode("#{@url}/job/#{job_name}/") @job = Job.new(job_name, job_url, build_number) end |
Class Method Details
.get_value(key, url) ⇒ Object
14 15 16 |
# File 'lib/agile_notifier/jenkins.rb', line 14 def self.get_value(key, url) get_value_of_key(key, url.gsub(/\/$/, '') + JSON_API) end |
Instance Method Details
#get_all_jobs ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/agile_notifier/jenkins.rb', line 24 def get_all_jobs jobs = self.class.get_value('jobs', @url) if jobs.nil? return nil else jobs.inject([]) do |all_jobs, job| all_jobs.push(Job.new(job['name'], job['url'])) end end end |