Skip to content

Commit

Permalink
Merge pull request #168 from bkon/master
Browse files Browse the repository at this point in the history
Added ability to pass "tree" parameter to the Job#get_buils call.
  • Loading branch information
arangamani committed Mar 5, 2015
2 parents ff6da75 + 6d60d87 commit eeb8ce3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/jenkins_api_client/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,12 @@ def get_downstream_projects(job_name)
#
# @param [String] job_name
#
def get_builds(job_name)
def get_builds(job_name, options = {})
@logger.info "Obtaining the build details of '#{job_name}'"
response_json = @client.api_get_request("/job/#{path_encode job_name}")
url = "/job/#{path_encode job_name}"

tree = options[:tree] || nil
response_json = @client.api_get_request url, tree_string(tree)
response_json["builds"]
end

Expand Down Expand Up @@ -1762,6 +1765,11 @@ def child_projects(params, xml)
}
}
end

def tree_string tree_value
return nil unless tree_value
"tree=#{tree_value}"
end
end
end
end

0 comments on commit eeb8ce3

Please sign in to comment.