fast_config 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/fast_config.rb +6 -1
  3. metadata +10 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cd914fc71465b18f311cc1e36c0945729ae4d582
4
- data.tar.gz: 9bbf6d8b3812249bd90cdf4e2916155ccdc6393c
2
+ SHA256:
3
+ metadata.gz: 35207644e24ac6230287435e38656ee8e0a110dc381f413c89abc6f80641dabe
4
+ data.tar.gz: 7282219b387a898eb86fad706353a696eace440d7cf349a52c513841de1e9f6f
5
5
  SHA512:
6
- metadata.gz: 2a89261f06ffd8dba9c366e3eb13c687da3f8696187b743cd64eceb8ae8cde45af1d8564ced671984ec815172a649f0726c80c5eb921225477946fe561ec8225
7
- data.tar.gz: 54b678d049a8266f309a13061669adbaf1790c399d990a89c85dc77b1da9af6b887ecf1d4a7f3a99256b5acec26cea34152d5a81ad5946568dffa11d68947efe
6
+ metadata.gz: f2f2f0732ad8f1ada8740fe020b3187db097db2abe11916f0c79627b5a051b6882d310527b4ab2aa61c9e6bd10684db437f54a073c541df2e2498b6045f59944
7
+ data.tar.gz: 4574f0446fdee1c199b883585fa777360cba598e249f2f5ca60da389ccf469e6faecbc01814d0f5933b354cff58f4e73507339cb2a728b07f1c28e465811b2ac
data/lib/fast_config.rb CHANGED
@@ -13,7 +13,12 @@ module FastConfig
13
13
 
14
14
  def self.extended(main_class)
15
15
  path = File.expand_path("#{self.config_dir}/#{snake_case(main_class)}.yml")
16
- configs = YAML.load(ERB.new(File.read(path)).result)
16
+ erb_file = ERB.new(File.read(path))
17
+ configs = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("4")
18
+ YAML.safe_load(erb_file.result, aliases: true)
19
+ else
20
+ YAML.load(erb_file.result)
21
+ end
17
22
  if configs.has_key?(snake_case(main_class))
18
23
  configs[snake_case(main_class)].each{ |k,v| main_class.set(k.to_sym, v) }
19
24
  elsif configs.has_key?(snake_case(ENV['ENV']))
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Reister
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-17 00:00:00.000000000 Z
11
+ date: 2023-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
27
  description: Add default config files to projects just by including the gem.
@@ -35,24 +35,23 @@ homepage: https://github.com/chrisftw/fast_config
35
35
  licenses:
36
36
  - MIT
37
37
  metadata: {}
38
- post_install_message:
38
+ post_install_message:
39
39
  rdoc_options: []
40
40
  require_paths:
41
41
  - lib
42
42
  required_ruby_version: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '>='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - '>='
49
+ - - ">="
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  requirements: []
53
- rubyforge_project:
54
- rubygems_version: 2.4.2
55
- signing_key:
53
+ rubygems_version: 3.3.7
54
+ signing_key:
56
55
  specification_version: 4
57
56
  summary: FAST config files
58
57
  test_files: []