inventory_refresh 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yaml +1 -0
- data/CHANGELOG.md +16 -0
- data/lib/inventory_refresh/inventory_collection/index/proxy.rb +17 -14
- data/lib/inventory_refresh/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3230d7d712cf1e8ca4c20f070dae17686b8f879b34a4eb7cd59eafa00705ee44
|
4
|
+
data.tar.gz: 1242373300c55514fc0f3795826712babda1cc5d14983d0273c63e1214515ea9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1e9aaccce8ca7179137b24eeba2f8bacc2d7c0401891ff6fbdbf03d99786c4bcfa65cb5bf81b461a7edfe5a62de8b21ee00ab8007e326c6afcf8debc685a616
|
7
|
+
data.tar.gz: fbf7e26bdb0d42e50253fdb9f70734a299c5f30df3fa64b6a05d68f2c80e6a8e1c06dbec902a1a3845e860cf86dd6add8931cf9ef809055534b327b370a2f375
|
data/.github/workflows/ci.yaml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,22 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.0.0] - 2022-09-06
|
9
|
+
### Added
|
10
|
+
- Add timeout-minutes to setup-ruby job (#110)
|
11
|
+
- Add ruby3 compliant parameters for lazy_find (#112)
|
12
|
+
- Handle two hash arguments to lazy_find (#114)
|
13
|
+
|
14
|
+
### Removed
|
15
|
+
- **BREAKING** Remove deprecated find_by/lazy_find_by methods
|
16
|
+
|
17
|
+
## [1.1.0] - 2022-05-03
|
18
|
+
### Changed
|
19
|
+
- Ruby 3 keyword arguments (#109)
|
20
|
+
|
21
|
+
### Added
|
22
|
+
- Cron for GitHub Actions (#108)
|
23
|
+
|
8
24
|
## [1.0.0] - 2022-02-09
|
9
25
|
### Changed
|
10
26
|
- Run rubocop -A (#102)
|
@@ -3,6 +3,7 @@ require "inventory_refresh/inventory_collection/index/type/local_db"
|
|
3
3
|
require "inventory_refresh/inventory_collection/index/type/skeletal"
|
4
4
|
require "inventory_refresh/logging"
|
5
5
|
require "active_support/core_ext/module/delegation"
|
6
|
+
require "active_support/deprecation"
|
6
7
|
|
7
8
|
module InventoryRefresh
|
8
9
|
class InventoryCollection
|
@@ -77,7 +78,6 @@ module InventoryRefresh
|
|
77
78
|
end
|
78
79
|
|
79
80
|
def find(reference, ref: primary_index_ref)
|
80
|
-
# TODO(lsmola) lazy_find will support only hash, then we can remove the _by variant
|
81
81
|
# TODO(lsmola) this method should return lazy too, the rest of the finders should be deprecated
|
82
82
|
return if reference.nil?
|
83
83
|
|
@@ -95,22 +95,25 @@ module InventoryRefresh
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
def
|
99
|
-
# TODO(lsmola)
|
100
|
-
|
101
|
-
end
|
98
|
+
def lazy_find(manager_uuid = nil, opts = {}, ref: primary_index_ref, key: nil, default: nil, transform_nested_lazy_finds: false, **manager_uuid_hash)
|
99
|
+
# TODO(lsmola) also, it should be enough to have only 1 find method, everything can be lazy, until we try to
|
100
|
+
# access the data
|
102
101
|
|
103
|
-
|
104
|
-
|
102
|
+
ref = opts[:ref] if opts.key?(:ref)
|
103
|
+
key = opts[:key] if opts.key?(:key)
|
104
|
+
default = opts[:default] if opts.key?(:default)
|
105
|
+
transform_nested_lazy_finds = opts[:transform_nested_lazy_finds] if opts.key?(:transform_nested_lazy_finds)
|
105
106
|
|
106
|
-
|
107
|
-
end
|
107
|
+
manager_uuid_hash.update(opts.except(:ref, :key, :default, :transform_nested_lazy_finds))
|
108
108
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
109
|
+
# Skip if no manager_uuid is provided
|
110
|
+
return if manager_uuid.nil? && manager_uuid_hash.blank?
|
111
|
+
|
112
|
+
raise ArgumentError, "only one of manager_uuid or manager_uuid_hash must be passed" unless !!manager_uuid ^ !!manager_uuid_hash.present?
|
113
|
+
|
114
|
+
ActiveSupport::Deprecation.warn("Passing a hash for options is deprecated and will be removed in an upcoming release.") if opts.present?
|
115
|
+
|
116
|
+
manager_uuid ||= manager_uuid_hash
|
114
117
|
|
115
118
|
assert_index(manager_uuid, ref)
|
116
119
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inventory_refresh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ManageIQ Developers
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -163,7 +163,7 @@ dependencies:
|
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: 0.21.2
|
165
165
|
description: Topological Inventory Persister
|
166
|
-
email:
|
166
|
+
email:
|
167
167
|
executables: []
|
168
168
|
extensions: []
|
169
169
|
extra_rdoc_files: []
|
@@ -238,7 +238,7 @@ licenses:
|
|
238
238
|
- Apache-2.0
|
239
239
|
metadata:
|
240
240
|
rubygems_mfa_required: 'true'
|
241
|
-
post_install_message:
|
241
|
+
post_install_message:
|
242
242
|
rdoc_options: []
|
243
243
|
require_paths:
|
244
244
|
- lib
|
@@ -253,8 +253,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
253
253
|
- !ruby/object:Gem::Version
|
254
254
|
version: '0'
|
255
255
|
requirements: []
|
256
|
-
rubygems_version: 3.3.
|
257
|
-
signing_key:
|
256
|
+
rubygems_version: 3.3.15
|
257
|
+
signing_key:
|
258
258
|
specification_version: 4
|
259
259
|
summary: Topological Inventory Persister
|
260
260
|
test_files: []
|