confset 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8f29b83a1d3a103368e818adc5ab6ca2eaa3773d505bad3e54b01d8c876b3a0
4
- data.tar.gz: '079bb9df829a8a899b7597500d418996b2eeb6bfd08db102b459f1cc4c7aa736'
3
+ metadata.gz: 8a370ca26c32a42b9eb9cd17d98e99a1450db5a73f2e53f11222f2757bfac588
4
+ data.tar.gz: '035569d155fb88697b03d4d4659b5e061540ef34585f25fad5455a5091211ac9'
5
5
  SHA512:
6
- metadata.gz: e91cf5b4a235a67fc80b10004e4462bd24a4b19aeeab7faa2567d8565742c9cdec814c2596d074f071ca0b8943f7b03a024059462ababaabe27b9507631722d6
7
- data.tar.gz: 3a2767e972218340d31d1b845322090741c6694e632ae13fe3c4f88c5812871ae460e816f190efc62b2f7175689200efbc70aa460ed35382b7ace65f00dfb44f
6
+ metadata.gz: 03c4a9c04f00ea925439156dd409c2f7e15c69c9861be8deeb9b9cb154a6e72b73059362ac839783d212c9f8cef4d8464c44bf256feae69971b9ae800be1984c
7
+ data.tar.gz: 7a503890c049a3f9fd44a57f97a95333ac72ea7c977266842145cbcd5f4cbf537454d7f142d4d334af6e7c55e717e594de4d9559b60971279dab54de23cce4a6
data/CHANGELOG.md CHANGED
@@ -7,21 +7,47 @@ 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
+
22
+ ## [1.0.3] - 2023-02-17
23
+
24
+ ### Changed
25
+
26
+ - Update project dependencies by @danilogco
27
+ - Add `ruby v3.2.x` to the test matrix by @danilogco
28
+
29
+ ### Fixed
30
+
31
+ - Fix indentation warning (rubyconfig#322) by @lygaret
32
+ - Fix typo Padrino (rubyconfig#325) by @ytkg
33
+ - Fix CI setting for Ruby 3.0 (rubyconfig#326) by @ytkg
34
+ - Remove `Gemfile.lock` from the package by @danilogco
35
+
10
36
  ## [1.0.2] - 2022-06-06
11
37
 
12
- ### Changes
38
+ ### Changed
13
39
 
14
40
  - Only load Railtie integration if Rails::Railtie is defined
15
- [rubyconfig#31](https://github.com/rubyconfig/config/pull/319) - Thanks to Ufuk
16
- Kayserilioglu <ufuk.kayserilioglu@shopify.com>
41
+ [rubyconfig#31](https://github.com/rubyconfig/config/pull/319) - Thanks to Ufuk
42
+ Kayserilioglu <ufuk.kayserilioglu@shopify.com>
17
43
  - CHANGELOG.md pattern changed to the [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
18
44
 
19
45
  ## [1.0.1] - 2022-05-30
20
46
 
21
- ### Fixes
47
+ ### Fixed
22
48
 
23
49
  - Avoid to crash the Rails application when there is an error
24
- parsing a variable <https://github.com/dcotecnologia/confset/pull/5>
50
+ parsing a variable <https://github.com/dcotecnologia/confset/pull/5>
25
51
 
26
52
  ## [1.0.0] - 2022-05-27
27
53
 
@@ -29,9 +55,9 @@ parsing a variable <https://github.com/dcotecnologia/confset/pull/5>
29
55
 
30
56
  - Initial release
31
57
  - Refac the project focusing on the newer versions of the
32
- Ruby language and Ruby on Rails.
58
+ Ruby language and Ruby on Rails.
33
59
 
34
- ---------------------
60
+ ---
35
61
 
36
62
  You can find the full changelog of the original "config" gem at the link
37
63
  <https://github.com/rubyconfig/config/blob/master/CHANGELOG.md>.
data/README.md CHANGED
@@ -29,6 +29,7 @@ for the following interpreters and frameworks:
29
29
 
30
30
  * Interpreters
31
31
  * [Ruby](https://www.ruby-lang.org) `>= 2.7`
32
+ * Tested versions: 2.7.x, 3.0.x, 3.1.x and 3.2.x
32
33
  * Application frameworks
33
34
  * Rails `>= 6.0`
34
35
  * Padrino
@@ -39,14 +40,14 @@ for the following interpreters and frameworks:
39
40
  Add the gem to your `Gemfile` and run `bundle install` to install it:
40
41
 
41
42
  ```ruby
42
- gem "confset", "~> 1.0.0"
43
+ gem "confset", "~> 1.0.3"
43
44
  ```
44
45
 
45
46
  You can also install by the GitHub packages server:
46
47
 
47
48
  ```ruby
48
49
  source "https://rubygems.pkg.github.com/dcotecnologia" do
49
- gem "confset", "1.0.0"
50
+ gem "confset", "1.0.3"
50
51
  end
51
52
  ```
52
53
 
@@ -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)
@@ -24,10 +24,10 @@ module Confset
24
24
 
25
25
  result || {}
26
26
 
27
- rescue Psych::SyntaxError => e
28
- raise "YAML syntax error occurred while parsing #{@path}. " \
29
- "Please note that YAML must be consistently indented using spaces. Tabs are not allowed. " \
30
- "Error: #{e.message}"
27
+ rescue Psych::SyntaxError => e
28
+ raise "YAML syntax error occurred while parsing #{@path}. " \
29
+ "Please note that YAML must be consistently indented using spaces. Tabs are not allowed. " \
30
+ "Error: #{e.message}"
31
31
  end
32
32
  end
33
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Confset
4
- VERSION = "1.0.2"
4
+ VERSION = "1.1.0"
5
5
  end
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
@@ -5,3 +5,4 @@ zip: cherry
5
5
  max: kumquat
6
6
  min: fig
7
7
  exit!: taro
8
+ table: strawberry
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.2
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: 2022-06-06 00:00:00.000000000 Z
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: '1.0'
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: '1.0'
52
+ version: 1.10.0
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: 1.0.0
@@ -59,20 +59,20 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '3.9'
62
+ version: 3.12.0
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- version: 3.9.0
65
+ version: 3.12.0
66
66
  type: :development
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
69
69
  requirements:
70
70
  - - "~>"
71
71
  - !ruby/object:Gem::Version
72
- version: '3.9'
72
+ version: 3.12.0
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 3.9.0
75
+ version: 3.12.0
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rake
78
78
  requirement: !ruby/object:Gem::Requirement
@@ -93,84 +93,84 @@ dependencies:
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.21'
96
+ version: 0.22.0
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0.21'
103
+ version: 0.22.0
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: mdl
106
106
  requirement: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0.11'
110
+ version: 0.13.0
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0.11'
117
+ version: 0.13.0
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: pry
120
120
  requirement: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0.14'
124
+ version: 0.14.2
125
125
  type: :development
126
126
  prerelease: false
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0.14'
131
+ version: 0.14.2
132
132
  - !ruby/object:Gem::Dependency
133
133
  name: rubocop
134
134
  requirement: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '1.29'
138
+ version: 1.57.1
139
139
  type: :development
140
140
  prerelease: false
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '1.29'
145
+ version: 1.57.1
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: rubocop-packaging
148
148
  requirement: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: '0.5'
152
+ version: '0'
153
153
  type: :development
154
154
  prerelease: false
155
155
  version_requirements: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: '0.5'
159
+ version: '0'
160
160
  - !ruby/object:Gem::Dependency
161
161
  name: rubocop-performance
162
162
  requirement: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: '1.14'
166
+ version: '0'
167
167
  type: :development
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - "~>"
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: '1.14'
173
+ version: '0'
174
174
  description: 'Easiest way to manage multi-environment settings in any ruby project
175
175
  or framework: '
176
176
  email:
@@ -257,7 +257,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
257
257
  requirements:
258
258
  - - ">="
259
259
  - !ruby/object:Gem::Version
260
- version: 2.7.0
260
+ version: 3.0.0
261
261
  required_rubygems_version: !ruby/object:Gem::Requirement
262
262
  requirements:
263
263
  - - ">="
@@ -267,7 +267,7 @@ requirements: []
267
267
  rubygems_version: 3.3.7
268
268
  signing_key:
269
269
  specification_version: 4
270
- summary: Effortless multi-environment settings in Rails, Sinatra, Pandrino and others
270
+ summary: Effortless multi-environment settings in Rails, Sinatra, Padrino and others
271
271
  test_files:
272
272
  - spec/config_env_spec.rb
273
273
  - spec/config_spec.rb