lhs 22.1.0 → 22.1.1.pre

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: 6b42b1f0f10d4d0dcf31de3e65ed4ca0c3f7bcfded40e9897231b5ff09a9c472
4
- data.tar.gz: 1c041ff80320d79d73ef02e9af30278d58e779c239044c3485eac9b5e047f8ee
3
+ metadata.gz: 16eb1258e85aa5df4d0e727f4c0d76d2d9dfb7c90431d0bfe3fb6d91fa017c01
4
+ data.tar.gz: 9ba046b707ca2ada6faec0723b11567beab63a071bebb246314a00329ba56244
5
5
  SHA512:
6
- metadata.gz: 1a33c68f7d0c82a6c54482fa3ba3986bac1dccc83d9284951fa0f95bf92c0cd17fe3283c62c1c9dee067769d0fe81daf5ca3c86b8c6f84c07ccc0c3977b108cc
7
- data.tar.gz: fe26fa077139d670284ef136e6f702549bd1fd8e8d2c3bfd5f5d43dcd1dba3bf3ac72f7dca8ae70628184c85ff83908558353e0d835fa00052d21ab0539b88d8
6
+ metadata.gz: ce04f36ec3df38081737a718f81ff3714e41aadb429392bc881cd206d602686aab0d80d47ebe931a8d900b18535c01fde05c5e788592df12f635c7e26ff81efa
7
+ data.tar.gz: 1962f862a8699cf5f9c39f2076092eabe8d76e759f2f0b458b71db3713a65092a846cbf4ffbdabfbe745d57c33449259df987a61addaba1315828fc1bd4a310d
@@ -187,7 +187,7 @@ class LHS::Record
187
187
  options = extend_with_reference(options, reference)
188
188
  addition = load_include(options, data, sub_includes, reference)
189
189
  extend_raw_data!(data, addition, included)
190
- expand_addition!(data, included, options) if no_expanded_data?(addition)
190
+ expand_addition!(data, included, options) unless expanded_data?(addition)
191
191
  end
192
192
  end
193
193
 
@@ -208,25 +208,21 @@ class LHS::Record
208
208
  options = extend_with_reference(options, reference.except(:url))
209
209
  record = record_for_options(options) || self
210
210
  options = convert_options_to_endpoints(options) if record_for_options(options)
211
- expanded_data = begin
212
- record.request(options)
213
- rescue LHC::NotFound
214
- LHS::Data.new({}, data, record)
215
- end
211
+ expanded_data = record.request(options)
216
212
  extend_raw_data!(data, expanded_data, included)
217
213
  end
218
214
 
219
- def no_expanded_data?(addition)
215
+ def expanded_data?(addition)
220
216
  return false if addition.blank?
221
217
  if addition.item?
222
- (addition._raw.keys - [:href]).empty?
218
+ (addition._raw.keys - [:href]).any?
223
219
  elsif addition.collection?
224
220
  addition.all? do |item|
225
221
  next if item.blank?
226
222
  if item._raw.is_a?(Hash)
227
- (item._raw.keys - [:href]).empty?
223
+ (item._raw.keys - [:href]).any?
228
224
  elsif item._raw.is_a?(Array)
229
- item.any? { |item| (item._raw.keys - [:href]).empty? }
225
+ item.any? { |item| (item._raw.keys - [:href]).any? }
230
226
  end
231
227
  end
232
228
  end
@@ -351,15 +347,11 @@ class LHS::Record
351
347
  def load_include(options, data, sub_includes, references)
352
348
  record = record_for_options(options) || self
353
349
  options = convert_options_to_endpoints(options) if record_for_options(options)
354
- begin
355
- prepare_options_for_include_request!(options, sub_includes, references)
356
- if references && references[:all] # include all linked resources
357
- load_include_all!(options, record, sub_includes, references)
358
- else # simply request first page/batch
359
- load_include_simple!(options, record)
360
- end
361
- rescue LHC::NotFound
362
- LHS::Data.new({}, data, record)
350
+ prepare_options_for_include_request!(options, sub_includes, references)
351
+ if references && references[:all] # include all linked resources
352
+ load_include_all!(options, record, sub_includes, references)
353
+ else # simply request first page/batch
354
+ load_include_simple!(options, record)
363
355
  end
364
356
  end
365
357
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LHS
4
- VERSION = '22.1.0'
4
+ VERSION = '22.1.1.pre'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhs
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.1.0
4
+ version: 22.1.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/local-ch/lhs/graphs/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-03 00:00:00.000000000 Z
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -561,9 +561,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
561
561
  version: 2.3.0
562
562
  required_rubygems_version: !ruby/object:Gem::Requirement
563
563
  requirements:
564
- - - ">="
564
+ - - ">"
565
565
  - !ruby/object:Gem::Version
566
- version: '0'
566
+ version: 1.3.1
567
567
  requirements:
568
568
  - Ruby >= 2.3.0
569
569
  rubygems_version: 3.0.6