domoscio_rails 0.4.28 → 0.4.30

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a46f750a1045192193b8fbe7aed58125255031b3a43b1098fdb0b4eb2172a015
4
- data.tar.gz: 0115a644b0d3eda31dad83c393a25bb4b2678bb37cfd1e935e96bb6ef8998b0f
3
+ metadata.gz: aa1dab010007c62358dfd0f5845e65a57394f6f5bc3d1ed7dcd3fd852d840268
4
+ data.tar.gz: 8ee6a7c9b5a4e14ba529c833d31c8268c4a8d74e13328b871eec816c2b1bd0ae
5
5
  SHA512:
6
- metadata.gz: ece75e6ed8b2905f4a1e13c84efa708d1c9a6f63b5d131b88aa6a0aa312618b628f49343b4a6a4e247c83e23bb95d40904279094318bf388fc864b613ea9dbaa
7
- data.tar.gz: 7d809c5e588c2d08a9bc8b7f5a2f408b7fb624d676f1676a5edfa01b6fc402c923930368348218b392d2168e7af46f5d942fbdf3836da39d0789a0e1b9d43afb
6
+ metadata.gz: 8f5a05a24afb5799ff614ef0662e50590f18dcb8df4e72bf765268d82d974989cab66e09542e3a16d4da60a6674c9d5a820497dab448d6b96b02ee254d70fdde
7
+ data.tar.gz: 36cddfafb9f5c80c3051bfa5a7e4114d3a1b62d07612ffbceeaf9dbe590ae2a1ebc9cc37028806b316563ae4b5242ca2a1bbb83cf1d6d846f7305b1ed3b6d9fc
@@ -1,3 +1,3 @@
1
1
  module DomoscioRails
2
- VERSION = '0.4.28'.freeze
2
+ VERSION = '0.4.30'.freeze
3
3
  end
@@ -105,6 +105,8 @@ module DomoscioRails
105
105
 
106
106
  if response['Content-Type'] == 'application/zip' || response['Content-Type'] == 'application/xlsx'
107
107
  data = response
108
+ elsif response.is_a?(Net::HTTPNoContent)
109
+ data = []
108
110
  else
109
111
  data = DomoscioRails::JSON.load(response.body.nil? ? '' : response.body)
110
112
  end
@@ -121,8 +123,14 @@ module DomoscioRails
121
123
  data = e
122
124
  end
123
125
 
124
- if response['Total']
125
- pagetotal = (response['Total'].to_i / response['Per-Page'].to_f).ceil
126
+ if response['Total'] || response['Total-Pages'] != '1'
127
+
128
+ pagetotal = if response['Total']
129
+ (response['Total'].to_i / response['Per-Page'].to_f).ceil
130
+ else
131
+ response['Total-Pages'].to_i
132
+ end
133
+
126
134
  (2..pagetotal).each do |j|
127
135
  response = DomoscioRails.send_request(uri, method, params.merge({ page: j }), headers)
128
136
  return response if response.is_a? DomoscioRails::ProcessingError
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domoscio_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.28
4
+ version: 0.4.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoit Praly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-24 00:00:00.000000000 Z
11
+ date: 2024-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json