conifer 1.2.0 → 2.0.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/ruby.yml +9 -8
- data/.rubocop.yml +1 -0
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/Gemfile.lock +50 -44
- data/conifer.gemspec +8 -7
- data/lib/conifer/file.rb +5 -5
- data/lib/conifer/version.rb +1 -1
- data/lib/conifer.rb +3 -3
- metadata +32 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d91f2c9c3d4253a4772d4a5a9cbca13f5a3313b4158e598929aa0797e6e9f0d
|
4
|
+
data.tar.gz: b21e1ae6db73299773d4cb7804fb83ef9c0febe3d68b7cf4cd6269de12b3ad9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5863b2cdefb74a782c170d366c97bc1917cddafd24d95cda9423585b16b7db991a01fd3cc9f0dd649d727e934fca9abe1d652cdc3a0145a4e4d5180787e65df2
|
7
|
+
data.tar.gz: a76f8bc190504af328f4a20aac8377c64a3995aab245e1dfcb139cdc7e2f76ce55b09a7021362a44265633ce70bd2ec43bbbce7baffd44d70498703505c950eb
|
data/.github/workflows/ruby.yml
CHANGED
@@ -10,21 +10,22 @@ jobs:
|
|
10
10
|
strategy:
|
11
11
|
matrix:
|
12
12
|
ruby:
|
13
|
-
- 2.6
|
14
|
-
- 2.7
|
13
|
+
- '2.6'
|
14
|
+
- '2.7'
|
15
|
+
- '3.0'
|
16
|
+
- '3.1'
|
15
17
|
|
16
18
|
steps:
|
17
19
|
- uses: actions/checkout@v2
|
20
|
+
|
18
21
|
- name: Set up Ruby
|
19
|
-
uses:
|
22
|
+
uses: ruby/setup-ruby@v1
|
20
23
|
with:
|
21
24
|
ruby-version: ${{ matrix.ruby }}
|
22
|
-
|
23
|
-
|
24
|
-
gem install bundler -v 1.17.3 --no-document
|
25
|
-
bundle install --jobs 4 --retry 3
|
25
|
+
bundler-cache: true
|
26
|
+
|
26
27
|
- name: Run tests with RSpec
|
27
|
-
uses: paambaati/codeclimate-action@v2.5
|
28
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
28
29
|
env:
|
29
30
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
30
31
|
with:
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.1.2
|
data/Gemfile.lock
CHANGED
@@ -1,66 +1,72 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
conifer (
|
4
|
+
conifer (2.0.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.4.
|
10
|
-
climate_control (0.
|
11
|
-
diff-lcs (1.
|
12
|
-
docile (1.3.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
parser (2.7.0.3)
|
17
|
-
ast (~> 2.4.0)
|
9
|
+
ast (2.4.2)
|
10
|
+
climate_control (1.0.0)
|
11
|
+
diff-lcs (1.4.4)
|
12
|
+
docile (1.3.5)
|
13
|
+
parallel (1.21.0)
|
14
|
+
parser (3.0.3.2)
|
15
|
+
ast (~> 2.4.1)
|
18
16
|
rainbow (3.0.0)
|
19
|
-
rake (13.0.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
rspec-
|
24
|
-
rspec-
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
rake (13.0.3)
|
18
|
+
regexp_parser (2.2.0)
|
19
|
+
rexml (3.2.5)
|
20
|
+
rspec (3.10.0)
|
21
|
+
rspec-core (~> 3.10.0)
|
22
|
+
rspec-expectations (~> 3.10.0)
|
23
|
+
rspec-mocks (~> 3.10.0)
|
24
|
+
rspec-core (3.10.1)
|
25
|
+
rspec-support (~> 3.10.0)
|
26
|
+
rspec-expectations (3.10.1)
|
28
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
-
rspec-support (~> 3.
|
30
|
-
rspec-mocks (3.
|
28
|
+
rspec-support (~> 3.10.0)
|
29
|
+
rspec-mocks (3.10.2)
|
31
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-support (3.
|
34
|
-
rubocop (
|
35
|
-
jaro_winkler (~> 1.5.1)
|
31
|
+
rspec-support (~> 3.10.0)
|
32
|
+
rspec-support (3.10.2)
|
33
|
+
rubocop (1.24.0)
|
36
34
|
parallel (~> 1.10)
|
37
|
-
parser (>=
|
35
|
+
parser (>= 3.0.0.0)
|
38
36
|
rainbow (>= 2.2.2, < 4.0)
|
37
|
+
regexp_parser (>= 1.8, < 3.0)
|
39
38
|
rexml
|
39
|
+
rubocop-ast (>= 1.15.0, < 2.0)
|
40
40
|
ruby-progressbar (~> 1.7)
|
41
|
-
unicode-display_width (>= 1.4.0, <
|
42
|
-
rubocop-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
42
|
+
rubocop-ast (1.15.0)
|
43
|
+
parser (>= 3.0.1.1)
|
44
|
+
rubocop-rspec (2.3.0)
|
45
|
+
rubocop (~> 1.0)
|
46
|
+
rubocop-ast (>= 1.1.0)
|
47
|
+
ruby-progressbar (1.11.0)
|
48
|
+
simplecov (0.21.2)
|
46
49
|
docile (~> 1.1)
|
47
|
-
|
48
|
-
|
49
|
-
simplecov-html (0.
|
50
|
-
|
50
|
+
simplecov-html (~> 0.11)
|
51
|
+
simplecov_json_formatter (~> 0.1)
|
52
|
+
simplecov-html (0.12.3)
|
53
|
+
simplecov_json_formatter (0.1.2)
|
54
|
+
unicode-display_width (2.1.0)
|
51
55
|
|
52
56
|
PLATFORMS
|
53
|
-
|
57
|
+
x86_64-darwin-19
|
58
|
+
x86_64-darwin-20
|
59
|
+
x86_64-darwin-21
|
60
|
+
x86_64-linux
|
54
61
|
|
55
62
|
DEPENDENCIES
|
56
|
-
|
57
|
-
climate_control (~> 0.2)
|
63
|
+
climate_control
|
58
64
|
conifer!
|
59
|
-
rake
|
60
|
-
rspec
|
61
|
-
rubocop
|
62
|
-
rubocop-rspec
|
63
|
-
simplecov
|
65
|
+
rake
|
66
|
+
rspec
|
67
|
+
rubocop
|
68
|
+
rubocop-rspec
|
69
|
+
simplecov
|
64
70
|
|
65
71
|
BUNDLED WITH
|
66
|
-
|
72
|
+
2.3.3
|
data/conifer.gemspec
CHANGED
@@ -15,6 +15,8 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.homepage = 'https://github.com/hasghari/conifer'
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
18
|
+
spec.required_ruby_version = '>= 2.6'
|
19
|
+
|
18
20
|
# Specify which files should be added to the gem when it is released.
|
19
21
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
22
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
@@ -24,11 +26,10 @@ Gem::Specification.new do |spec|
|
|
24
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
27
|
spec.require_paths = ['lib']
|
26
28
|
|
27
|
-
spec.add_development_dependency '
|
28
|
-
spec.add_development_dependency '
|
29
|
-
spec.add_development_dependency '
|
30
|
-
spec.add_development_dependency '
|
31
|
-
spec.add_development_dependency 'rubocop'
|
32
|
-
spec.add_development_dependency '
|
33
|
-
spec.add_development_dependency 'simplecov', '0.16.1'
|
29
|
+
spec.add_development_dependency 'climate_control'
|
30
|
+
spec.add_development_dependency 'rake'
|
31
|
+
spec.add_development_dependency 'rspec'
|
32
|
+
spec.add_development_dependency 'rubocop'
|
33
|
+
spec.add_development_dependency 'rubocop-rspec'
|
34
|
+
spec.add_development_dependency 'simplecov'
|
34
35
|
end
|
data/lib/conifer/file.rb
CHANGED
@@ -8,14 +8,14 @@ module Conifer
|
|
8
8
|
NotFoundError = Class.new(StandardError)
|
9
9
|
UnsupportedFormatError = Class.new(StandardError)
|
10
10
|
|
11
|
-
attr_reader :name, :dir, :prefix, :format, :
|
11
|
+
attr_reader :name, :dir, :prefix, :format, :options
|
12
12
|
|
13
|
-
def initialize(name, dir:, prefix: nil, format: :yml,
|
13
|
+
def initialize(name, dir:, prefix: nil, format: :yml, **options)
|
14
14
|
@name = name
|
15
15
|
@dir = dir
|
16
16
|
@prefix = prefix
|
17
17
|
@format = format
|
18
|
-
@
|
18
|
+
@options = options
|
19
19
|
end
|
20
20
|
|
21
21
|
def [](key)
|
@@ -26,9 +26,9 @@ module Conifer
|
|
26
26
|
def parsed
|
27
27
|
@parsed ||= case format
|
28
28
|
when :yml, :yaml
|
29
|
-
YAML.safe_load(ERB.new(::File.read(path)).result,
|
29
|
+
YAML.safe_load(ERB.new(::File.read(path)).result, **options)
|
30
30
|
when :json
|
31
|
-
JSON.parse(ERB.new(::File.read(path)).result)
|
31
|
+
JSON.parse(ERB.new(::File.read(path)).result, **options)
|
32
32
|
else
|
33
33
|
raise UnsupportedFormatError, "Format '#{format}' is not supported"
|
34
34
|
end
|
data/lib/conifer/version.rb
CHANGED
data/lib/conifer.rb
CHANGED
@@ -11,15 +11,15 @@ module Conifer
|
|
11
11
|
# rubocop:disable Metrics/ParameterLists
|
12
12
|
module ClassMethods
|
13
13
|
def conifer(name, prefix: nil, dir: nil, format: :yml, method: ::File.basename(name.to_s, ".#{format}"),
|
14
|
-
singleton: false,
|
14
|
+
singleton: false, **options)
|
15
15
|
dir ||= ::File.expand_path(::File.dirname(caller_locations.first.path))
|
16
16
|
|
17
17
|
body = proc do
|
18
18
|
return instance_variable_get("@conifer_#{method}") if instance_variable_defined?("@conifer_#{method}")
|
19
19
|
|
20
20
|
instance_variable_set "@conifer_#{method}",
|
21
|
-
Conifer::File.new(name, prefix: prefix,
|
22
|
-
|
21
|
+
Conifer::File.new(name, prefix: prefix, format: format,
|
22
|
+
dir: dir, **options).tap(&:validate!)
|
23
23
|
end
|
24
24
|
|
25
25
|
singleton ? define_singleton_method(method, &body) : define_method(method, &body)
|
metadata
CHANGED
@@ -1,113 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conifer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hamed Asghari
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.17'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.17'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: climate_control
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
|
-
- - "
|
17
|
+
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
19
|
+
version: '0'
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- - "
|
24
|
+
- - ">="
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0
|
26
|
+
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
|
-
- - "
|
31
|
+
- - ">="
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
33
|
+
version: '0'
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- - "
|
38
|
+
- - ">="
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
40
|
+
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rspec
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - "
|
45
|
+
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
47
|
+
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
54
|
+
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rubocop
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- - "
|
59
|
+
- - ">="
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
61
|
+
version: '0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- - "
|
66
|
+
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
68
|
+
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: rubocop-rspec
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - "
|
73
|
+
- - ">="
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
75
|
+
version: '0'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - "
|
80
|
+
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
82
|
+
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: simplecov
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
|
-
- -
|
87
|
+
- - ">="
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0
|
89
|
+
version: '0'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
|
-
- -
|
94
|
+
- - ">="
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0
|
96
|
+
version: '0'
|
111
97
|
description: Conifer allows you to easily manage YAML configuration files and import
|
112
98
|
them into your objects.
|
113
99
|
email:
|
@@ -123,6 +109,7 @@ files:
|
|
123
109
|
- ".rubocop.yml"
|
124
110
|
- ".ruby-gemset"
|
125
111
|
- ".ruby-version"
|
112
|
+
- ".tool-versions"
|
126
113
|
- CODE_OF_CONDUCT.md
|
127
114
|
- Gemfile
|
128
115
|
- Gemfile.lock
|
@@ -139,7 +126,7 @@ homepage: https://github.com/hasghari/conifer
|
|
139
126
|
licenses:
|
140
127
|
- MIT
|
141
128
|
metadata: {}
|
142
|
-
post_install_message:
|
129
|
+
post_install_message:
|
143
130
|
rdoc_options: []
|
144
131
|
require_paths:
|
145
132
|
- lib
|
@@ -147,15 +134,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
134
|
requirements:
|
148
135
|
- - ">="
|
149
136
|
- !ruby/object:Gem::Version
|
150
|
-
version: '
|
137
|
+
version: '2.6'
|
151
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
139
|
requirements:
|
153
140
|
- - ">="
|
154
141
|
- !ruby/object:Gem::Version
|
155
142
|
version: '0'
|
156
143
|
requirements: []
|
157
|
-
rubygems_version: 3.
|
158
|
-
signing_key:
|
144
|
+
rubygems_version: 3.3.7
|
145
|
+
signing_key:
|
159
146
|
specification_version: 4
|
160
147
|
summary: Conifer allows you to easily manage YAML configuration files and import them
|
161
148
|
into your objects.
|