confset 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -5
- data/lib/confset/options.rb +3 -3
- data/lib/confset/version.rb +1 -1
- data/lib/confset.rb +1 -1
- data/spec/fixtures/reserved_keywords.yml +1 -0
- data/spec/options_spec.rb +22 -0
- data/spec/spec_helper.rb +1 -0
- metadata +17 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a370ca26c32a42b9eb9cd17d98e99a1450db5a73f2e53f11222f2757bfac588
|
4
|
+
data.tar.gz: '035569d155fb88697b03d4d4659b5e061540ef34585f25fad5455a5091211ac9'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03c4a9c04f00ea925439156dd409c2f7e15c69c9861be8deeb9b9cb154a6e72b73059362ac839783d212c9f8cef4d8464c44bf256feae69971b9ae800be1984c
|
7
|
+
data.tar.gz: 7a503890c049a3f9fd44a57f97a95333ac72ea7c977266842145cbcd5f4cbf537454d7f142d4d334af6e7c55e717e594de4d9559b60971279dab54de23cce4a6
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [1.1.0] - 2023-10-13
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
#### Breaking Changes
|
15
|
+
|
16
|
+
- `config` no longer loads `deep_merge`'s monkey patch for `Hash#deep_merge` and Hash#deep_merge!`([#342](https://github.com/rubyconfig/config/pull/342)). If you rely on those methods and are not using Rails / Active Support, you can load the monkey patch via`require 'deep_merge/deep_merge_hash'` by @jonathanhefner
|
17
|
+
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
- Address edge case with table config param (#339) by @krasnoukhov
|
21
|
+
|
10
22
|
## [1.0.3] - 2023-02-17
|
11
23
|
|
12
24
|
### Changed
|
@@ -26,8 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
26
38
|
### Changed
|
27
39
|
|
28
40
|
- Only load Railtie integration if Rails::Railtie is defined
|
29
|
-
[rubyconfig#31](https://github.com/rubyconfig/config/pull/319) - Thanks to Ufuk
|
30
|
-
Kayserilioglu <ufuk.kayserilioglu@shopify.com>
|
41
|
+
[rubyconfig#31](https://github.com/rubyconfig/config/pull/319) - Thanks to Ufuk
|
42
|
+
Kayserilioglu <ufuk.kayserilioglu@shopify.com>
|
31
43
|
- CHANGELOG.md pattern changed to the [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
32
44
|
|
33
45
|
## [1.0.1] - 2022-05-30
|
@@ -35,7 +47,7 @@ Kayserilioglu <ufuk.kayserilioglu@shopify.com>
|
|
35
47
|
### Fixed
|
36
48
|
|
37
49
|
- Avoid to crash the Rails application when there is an error
|
38
|
-
parsing a variable <https://github.com/dcotecnologia/confset/pull/5>
|
50
|
+
parsing a variable <https://github.com/dcotecnologia/confset/pull/5>
|
39
51
|
|
40
52
|
## [1.0.0] - 2022-05-27
|
41
53
|
|
@@ -43,9 +55,9 @@ parsing a variable <https://github.com/dcotecnologia/confset/pull/5>
|
|
43
55
|
|
44
56
|
- Initial release
|
45
57
|
- Refac the project focusing on the newer versions of the
|
46
|
-
Ruby language and Ruby on Rails.
|
58
|
+
Ruby language and Ruby on Rails.
|
47
59
|
|
48
|
-
|
60
|
+
---
|
49
61
|
|
50
62
|
You can find the full changelog of the original "config" gem at the link
|
51
63
|
<https://github.com/rubyconfig/config/blob/master/CHANGELOG.md>.
|
data/lib/confset/options.rb
CHANGED
@@ -114,7 +114,7 @@ module Confset
|
|
114
114
|
end
|
115
115
|
|
116
116
|
# Some keywords that don't play nicely with OpenStruct
|
117
|
-
SETTINGS_RESERVED_NAMES = %w[select collect test count zip min max exit!].freeze
|
117
|
+
SETTINGS_RESERVED_NAMES = %w[select collect test count zip min max exit! table].freeze
|
118
118
|
|
119
119
|
# An alternative mechanism for property access.
|
120
120
|
# This let's you do foo['bar'] along with foo.bar.
|
@@ -134,11 +134,11 @@ module Confset
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def key?(key)
|
137
|
-
table.key?(key)
|
137
|
+
@table.key?(key)
|
138
138
|
end
|
139
139
|
|
140
140
|
def has_key?(key)
|
141
|
-
table.has_key?(key)
|
141
|
+
@table.has_key?(key)
|
142
142
|
end
|
143
143
|
|
144
144
|
def method_missing(method_name, *args)
|
data/lib/confset/version.rb
CHANGED
data/lib/confset.rb
CHANGED
@@ -7,7 +7,7 @@ require "confset/sources/yaml_source"
|
|
7
7
|
require "confset/sources/hash_source"
|
8
8
|
require "confset/sources/env_source"
|
9
9
|
require "confset/validation/schema"
|
10
|
-
require "deep_merge"
|
10
|
+
require "deep_merge/core"
|
11
11
|
|
12
12
|
module Confset
|
13
13
|
extend Confset::Validation::Schema
|
data/spec/options_spec.rb
CHANGED
@@ -20,6 +20,7 @@ describe Confset::Options do
|
|
20
20
|
expect(config.max).to eq("kumquat")
|
21
21
|
expect(config.min).to eq("fig")
|
22
22
|
expect(config.exit!).to eq("taro")
|
23
|
+
expect(config.table).to eq("strawberry")
|
23
24
|
end
|
24
25
|
|
25
26
|
it "should allow to access them using [] operator" do
|
@@ -30,6 +31,7 @@ describe Confset::Options do
|
|
30
31
|
expect(config["max"]).to eq("kumquat")
|
31
32
|
expect(config["min"]).to eq("fig")
|
32
33
|
expect(config["exit!"]).to eq("taro")
|
34
|
+
expect(config["table"]).to eq("strawberry")
|
33
35
|
|
34
36
|
expect(config[:select]).to eq("apple")
|
35
37
|
expect(config[:collect]).to eq("banana")
|
@@ -38,6 +40,26 @@ describe Confset::Options do
|
|
38
40
|
expect(config[:max]).to eq("kumquat")
|
39
41
|
expect(config[:min]).to eq("fig")
|
40
42
|
expect(config[:exit!]).to eq("taro")
|
43
|
+
expect(config[:table]).to eq("strawberry")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
context "when empty" do
|
48
|
+
let(:config) do
|
49
|
+
Confset.load_files("#{fixture_path}/empty1.yml")
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should allow to access them via object member notation" do
|
53
|
+
expect(config.select).to be_nil
|
54
|
+
expect(config.table).to be_nil
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should allow to access them using [] operator" do
|
58
|
+
expect(config["select"]).to be_nil
|
59
|
+
expect(config["table"]).to be_nil
|
60
|
+
|
61
|
+
expect(config[:select]).to be_nil
|
62
|
+
expect(config[:table]).to be_nil
|
41
63
|
end
|
42
64
|
end
|
43
65
|
|
data/spec/spec_helper.rb
CHANGED
@@ -10,6 +10,7 @@ Dir["./spec/support/**/*.rb"].each { |f| require f }
|
|
10
10
|
RSpec.configure do |config|
|
11
11
|
# Turn the deprecation warnings into errors, giving you the full backtrace
|
12
12
|
config.raise_errors_for_deprecations!
|
13
|
+
config.include FixtureHelper
|
13
14
|
|
14
15
|
config.before(:suite) do
|
15
16
|
Confset.module_eval do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danilo Carolino
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2023-
|
14
|
+
date: 2023-10-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: deep_merge
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
42
|
+
version: 1.10.0
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 1.0.0
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
requirements:
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
52
|
+
version: 1.10.0
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 1.0.0
|
@@ -60,6 +60,9 @@ dependencies:
|
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: 3.12.0
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 3.12.0
|
63
66
|
type: :development
|
64
67
|
prerelease: false
|
65
68
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -67,20 +70,23 @@ dependencies:
|
|
67
70
|
- - "~>"
|
68
71
|
- !ruby/object:Gem::Version
|
69
72
|
version: 3.12.0
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 3.12.0
|
70
76
|
- !ruby/object:Gem::Dependency
|
71
77
|
name: rake
|
72
78
|
requirement: !ruby/object:Gem::Requirement
|
73
79
|
requirements:
|
74
80
|
- - "~>"
|
75
81
|
- !ruby/object:Gem::Version
|
76
|
-
version: 13.0
|
82
|
+
version: '13.0'
|
77
83
|
type: :development
|
78
84
|
prerelease: false
|
79
85
|
version_requirements: !ruby/object:Gem::Requirement
|
80
86
|
requirements:
|
81
87
|
- - "~>"
|
82
88
|
- !ruby/object:Gem::Version
|
83
|
-
version: 13.0
|
89
|
+
version: '13.0'
|
84
90
|
- !ruby/object:Gem::Dependency
|
85
91
|
name: simplecov
|
86
92
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,14 +107,14 @@ dependencies:
|
|
101
107
|
requirements:
|
102
108
|
- - "~>"
|
103
109
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.
|
110
|
+
version: 0.13.0
|
105
111
|
type: :development
|
106
112
|
prerelease: false
|
107
113
|
version_requirements: !ruby/object:Gem::Requirement
|
108
114
|
requirements:
|
109
115
|
- - "~>"
|
110
116
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0.
|
117
|
+
version: 0.13.0
|
112
118
|
- !ruby/object:Gem::Dependency
|
113
119
|
name: pry
|
114
120
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,14 +135,14 @@ dependencies:
|
|
129
135
|
requirements:
|
130
136
|
- - "~>"
|
131
137
|
- !ruby/object:Gem::Version
|
132
|
-
version: 1.
|
138
|
+
version: 1.57.1
|
133
139
|
type: :development
|
134
140
|
prerelease: false
|
135
141
|
version_requirements: !ruby/object:Gem::Requirement
|
136
142
|
requirements:
|
137
143
|
- - "~>"
|
138
144
|
- !ruby/object:Gem::Version
|
139
|
-
version: 1.
|
145
|
+
version: 1.57.1
|
140
146
|
- !ruby/object:Gem::Dependency
|
141
147
|
name: rubocop-packaging
|
142
148
|
requirement: !ruby/object:Gem::Requirement
|
@@ -251,7 +257,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
251
257
|
requirements:
|
252
258
|
- - ">="
|
253
259
|
- !ruby/object:Gem::Version
|
254
|
-
version:
|
260
|
+
version: 3.0.0
|
255
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
256
262
|
requirements:
|
257
263
|
- - ">="
|