ncore 3.5.1 → 3.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16e01242ae632039f017faa4e3c51e6c885b05bb86ba0c53db9e6cf21b5e011b
4
- data.tar.gz: 849bce6e876e202690601839d0b0012a70347aeb25fe0fff0c56006f180e5a61
3
+ metadata.gz: 8146188f466028c5c5bea61b9a11d6a11f5d4ffe9af24c6f58ae019223b3d4c6
4
+ data.tar.gz: 51c9ebd2bdbb07bd4dc9d5685b31d85bb5c272073564325dd747058748a7f1d4
5
5
  SHA512:
6
- metadata.gz: ced939921588d62b7141fb481b1aa8638be6e297f0d355137c4aa155c8efde8d41198e4d76acdb9c574cf9bdefe7026df384dc84a70002153b38ded55cf9e80e
7
- data.tar.gz: 2497400057a0229616f5d9771f141be8966e65ab7d9ab767c3c54c3efaeb13f15017d46d7da6c1f73f23b22032c093d2a3f93246f968fece9ade3372dc981a66
6
+ metadata.gz: b9cef4054143ffc04613bb0156d240723d806f49415e2845c96428617739b512c47dae9924c339ed2f7271692ecf6a8b94a32b0a380b6786968ee4ec677b2c96
7
+ data.tar.gz: 2eaa61533b248ce9470f186d95397546040864b289fb3d7c69981aa7fa932b654852a8a74e5818eaabf7e89d3afd5fd38abc0fc28a5fd1e665bf225de2a22d70
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ #### 3.5.2
2
+
3
+ - Fix logger=()
4
+
1
5
  #### 3.5.1
2
6
 
3
7
  - Preserve 'metadata' and 'errors' keys as attributes when inside a standard
@@ -1,6 +1,6 @@
1
1
  require 'ncore/rails/log_subscriber'
2
2
 
3
- module AuthRocket
3
+ module MyApi
4
4
  class LogSubscriber < ActiveSupport::LogSubscriber
5
5
  include NCore::LogSubscriber
6
6
  self.runtime_variable = 'myapi_runtime'
@@ -18,5 +18,9 @@ module MyApi
18
18
  end
19
19
  end
20
20
 
21
+ initializer "my_api.logger" do |app|
22
+ MyApi::Api.logger = Rails.logger
23
+ end
24
+
21
25
  end
22
26
  end
data/lib/ncore/client.rb CHANGED
@@ -314,13 +314,13 @@ module NCore
314
314
 
315
315
  def debug_request(rest_opts)
316
316
  return unless logger.debug?
317
- logger << <<-DBG
318
- #{'-=- '*18}
319
- REQUEST:
320
- #{rest_opts[:method].to_s.upcase} #{rest_opts[:url]}
321
- #{rest_opts[:headers].map{|h,d| "#{h}: #{d}"}.join("\n ")}
322
- #{rest_opts[:body] || 'nil'}
323
- DBG
317
+ logger << <<~DBG
318
+ #{'-=- '*18}
319
+ REQUEST:
320
+ #{rest_opts[:method].to_s.upcase} #{rest_opts[:url]}
321
+ #{rest_opts[:headers].map{|h,d| "#{h}: #{d}"}.join("\n ")}
322
+ #{rest_opts[:body] || 'nil'}
323
+ DBG
324
324
  end
325
325
 
326
326
  def debug_response(response)
@@ -330,13 +330,13 @@ DBG
330
330
  else
331
331
  json = JSON.parse(response.body||'', symbolize_names: false) rescue response.body
332
332
  end
333
- logger << <<-DBG
334
- RESPONSE:
335
- #{response.headers['Status']} | #{response.headers['Content-Type']} | #{response.body.size} bytes
336
- #{response.headers.except('Status', 'Connection', 'Content-Type').map{|h,d| "#{h}: #{d}"}.join("\n ")}
337
- #{json.pretty_inspect.split("\n").join("\n ")}
338
- #{'-=- '*18}
339
- DBG
333
+ logger << <<~DBG
334
+ RESPONSE:
335
+ #{response.headers['Status']} | #{response.headers['Content-Type']} | #{response.body.size} bytes
336
+ #{response.headers.except('Status', 'Connection', 'Content-Type').map{|h,d| "#{h}: #{d}"}.join("\n ")}
337
+ #{json.pretty_inspect.split("\n").join("\n ")}
338
+ #{'-=- '*18}
339
+ DBG
340
340
  end
341
341
 
342
342
  end # ClassMethods
@@ -8,11 +8,7 @@ module NCore
8
8
  extend ::ActiveModel::Translation
9
9
  end
10
10
 
11
- if defined?(::Rails)
12
- def logger
13
- ::Rails.logger
14
- end
15
- end
11
+ delegate :logger, to: :class
16
12
 
17
13
  def new_record?
18
14
  !id
data/lib/ncore/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module NCore
2
- VERSION = '3.5.1'
2
+ VERSION = '3.5.2'
3
3
  end
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.5.1
4
+ version: 3.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Notioneer Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-20 00:00:00.000000000 Z
11
+ date: 2023-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel