ncore 3.4.1 → 3.4.4
Sign up to get free protection for your applications and to get access to all the features.
- 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.rb +2 -2
- 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
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37764b440a06ae592f8c0b536e431a83ade55ebf27503e591325561876acd1de
|
4
|
+
data.tar.gz: dd35be93d3d788b55ac6404db24dadc805cee91a87b42485347dd2ea707dee3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b4a3cec14d91cea9efb6fa947362b9098b212a46102977564060a53b666eff93bcaf1c298e959039597974a729355b92661c4dddd72d03d9353e2e0a249392f
|
7
|
+
data.tar.gz: d0255d70bba9e5735373b9af7f22f5348736273cd42aedf03d961ba4e33ff121bd6248efe9cc1df4c6630628154b73ed1315152a9d55c51d8ada6309e18b699a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
#### 3.4.4
|
2
|
+
|
3
|
+
- Improve keepalive handling
|
4
|
+
|
5
|
+
#### 3.4.3
|
6
|
+
|
7
|
+
- Fix Rails controller reporting of API times
|
8
|
+
|
9
|
+
#### 3.4.2
|
10
|
+
|
11
|
+
- Fix SomeResource.all when payload includes 'data' attribute
|
12
|
+
|
1
13
|
#### 3.4.1
|
2
14
|
|
3
15
|
- Allow ActiveModel 7.0
|
@@ -84,6 +96,10 @@ Other changes
|
|
84
96
|
- #i18n_scope, config via Api.i18n_scope=
|
85
97
|
- #cache_key, #cache_version, #cache_key_with_version
|
86
98
|
|
99
|
+
#### 2.3.2
|
100
|
+
|
101
|
+
- Allow ActiveSupport 7.0
|
102
|
+
|
87
103
|
#### 2.3.1
|
88
104
|
|
89
105
|
- 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.rb
CHANGED
@@ -177,9 +177,9 @@ module NCore
|
|
177
177
|
tries += 1
|
178
178
|
response = connection.request rest_opts.except(:url)
|
179
179
|
rescue Excon::Error::Socket, Excon::Errors::SocketError, Excon::Error::Timeout,
|
180
|
-
Errno::EADDRNOTAVAIL => e
|
180
|
+
Errno::EADDRNOTAVAIL, Errno::ECONNRESET => e
|
181
181
|
# retry when keepalive was closed
|
182
|
-
if tries <= 1
|
182
|
+
if tries <= 1
|
183
183
|
retry
|
184
184
|
else
|
185
185
|
raise e
|
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
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.4
|
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-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -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
|