breathe 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/breathe/client.rb +5 -2
- data/lib/breathe/response.rb +1 -6
- data/lib/breathe/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: ff2837bf3695cdf7014639abd4e60f70dca9f6832167e1c0846a08416c446212
|
4
|
+
data.tar.gz: 468036efeb1ef793a94c1568f92c0abda53a4a82e1b9ca16318a728396820c3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 339a9998eea5fdbce58e178ac1ec545a966da3593b8a44ff89ad77091f446a22b42fd85c72918cfa5233307c57c31639c1e7b6a66fce4d2b8c301bfd14221a2b
|
7
|
+
data.tar.gz: 93f1d9a8582071ae1f78471bbcd62c0f0d6a5c59bcf3fad2e9fa84adde101286cb7f33159397645b80f08ab470b0b693d740dedc80fbf35d717efb4201f6a89d
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
The format is based on [Keep a Changelog]
|
6
6
|
|
7
|
+
[0.3.1]
|
8
|
+
|
9
|
+
- Fix bug with auto pagination
|
10
|
+
|
7
11
|
[0.3.0]
|
8
12
|
|
9
13
|
- Allow listing of sicknesses
|
@@ -26,6 +30,7 @@ The format is based on [Keep a Changelog]
|
|
26
30
|
|
27
31
|
- Allow listing of absences
|
28
32
|
|
33
|
+
[0.3.1]: https://github.com/dxw/breathe_ruby/releases/tag/0.3.1
|
29
34
|
[0.3.0]: https://github.com/dxw/breathe_ruby/releases/tag/0.3.0
|
30
35
|
[0.2.0]: https://github.com/dxw/breathe_ruby/releases/tag/0.2.0
|
31
36
|
[0.1.2]: https://github.com/dxw/breathe_ruby/releases/tag/0.1.2
|
data/lib/breathe/client.rb
CHANGED
@@ -45,13 +45,16 @@ module Breathe
|
|
45
45
|
private
|
46
46
|
|
47
47
|
def auto_paginated_response(parsed_response)
|
48
|
+
pages = parsed_response
|
49
|
+
|
48
50
|
while (next_page = parsed_response.next_page)
|
49
51
|
break if next_page.nil?
|
50
52
|
|
51
|
-
|
53
|
+
pages.concat(next_page.body)
|
54
|
+
parsed_response = next_page
|
52
55
|
end
|
53
56
|
|
54
|
-
|
57
|
+
pages
|
55
58
|
end
|
56
59
|
end
|
57
60
|
end
|
data/lib/breathe/response.rb
CHANGED
@@ -3,18 +3,13 @@ module Breathe
|
|
3
3
|
extend Forwardable
|
4
4
|
attr_reader :response, :type
|
5
5
|
|
6
|
-
delegate [:each, :find, :select, :count, :[]] => :body
|
6
|
+
delegate [:each, :find, :select, :count, :[], :concat] => :body
|
7
7
|
|
8
8
|
def initialize(response:, type:)
|
9
9
|
@response = response
|
10
10
|
@type = type
|
11
11
|
end
|
12
12
|
|
13
|
-
def concat(response)
|
14
|
-
@response = response.response
|
15
|
-
body.concat(response.body)
|
16
|
-
end
|
17
|
-
|
18
13
|
def body
|
19
14
|
@body ||= response.data[type]
|
20
15
|
end
|
data/lib/breathe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breathe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stuart Harrison
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|