ncore 3.4.0 → 3.4.3
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 +4 -4
- data/CHANGELOG.md +16 -0
- data/LICENSE +1 -1
- data/example/lib/my_api/rails/railtie.rb +6 -1
- data/lib/ncore/client_cache.rb +2 -1
- data/lib/ncore/methods/all.rb +1 -1
- data/lib/ncore/rails/log_subscriber.rb +3 -1
- data/lib/ncore/version.rb +1 -1
- data/lib/ncore/wait.rb +1 -1
- data/ncore.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6470a812da166c0852f57b34a60f8632ba22359fe84cab9cde7f005e552f12ac
|
4
|
+
data.tar.gz: 2e5dc6c7998ef95911c8c739ca39142105f73ab59c165383342e086a3755c526
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 551b111c0e2a86b0d0ce3b209001e1bb7307f347fdec2122c62971edd25dd9a2d658def1569c64abda20fd53439e99280571bc706e48bf219e4313aee1b3b093
|
7
|
+
data.tar.gz: 5c4def6f9020d41f7e3a52504d26c946d9d884952b1cb198f9a4dd8c81552576b9bc5241925e0793b73f5e75856bf6a282d5fe0c3b09b58a69bdf3fc31f2d7f2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
#### 3.4.3
|
2
|
+
|
3
|
+
- Fix Rails controller reporting of API times
|
4
|
+
|
5
|
+
#### 3.4.2
|
6
|
+
|
7
|
+
- Fix SomeResource.all when payload includes 'data' attribute
|
8
|
+
|
9
|
+
#### 3.4.1
|
10
|
+
|
11
|
+
- Allow ActiveModel 7.0
|
12
|
+
|
1
13
|
#### 3.4.0
|
2
14
|
|
3
15
|
- Add SomeResource#wait_for and WaitTimeout
|
@@ -80,6 +92,10 @@ Other changes
|
|
80
92
|
- #i18n_scope, config via Api.i18n_scope=
|
81
93
|
- #cache_key, #cache_version, #cache_key_with_version
|
82
94
|
|
95
|
+
#### 2.3.2
|
96
|
+
|
97
|
+
- Allow ActiveSupport 7.0
|
98
|
+
|
83
99
|
#### 2.3.1
|
84
100
|
|
85
101
|
- Allow ActiveModel 6.1
|
data/LICENSE
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
module MyApi
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
|
4
|
-
config.
|
4
|
+
config.action_dispatch.rescue_responses.merge!(
|
5
|
+
'MyApi::RecordInvalid' => :unprocessable_entity, # 422
|
6
|
+
'MyApi::RecordNotFound' => :not_found, # 404
|
7
|
+
)
|
8
|
+
|
9
|
+
initializer "my_api.cache_store" do |app|
|
5
10
|
MyApi::Api.cache_store = Rails.cache
|
6
11
|
end
|
7
12
|
|
data/lib/ncore/client_cache.rb
CHANGED
@@ -6,11 +6,12 @@ module NCore
|
|
6
6
|
|
7
7
|
private
|
8
8
|
|
9
|
+
# only caches GET requests with 200..299, 409, 422 responses
|
9
10
|
# cache_opts: true
|
10
11
|
# use *::Api.cache_store
|
11
12
|
# cache_opts: {...}
|
12
13
|
# use: *::Api.cache_store, with options: {...}
|
13
|
-
# hint: add force: true execute the query and rewrite the cache
|
14
|
+
# hint: add force: true to execute the query and rewrite the cache
|
14
15
|
# cache_opts: Store.new
|
15
16
|
# use Store.new as-is
|
16
17
|
def execute_request(req, cache_opts=nil)
|
data/lib/ncore/methods/all.rb
CHANGED
@@ -12,7 +12,7 @@ module NCore
|
|
12
12
|
Collection.new.tap do |coll|
|
13
13
|
coll.metadata = parsed[:metadata]
|
14
14
|
parsed[:data].each do |hash|
|
15
|
-
coll << factory(hash
|
15
|
+
coll << factory({data: hash, metadata: parsed[:metadata]}, creds)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -108,7 +108,9 @@ module NCore
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def register_api_runtime(log_sub, title)
|
111
|
-
ControllerRuntime.api_runtime_list
|
111
|
+
unless ControllerRuntime.api_runtime_list.detect{|arl| arl[:log_sub]==log_sub }
|
112
|
+
ControllerRuntime.api_runtime_list += [{log_sub: log_sub, title: title, rt: 0}]
|
113
|
+
end
|
112
114
|
end
|
113
115
|
end
|
114
116
|
|
data/lib/ncore/version.rb
CHANGED
data/lib/ncore/wait.rb
CHANGED
data/ncore.gemspec
CHANGED
@@ -18,7 +18,7 @@ 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.add_dependency 'activemodel', '>= 5.2', '<
|
21
|
+
spec.add_dependency 'activemodel', '>= 5.2', '< 7.1'
|
22
22
|
spec.add_dependency 'excon', '~> 0.32'
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler"
|
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.
|
4
|
+
version: 3.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Notioneer Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: excon
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
rubygems_version: 3.2.
|
145
|
+
rubygems_version: 3.2.32
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: NCore - Gem for building REST API clients
|