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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c66806c855a5d52a9461e2bc48542dff6b5f9d7628c5bc3a850dbd3a99fdef11
4
- data.tar.gz: eeee6c280d80ab935925e883c39d493b8d9dafa39c4d1c6019055781ecf6ce77
3
+ metadata.gz: 6470a812da166c0852f57b34a60f8632ba22359fe84cab9cde7f005e552f12ac
4
+ data.tar.gz: 2e5dc6c7998ef95911c8c739ca39142105f73ab59c165383342e086a3755c526
5
5
  SHA512:
6
- metadata.gz: 9c9d20b236e6dd742ee5863a6bcfff5908993354cef3944ba1d17c930278400df01099ac957d40421bd63d2c7384cadfe8414126d14abe5471b97350d1f3e2b3
7
- data.tar.gz: da4473efcb0e5796d9eedf65b0edf1e438c3e5a67a813f0d69f62770e95dbd0cf2e4473349a5e560d030e513c532f07d8d9fb815151c35ded21586547e5ee6de
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,4 +1,4 @@
1
- Copyright (c) 2014-2021 Notioneer, Inc.
1
+ Copyright (c) 2014-2022 Notioneer, Inc.
2
2
 
3
3
  MIT License
4
4
 
@@ -1,7 +1,12 @@
1
1
  module MyApi
2
2
  class Railtie < Rails::Railtie
3
3
 
4
- config.after_initialize do
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
 
@@ -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)
@@ -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.merge(metadata: parsed[:metadata]), creds)
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 += [{log_sub: log_sub, title: title, rt: 0}]
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
@@ -1,3 +1,3 @@
1
1
  module NCore
2
- VERSION = '3.4.0'
2
+ VERSION = '3.4.3'
3
3
  end
data/lib/ncore/wait.rb CHANGED
@@ -14,7 +14,7 @@ module NCore
14
14
  cnt += 1
15
15
  sleep wait
16
16
  reload
17
- return true if block.call
17
+ return self if block.call
18
18
  end
19
19
  raise self.class.module_parent::WaitTimeout, self
20
20
  end
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', '< 6.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.0
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: 2021-10-06 00:00:00.000000000 Z
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: '6.2'
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: '6.2'
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.15
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