ncore 3.9.0 → 3.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/ncore/associations.rb +5 -1
- data/lib/ncore/attributes.rb +1 -1
- data/lib/ncore/client.rb +1 -1
- data/lib/ncore/configuration.rb +22 -2
- data/lib/ncore/version.rb +1 -1
- data/ncore.gemspec +2 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d3767002c121b2ee51fc04e98f0d4ff597caca6bfd5a161b2b8464e70b1dae2
|
4
|
+
data.tar.gz: a6f6376c0ecb38f1a6eb448b017da394bb76381b5ce65e5c22aac837bdcd1ef9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 196ec89b26c7502db2fd80139ad02027f6b7d3fd6308d74084d3d58a1f62e3cc5e469de4892495828c871a09443c49d17c504e455af7181c30146802ace1496b
|
7
|
+
data.tar.gz: 5baf3bf3e7086457a6e56dd913707ce373ba13b008ad8734896c3d2df34072b9ea8bbd8f19f76557630b1e247bf246d350866220bdb5c4901e05de5a61e19edc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
#### 3.10.0
|
2
|
+
|
3
|
+
- Allow Api.default_url and Api.credentials to be lazy loaded
|
4
|
+
- Fix detection of missing credentials
|
5
|
+
- Clarify Ruby 2.7 as minimum in gemspec; for earlier Rubies, lock to < 3.9
|
6
|
+
|
7
|
+
#### 3.9.1
|
8
|
+
|
9
|
+
- Fix clearing of memoized association when assoc_id changes
|
10
|
+
|
1
11
|
#### 3.9.0
|
2
12
|
|
3
13
|
- Add inspection filter for attributes
|
data/lib/ncore/associations.rb
CHANGED
@@ -222,9 +222,13 @@ module NCore
|
|
222
222
|
end
|
223
223
|
P1
|
224
224
|
|
225
|
+
# private def parent_id=(val)
|
226
|
+
# if :parent_key changes, clear memoized association
|
225
227
|
class_eval <<-P2, __FILE__, __LINE__+1
|
226
228
|
def #{parent_key}=(v)
|
227
|
-
@attribs[:#{
|
229
|
+
if @attribs[:#{parent_key}] != v and @attribs[:#{assoc_name}]&.id != v
|
230
|
+
@attribs[:#{assoc_name}] = nil
|
231
|
+
end
|
228
232
|
@attribs[:#{parent_key}] = v
|
229
233
|
end
|
230
234
|
private :#{parent_key}=
|
data/lib/ncore/attributes.rb
CHANGED
@@ -201,7 +201,7 @@ module NCore
|
|
201
201
|
args[:data].each do |k,v|
|
202
202
|
if k=='metadata' || k=='errors'
|
203
203
|
@attribs[k] = self.class.interpret_type(v, api_creds)
|
204
|
-
elsif respond_to?("#{k}=")
|
204
|
+
elsif respond_to?("#{k}=", true)
|
205
205
|
send "#{k}=", self.class.interpret_type(v, api_creds)
|
206
206
|
else
|
207
207
|
@attribs[k] = self.class.interpret_type(v, api_creds)
|
data/lib/ncore/client.rb
CHANGED
data/lib/ncore/configuration.rb
CHANGED
@@ -10,7 +10,17 @@ module NCore
|
|
10
10
|
module ClassMethods
|
11
11
|
|
12
12
|
def init_config_options
|
13
|
-
|
13
|
+
mattr_writer :default_url
|
14
|
+
class_eval <<-MTH
|
15
|
+
def self.default_url
|
16
|
+
self.default_url = @@default_url.call if @@default_url.respond_to? :call
|
17
|
+
@@default_url
|
18
|
+
end
|
19
|
+
def default_url
|
20
|
+
self.default_url = @@default_url.call if @@default_url.respond_to? :call
|
21
|
+
@@default_url
|
22
|
+
end
|
23
|
+
MTH
|
14
24
|
self.default_url = 'https://api.example.com/v1/'
|
15
25
|
|
16
26
|
mattr_accessor :default_headers
|
@@ -20,7 +30,17 @@ module NCore
|
|
20
30
|
user_agent: "NCore/ruby v#{VERSION}"
|
21
31
|
}
|
22
32
|
|
23
|
-
|
33
|
+
mattr_writer :credentials
|
34
|
+
class_eval <<-MTH
|
35
|
+
def self.credentials
|
36
|
+
self.credentials = @@credentials.call if @@credentials.respond_to? :call
|
37
|
+
@@credentials
|
38
|
+
end
|
39
|
+
def credentials
|
40
|
+
self.credentials = @@credentials.call if @@credentials.respond_to? :call
|
41
|
+
@@credentials
|
42
|
+
end
|
43
|
+
MTH
|
24
44
|
|
25
45
|
mattr_accessor :debug
|
26
46
|
self.debug = false
|
data/lib/ncore/version.rb
CHANGED
data/ncore.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.required_ruby_version = '>= 2.7'
|
22
|
+
|
21
23
|
spec.add_dependency 'activemodel', '>= 5.2', '< 7.2'
|
22
24
|
spec.add_dependency 'excon', '~> 0.32'
|
23
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ncore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Notioneer Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -136,14 +136,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
136
|
requirements:
|
137
137
|
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: '
|
139
|
+
version: '2.7'
|
140
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
|
-
rubygems_version: 3.5.
|
146
|
+
rubygems_version: 3.5.11
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: NCore - Gem for building REST API clients
|