conf_loader 2.1.0 → 2.2.0

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: 54c86f6f5b32b9d1eb905dec6024dc795dd7ff239d9cc55465a38439e3086cd2
4
- data.tar.gz: e29a190889f3c47a3ca517eafb100708872206f6cf0ad3959d1aaed7cbc3ec3c
3
+ metadata.gz: c82b9ec01e8a0a4b07b9714a1eaa35f4043c17e08b0c2ccce45df79ab8c3750e
4
+ data.tar.gz: e8a6aad65c5d641d972aac4b61921f96e65e2823b1e266c45bb6eaebe9bde363
5
5
  SHA512:
6
- metadata.gz: d80800f2cc368da21002589a7a028b79fa3af8508521607f360fa8da190f8af5c39f58a8b35aea019d5a5cc965e3efba9b3d710cd967a296375b7f0d26f8cf2a
7
- data.tar.gz: af839ccd3b493377e535eabedefb1748a229163b32516d85fff6cdf65ad89aa1488f0c5ca5caf824d0b32197cfb44f520c4273bbcc787ec78b2b41639ce58ce1
6
+ metadata.gz: fb93f7a857e5d261942b4a4ff4faf32098ba02788fe2c4533bbab8b581c4a2202c6334fea4fff2e1be41b8f21d409786afe5e518304fd07203a5abded5e51c2c
7
+ data.tar.gz: add4a26b151f6b080cd282598c2181361636b69fc26eff5770641a16941ded9b4645d43c74952fbaa8513323ca26625c942aeba43e998e697e450c5269967453
@@ -0,0 +1,22 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ with:
14
+ fetch-depth: 2
15
+
16
+
17
+ - name: Release Gem
18
+ uses: discourse/publish-rubygems-action@b55d7b91b55e61752dc6cbc2972f8e16fe6c1a02
19
+ env:
20
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
21
+ RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
22
+ RELEASE_COMMAND: rake release
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2
1
+ 2.7.2
@@ -1,3 +1,3 @@
1
1
  class ConfLoader
2
- VERSION = '2.1.0'
2
+ VERSION = '2.2.0'
3
3
  end
data/lib/conf_loader.rb CHANGED
@@ -21,7 +21,9 @@ class ConfLoader
21
21
  # @api public
22
22
  def self.load(path, env)
23
23
  template = ERB.new File.new(path).read
24
- environments = YAML.load template.result(binding)
24
+ source = template.result(binding)
25
+
26
+ environments = load_environments(source)
25
27
 
26
28
  if environments.has_key?(env)
27
29
  hash = environments[env]
@@ -38,6 +40,16 @@ class ConfLoader
38
40
 
39
41
  private_class_method
40
42
 
43
+ if Gem::Version.new(RUBY_VERSION).release >= Gem::Version.new('3.1.0')
44
+ def self.load_environments(source)
45
+ YAML.load(source, aliases: true)
46
+ end
47
+ else
48
+ def self.load_environments(source)
49
+ YAML.load(source)
50
+ end
51
+ end
52
+
41
53
  def self.guarantee_key_presence(hash)
42
54
  hash.default_proc = proc do |h, k|
43
55
  raise KeyError, "#{k} not defined"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conf_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Indrek Juhkam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-11 00:00:00.000000000 Z
11
+ date: 2023-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: symbolizer
@@ -31,6 +31,7 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - ".github/workflows/publish.yml"
34
35
  - ".gitignore"
35
36
  - ".ruby-gemset"
36
37
  - ".ruby-version"
@@ -65,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
66
  - !ruby/object:Gem::Version
66
67
  version: '0'
67
68
  requirements: []
68
- rubygems_version: 3.0.6
69
+ rubygems_version: 3.1.4
69
70
  signing_key:
70
71
  specification_version: 4
71
72
  summary: Helps to load conf files in SaleMove ecosystem