cfgstore 2.2.6 → 2.2.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of cfgstore might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 520262b4afb15ddfc85b7a168c9368678be064fbd63ea3866ab7b2533a9c5cc0
4
- data.tar.gz: 5aca99e7b53c6baea77231c126961009e9c8eceb84c428ebefe563a1370e905f
3
+ metadata.gz: 2cf0403e92a4ce8e9e64c93a2fdf50c4eca85a948b8fbacd9d0d016950245ac8
4
+ data.tar.gz: 264a7248f764822438bcc436b3871d0e726fe60137bc28d0c09a6175cc6560c8
5
5
  SHA512:
6
- metadata.gz: 676db863efb52388adf84b1ac0c6d817a9f76d182c2dd150377a1c950ca5f8114bfe3618f26f3acc67c8d736333a7bcaf33991bc1d5aa0acf7046f2dd6f7246d
7
- data.tar.gz: 9bccccd915fb2208a478a92e0293012a9ce9183cd00843c2e3ff7c9b4a386f8ef748e8cd8b8de4aa2c5bcaf7ee84d72cce72c67dfa598ab8d0bc8e846d113e4f
6
+ metadata.gz: c244e26ee00aa47accce4187d166e34c70a4b58f8fd3317423f097b71f2435f8bb8dbc5982411aff1f2d1773e39bb6dee4f5e8511e27f6b3e6f23d41a0986a0a
7
+ data.tar.gz: 7778fea5cbd94011b48ac05f013c9bc72a9b931409670394d50948cfc674b5f1ade49746bdc46c5286d79d838f437fbdae13aa4782a4cf99da6dbe95dac0a88c
@@ -2,12 +2,10 @@ require 'yaml'
2
2
  require 'singleton'
3
3
  require 'pathname'
4
4
  require 'monkey-hash'
5
- require_relative 'settings-hash'
6
5
 
7
6
  module App
8
7
 
9
8
  ##
10
- # Удобный прокси к SettingsHash
11
9
  # СДЕЛАТЬ: автоперезагрузку при изменении файла.
12
10
 
13
11
  module Config
@@ -22,7 +20,7 @@ module App
22
20
  raise NoMethodError.new('Config already defined.') if defined?( ::Cfg )
23
21
  root = Pathname( approot || Pathname( __FILE__ ).dirname ).expand_path.to_s
24
22
  env = env.to_sym.freeze
25
- config = SettingsHash.new
23
+ config = {}
26
24
  # Все настройки приложения + роуты
27
25
  configfile = "#{ root }/#{ configdir }/#{ filename }.#{ env }.yml"
28
26
  amqp_routesfile = "#{ root }/#{ configdir }/amqp.#{ env }.yml"
@@ -30,11 +28,11 @@ module App
30
28
 
31
29
  # raise ArgumentError.new("Не найден #{ configfile }!") unless File.exist?( configfile )
32
30
  # raise ArgumentError.new("Не найден #{ amqp_routesfile }!") unless File.exist?( amqp_routesfile )
33
- # Кто первый встал, того и тапки.
31
+ # Кто первый встал, того и тапки.
34
32
  Kernel.const_set('Cfg', config)
35
33
  config.merge!( YAML.load_file( configfile ).symbolize_keys ) rescue nil
36
34
  # puts "config: #{ config.to_hash.inspect }"
37
- $0 += "[ #{ config.app.id } ]" if config.app && config.app.id
35
+ $0 += "[ #{ config.app.id } ]" if config.app? && config.app.id?
38
36
  config[ :app ] ||= { id: $0 }
39
37
  config.app[ :log ] ||= ENV['APP_LOG']
40
38
 
@@ -49,9 +47,9 @@ module App
49
47
  # require 'pry-byebug'
50
48
  # binding.pry
51
49
 
52
- config[:loglevel] =
50
+ config[:loglevel] =
53
51
  begin
54
- Kernel.const_get("Logger::#{
52
+ Kernel.const_get("Logger::#{
55
53
  ( ENV['LOG_LEVEL'] || config.app.loglevel || ( env == :production ? :WARN : :DEBUG ) ).to_s.upcase
56
54
  }")
57
55
  rescue
@@ -63,6 +61,6 @@ module App
63
61
  def remove
64
62
  Kernel.send( :remove_const, 'Cfg' ) if defined?( Cfg )
65
63
  end
66
-
64
+
67
65
  end
68
66
  end
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.6
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - deemytch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-28 00:00:00.000000000 Z
11
+ date: 2020-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -47,12 +47,11 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - lib/app-config.rb
49
49
  - lib/app-logger.rb
50
- - lib/settings-hash.rb
51
- homepage:
50
+ homepage:
52
51
  licenses:
53
52
  - GPL-2.0
54
53
  metadata: {}
55
- post_install_message:
54
+ post_install_message:
56
55
  rdoc_options: []
57
56
  require_paths:
58
57
  - lib
@@ -67,8 +66,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
66
  - !ruby/object:Gem::Version
68
67
  version: '0'
69
68
  requirements: []
70
- rubygems_version: 3.1.2
71
- signing_key:
69
+ rubygems_version: 3.1.3
70
+ signing_key:
72
71
  specification_version: 4
73
72
  summary: Loads and serves configs.
74
73
  test_files: []
@@ -1,4 +0,0 @@
1
- require 'hashie'
2
-
3
- class SettingsHash < ::Hashie::Mash
4
- end