trav3 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/trav3.rb +2 -4
- data/lib/trav3/response/response_collection.rb +10 -0
- data/lib/trav3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4855acd03319dc3b7e1295f7ee184b98ffcc79dfe230e17704ea145d4b9c5a72
|
4
|
+
data.tar.gz: 7256ae70f65c3172235edd97b5009a62751e2a8048a36d275bd8c9d7e3bcf44e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c03fe5e63adb1e6d87c3d0aff5f43e3b9dd1d17ca5720c1d66e397b733ec55cf3debbc85a1773237f3a35a43ce05286f8fcf12b9f34a2ad23c0b5b82cc407f4
|
7
|
+
data.tar.gz: 4452d8674a90f0ad08b2c5efdd7eddc83c486742934a6675f7b67488145049c1723668307d1c0064471ff0bc4a56532a18cd8a75b9e474c63230a671d002e354
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[](http://badge.fury.io/rb/trav3)
|
2
2
|
[](https://travis-ci.org/danielpclark/trav3)
|
3
|
-
[](https://github.com/danielpclark/trav3/graphs/commit-activity)
|
4
4
|
[](https://codeclimate.com/github/danielpclark/trav3/maintainability)
|
5
5
|
[](https://codeclimate.com/github/danielpclark/trav3/test_coverage)
|
6
6
|
[](http://danielpclark.github.io/trav3/Trav3/Travis.html)
|
@@ -157,6 +157,7 @@ The keys for the response are displayed with `#inspect` along with the object.
|
|
157
157
|
* `#follow`
|
158
158
|
* `#hash?`
|
159
159
|
* `#last`
|
160
|
+
* `#warnings`
|
160
161
|
|
161
162
|
Which each behave as they would on the collection type per collection type, `Hash` or `Array`, with the exception of `#each`. `#each` will wrap every item in an `Array` with another `ResponseCollection`, but if it's a `Hash` then `#each` simply works as it normally would on a `Hash`
|
162
163
|
|
data/lib/trav3.rb
CHANGED
@@ -727,11 +727,8 @@ module Trav3
|
|
727
727
|
# Query Parameter Type Description
|
728
728
|
# include [String] List of attributes to eager load.
|
729
729
|
# limit Integer How many builds to include in the response. Used for pagination.
|
730
|
-
# limit Integer How many builds to include in the response. Used for pagination.
|
731
|
-
# offset Integer How many builds to skip before the first entry in the response. Used for pagination.
|
732
730
|
# offset Integer How many builds to skip before the first entry in the response. Used for pagination.
|
733
731
|
# sort_by [String] Attributes to sort builds by. Used for pagination.
|
734
|
-
# sort_by [String] Attributes to sort builds by. Used for pagination.
|
735
732
|
#
|
736
733
|
# Example: GET /builds?limit=5
|
737
734
|
#
|
@@ -3685,9 +3682,10 @@ module Trav3
|
|
3685
3682
|
get("#{without_repo}#{url}")
|
3686
3683
|
end
|
3687
3684
|
|
3688
|
-
def get_path_with_opts(url)
|
3685
|
+
def get_path_with_opts(url, without_limit = true)
|
3689
3686
|
url, opt = url.match(/^(.+)\?(.*)$/)&.captures || url
|
3690
3687
|
opts.immutable do |o|
|
3688
|
+
o.remove(:limit) if without_limit
|
3691
3689
|
o.send(:update, opt)
|
3692
3690
|
get_path("#{url}#{opts}")
|
3693
3691
|
end
|
@@ -142,6 +142,16 @@ module Trav3
|
|
142
142
|
self[-1]
|
143
143
|
end
|
144
144
|
|
145
|
+
# If `@warnings` was returned with the response this will return
|
146
|
+
# a `ResponseCollection` instance of them. Otherwise this returns `nil`.
|
147
|
+
#
|
148
|
+
# @return [ResponseCollection, nil]
|
149
|
+
def warnings
|
150
|
+
return nil unless hash?
|
151
|
+
|
152
|
+
self['@warnings']
|
153
|
+
end
|
154
|
+
|
145
155
|
private
|
146
156
|
|
147
157
|
def collection?(input)
|
data/lib/trav3/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trav3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel P. Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|