improved_jenkins_client 1.6.4 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/improved_jenkins_client/client.rb +11 -1
- data/lib/improved_jenkins_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d924687d191c069d05698fc954924efa40f1024ab280be5d7d13f434c20b680
|
4
|
+
data.tar.gz: 760ca0221281fec74064f4f151927ff765dc2f0024c155ed0bdf154f02346f9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f46f6c49204c1ac5562d2dad223eec0411e622404f0fe6db4824a792367809b1237b202db9d6951037d4271f4434adf8c90e13dcd0d742bf428c09fc4c70f6d
|
7
|
+
data.tar.gz: c54d3c43bc7ddc242bf63081f4bde37e7b3e9700f73badbcac2681e2dbbd89e95d21eb5192b80a46aca1ad833d5bd1875c02dc6bfa12920bde4877c7b4d3d81e
|
@@ -72,7 +72,8 @@ module JenkinsApi
|
|
72
72
|
"ca_file",
|
73
73
|
"follow_redirects",
|
74
74
|
"identity_file",
|
75
|
-
"cookies"
|
75
|
+
"cookies",
|
76
|
+
"pretty_json_responses"
|
76
77
|
].freeze
|
77
78
|
|
78
79
|
# Initialize a Client object with Jenkins CI server credentials
|
@@ -106,6 +107,7 @@ module JenkinsApi
|
|
106
107
|
# @option args [Fixnum] :log_level (Logger::INFO) The level for messages to be logged. Should be one of:
|
107
108
|
# Logger::DEBUG (0), Logger::INFO (1), Logger::WARN (2), Logger::ERROR (2), Logger::FATAL (3)
|
108
109
|
# @option args [String] :cookies Cookies to be sent with all requests in the format: name=value; name2=value2
|
110
|
+
# @option args [Boolean] :pretty_json_responses Whether to append pretty=true to most JSON GET requests.
|
109
111
|
#
|
110
112
|
# @return [JenkinsApi::Client] a client object to Jenkins API
|
111
113
|
#
|
@@ -415,10 +417,18 @@ module JenkinsApi
|
|
415
417
|
raw_response = false)
|
416
418
|
url_prefix = "#{@jenkins_path}#{url_prefix}"
|
417
419
|
to_get = ""
|
420
|
+
|
421
|
+
|
418
422
|
if tree
|
419
423
|
to_get = "#{url_prefix}#{url_suffix}?#{tree}"
|
424
|
+
query_param_separator = "&"
|
420
425
|
else
|
421
426
|
to_get = "#{url_prefix}#{url_suffix}"
|
427
|
+
query_param_separator = "?"
|
428
|
+
end
|
429
|
+
if @pretty_json_responses && url_suffix == "/api/json"
|
430
|
+
to_get += query_param_separator
|
431
|
+
to_get += "pretty=true"
|
422
432
|
end
|
423
433
|
request = Net::HTTP::Get.new(to_get)
|
424
434
|
@logger.debug "GET #{to_get}"
|