Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to pass "tree" parameter to the Job#get_buils call. #168

Merged
merged 3 commits into from
Mar 5, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1741,6 +1744,11 @@ def child_projects(params, xml)
}
}
end

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