cfgstore 2.2.8 → 2.2.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/app-config.rb +5 -4
  3. data/lib/app-logger.rb +1 -0
  4. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c797f16240a8dc25a6ea0aea48c7c4a40125f1de221d121ef9cb00b4a485ed9c
4
- data.tar.gz: fe0b79cc30fd18cb8db96eb7386e303362b47806e84f295bc9923205f4f5206b
3
+ metadata.gz: 9afa3c297ef2acd7881ecc79e6d100800f7e24808d424a6508192f57864d71f2
4
+ data.tar.gz: 6a08b28f077e8573b2feb39e7fe65b7b7e1c4d67198892de4662ce030849028b
5
5
  SHA512:
6
- metadata.gz: 6099f710167e47a398786bd343b3279a046e3b686a224c182735179844b815ac319a8d6434da6094cb5b6e93b5d3c45f5bc777b79cd96aa286a716c2fd5002da
7
- data.tar.gz: fe98b93f2379c5f180455358bff9f00a0e095379335cb9e208379c9c9b8019c11264f21c611a0fbb09aaa3a6edb17d7e41d1617474b49656a4b1a9e2a8fcc35c
6
+ metadata.gz: db9c7ac2a3d97cc8b3c142e0137e9a33e2f78223c9af19415f97830e273cc2e2aadede6288e320bd86ecb78c45f4d540422b6d480c93ee5c9004acfd039ee800
7
+ data.tar.gz: 84f624f89a8c330842203e8790d45039304c5760da858642b7e02a04a3b83347d51dcb96b082c2b08f03407e2e690af597beadd101fd90b5bef231c429a9f556
data/lib/app-config.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'yaml'
2
2
  require 'singleton'
3
3
  require 'pathname'
4
+ require 'yaml_extend'
4
5
  require 'monkey-hash'
5
6
 
6
7
  module App
@@ -18,7 +19,7 @@ module App
18
19
  module_function
19
20
  def init( approot: nil, configdir: 'config', filename: 'cfg', env: ( ENV['APP_ENV'] || 'development' ) )
20
21
  raise NoMethodError.new('Config already defined.') if defined?( ::Cfg )
21
- root = Pathname( approot || Pathname( __FILE__ ).dirname ).expand_path.to_s
22
+ root = Pathname( approot || __dir__ ).expand_path.to_s.freeze
22
23
  env = env.to_sym.freeze
23
24
  config = {}
24
25
  # Все настройки приложения + роуты
@@ -30,7 +31,7 @@ module App
30
31
  # raise ArgumentError.new("Не найден #{ amqp_routesfile }!") unless File.exist?( amqp_routesfile )
31
32
  # Кто первый встал, того и тапки.
32
33
  Kernel.const_set('Cfg', config)
33
- config.merge!( YAML.load_file( configfile ).keys_to_symbols ) rescue nil
34
+ config.merge!( YAML.ext_load_file( configfile ).keys_to_symbols ) rescue nil
34
35
  $0 += "[ #{ config.app.id } ]" if config.app? && config.app.id?
35
36
  config[ :app ] ||= { id: $0 }
36
37
  config.app[ :log ] ||= ENV['APP_LOG']
@@ -39,8 +40,8 @@ module App
39
40
  root: root,
40
41
  env: env,
41
42
  configdir: "#{ root }/#{ configdir }",
42
- amqproutes: File.exist?( amqp_routesfile ) ? YAML.load_file( amqp_routesfile ).keys_to_symbols : {},
43
- httproutes: File.exist?( http_routesfile ) ? YAML.load_file( http_routesfile ).keys_to_symbols : {}
43
+ amqproutes: File.exist?( amqp_routesfile ) ? YAML.ext_load_file( amqp_routesfile ).keys_to_symbols : {},
44
+ httproutes: File.exist?( http_routesfile ) ? YAML.ext_load_file( http_routesfile ).keys_to_symbols : {}
44
45
  })
45
46
 
46
47
  config[:loglevel] =
data/lib/app-logger.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'logger'
2
+ require 'fileutils'
2
3
  require 'monkey-hash'
3
4
  ##
4
5
  # Печататель протоколов с удобной настройкой вывода и фильтрацией спама от Bunny.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfgstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - deemytch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-01 00:00:00.000000000 Z
11
+ date: 2022-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: monkey-hash
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: yaml_extend
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: Loads from yaml, determines defaults and serves settings for the small
28
42
  program.
29
43
  email: aspamkiller@yandex.ru
@@ -52,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
66
  - !ruby/object:Gem::Version
53
67
  version: '0'
54
68
  requirements: []
55
- rubygems_version: 3.1.3
69
+ rubygems_version: 3.3.19
56
70
  signing_key:
57
71
  specification_version: 4
58
72
  summary: Loads and serves configs.