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 +4 -4
- data/.github/workflows/publish.yml +22 -0
- data/.ruby-version +1 -1
- data/lib/conf_loader/version.rb +1 -1
- data/lib/conf_loader.rb +13 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c82b9ec01e8a0a4b07b9714a1eaa35f4043c17e08b0c2ccce45df79ab8c3750e
|
4
|
+
data.tar.gz: e8a6aad65c5d641d972aac4b61921f96e65e2823b1e266c45bb6eaebe9bde363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/conf_loader/version.rb
CHANGED
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
|
-
|
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.
|
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:
|
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.
|
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
|