confi 0.1.4 → 0.1.6

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: 1af9dfcf82d374a155a957056b15a082181c2eb256e5b68e9075ab6b753de23f
4
- data.tar.gz: f474f87badcf4228ca729fee5d381c34dbcdb09f02cea0dee0b931999773055e
3
+ metadata.gz: d49e58c09ee9a011a7717521d34ba8d6f217ee7eb7265263f172b11d80e420ae
4
+ data.tar.gz: eb48c3cd7ff63a8a108f14a402d7f84f0edd8971404e46cc42a8db21d0c2a26b
5
5
  SHA512:
6
- metadata.gz: e879a584446576049f95a2584463bf47b45fe4d65df4f672f07b14c4cb637bead34b857577a62b16f03b5567a5674acd17da306419b43750edbf44d392cbbb3a
7
- data.tar.gz: d61194676cfbd2705364ce6839aa6088173b612043d22d503aecad8a230cf77038fe0240b220f2ba68ce5d72060abff4d34f6c4607ff20842938e6f35acd1c54
6
+ metadata.gz: 4c58f5e77e5fa46898695e0557fd5aa74523d2863452f15f1af3615e8309aef95741c7d65557630a8613027083fae98d50f0cb7d581464e82079364d00511129
7
+ data.tar.gz: e90f440c6d63963bec0f618ca0c43d6942808a76b5538424ff1c43aafbccb00c36be26ffa543619783048704fa6e9aebcd1ead0efd297e6d08c700d128a5651f
data/.bundle/config ADDED
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_FROZEN: "false"
@@ -7,13 +7,14 @@ jobs:
7
7
  strategy:
8
8
  fail-fast: false
9
9
  matrix:
10
- ruby_version: [head, "3.4", "3.2"]
10
+ ruby_version: ["4.0", "3.4", "3.2"]
11
+ # ruby_version: [head, "4.0", "3.2"] # head fails 2026-09-09
11
12
  gemfile:
12
13
  - Gemfile
13
14
  runs-on: ubuntu-latest
14
15
 
15
16
  steps:
16
- - uses: actions/checkout@v4
17
+ - uses: actions/checkout@v6
17
18
  - name: Set up Ruby
18
19
  uses: ruby/setup-ruby@v1
19
20
  with:
data/.gitignore CHANGED
@@ -3,3 +3,5 @@
3
3
  **/*.gem
4
4
  **/*.lock
5
5
  **/*.log
6
+
7
+ .watchr
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-4.0.0
1
+ ruby-4.0.6
data/Gemfile.lock CHANGED
@@ -1,60 +1,60 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- confi (0.1.3)
4
+ confi (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.3)
10
10
  benchmark (0.5.0)
11
- benchmark-ips (2.14.0)
12
- byebug (12.0.0)
13
- docile (1.4.1)
14
- json (2.18.0)
15
- language_server-protocol (3.17.0.5)
11
+ benchmark-ips (2.15.1)
12
+ byebug (13.0.0)
13
+ reline (>= 0.6.0)
14
+ drb (2.2.3)
15
+ io-console (0.9.2)
16
+ json (2.21.2)
17
+ language_server-protocol (3.17.0.6)
16
18
  lint_roller (1.1.0)
17
- minitest (6.0.1)
19
+ minitest (6.0.6)
20
+ drb (~> 2.0)
18
21
  prism (~> 1.5)
19
- parallel (1.27.0)
20
- parser (3.3.10.0)
22
+ parallel (2.2.0)
23
+ parser (3.3.12.0)
21
24
  ast (~> 2.4.1)
22
25
  racc
23
- prism (1.7.0)
26
+ prism (1.9.0)
24
27
  racc (1.8.1)
25
28
  rainbow (3.1.1)
26
- rake (13.3.1)
27
- regexp_parser (2.11.3)
29
+ rake (13.4.2)
30
+ regexp_parser (2.12.0)
31
+ reline (0.7.0)
32
+ io-console (~> 0.5)
28
33
  ricecream (0.2.1)
29
- rubocop (1.81.7)
34
+ rubocop (1.88.2)
30
35
  json (~> 2.3)
31
36
  language_server-protocol (~> 3.17.0.2)
32
37
  lint_roller (~> 1.1.0)
33
- parallel (~> 1.10)
38
+ parallel (>= 1.10)
34
39
  parser (>= 3.3.0.2)
35
40
  rainbow (>= 2.2.2, < 4.0)
36
41
  regexp_parser (>= 2.9.3, < 3.0)
37
- rubocop-ast (>= 1.47.1, < 2.0)
42
+ rubocop-ast (>= 1.49.0, < 2.0)
38
43
  ruby-progressbar (~> 1.7)
39
44
  unicode-display_width (>= 2.4.0, < 4.0)
40
- rubocop-ast (1.48.0)
45
+ rubocop-ast (1.50.0)
41
46
  parser (>= 3.3.7.2)
42
- prism (~> 1.4)
47
+ prism (~> 1.7)
43
48
  rubocop-performance (1.26.1)
44
49
  lint_roller (~> 1.1)
45
50
  rubocop (>= 1.75.0, < 2.0)
46
51
  rubocop-ast (>= 1.47.1, < 2.0)
47
52
  ruby-progressbar (1.13.0)
48
- simplecov (0.22.0)
49
- docile (~> 1.1)
50
- simplecov-html (~> 0.11)
51
- simplecov_json_formatter (~> 0.1)
52
- simplecov-html (0.13.2)
53
- simplecov_json_formatter (0.1.4)
54
- standard (1.52.0)
53
+ simplecov (1.2.0)
54
+ standard (1.56.0)
55
55
  language_server-protocol (~> 3.17.0.2)
56
56
  lint_roller (~> 1.0)
57
- rubocop (~> 1.81.7)
57
+ rubocop (~> 1.88.0)
58
58
  standard-custom (~> 1.0.0)
59
59
  standard-performance (~> 1.8)
60
60
  standard-custom (1.0.2)
@@ -85,34 +85,34 @@ DEPENDENCIES
85
85
  CHECKSUMS
86
86
  ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
87
87
  benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c
88
- benchmark-ips (2.14.0) sha256=b72bc8a65d525d5906f8cd94270dccf73452ee3257a32b89fbd6684d3e8a9b1d
89
- byebug (12.0.0) sha256=d4a150d291cca40b66ec9ca31f754e93fed8aa266a17335f71bb0afa7fca1a1e
90
- confi (0.1.3)
91
- docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
92
- json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
93
- language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
88
+ benchmark-ips (2.15.1) sha256=07a1a9f3c6105ecaf68c174fc3fbcddd71a0e9ada6236ae03093a0dcfd812d59
89
+ byebug (13.0.0) sha256=d2263efe751941ca520fa29744b71972d39cbc41839496706f5d9b22e92ae05d
90
+ confi (0.1.6)
91
+ drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
92
+ io-console (0.9.2) sha256=efa74f891dd03c0939a931dfc6e74c2813d904763d456ea9762b0525e748db08
93
+ json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
94
+ language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
94
95
  lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
95
- minitest (6.0.1) sha256=7854c74f48e2e975969062833adc4013f249a4b212f5e7b9d5c040bf838d54bb
96
- parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
97
- parser (3.3.10.0) sha256=ce3587fa5cc55a88c4ba5b2b37621b3329aadf5728f9eafa36bbd121462aabd6
98
- prism (1.7.0) sha256=10062f734bf7985c8424c44fac382ac04a58124ea3d220ec3ba9fe4f2da65103
96
+ minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1
97
+ parallel (2.2.0) sha256=e1059c5fd7b649558a0aec38a769f06a42942bdb40503d005a59c352fe011cd8
98
+ parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
99
+ prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
99
100
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
100
101
  rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
101
- rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
102
- regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4
102
+ rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
103
+ regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
104
+ reline (0.7.0) sha256=5b012d8e55dbf9d450f12bde2cf7d15ff546ae80b3f8f3b30e570d431815583d
103
105
  ricecream (0.2.1) sha256=d32d7781d554d1e1ec44325cabeb22f604a74c563c08d2cfe82f4e2e2bb3ac93
104
- rubocop (1.81.7) sha256=6fb5cc298c731691e2a414fe0041a13eb1beed7bab23aec131da1bcc527af094
105
- rubocop-ast (1.48.0) sha256=22df9bbf3f7a6eccde0fad54e68547ae1e2a704bf8719e7c83813a99c05d2e76
106
+ rubocop (1.88.2) sha256=8def251c90cd955feb4daa3edc0ab56893250c4ce90ef81e6c80c03f9a939bbf
107
+ rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db
106
108
  rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834
107
109
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
108
- simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
109
- simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
110
- simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
111
- standard (1.52.0) sha256=ec050e63228e31fabe40da3ef96da7edda476f7acdf3e7c2ad47b6e153f6a076
110
+ simplecov (1.2.0) sha256=ea6acd05eece5a41990e2a5171c57d15700d329326c7666c85ee8c6a0dd0977e
111
+ standard (1.56.0) sha256=ae2af4d9669589162ac69ed5ef59dcf9f346d4afc81f7e62b84339310dfcb787
112
112
  standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b
113
113
  standard-performance (1.9.0) sha256=49483d31be448292951d80e5e67cdcb576c2502103c7b40aec6f1b6e9c88e3f2
114
114
  unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
115
115
  unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
116
116
 
117
117
  BUNDLED WITH
118
- 4.0.3
118
+ 4.0.20
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2025 Dittmar Krall (www.matiq.com)
1
+ Copyright (c) 2025-2026 Dittmar Krall (www.matiq.com)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -88,5 +88,5 @@ and run "bundle install".
88
88
 
89
89
  ## Miscellaneous
90
90
 
91
- Copyright (c) 2025 Dittmar Krall (www.matiq.com),
91
+ Copyright (c) 2025-2026 Dittmar Krall (www.matiq.com),
92
92
  released under the [MIT license](https://opensource.org/licenses/MIT).
data/confi.gemspec CHANGED
@@ -1,8 +1,9 @@
1
1
  # $LOAD_PATH.push File.expand_path("lib", __dir__)
2
2
 
3
- VERSION = "0.1.4" # 2015-12-27
4
- # VERSION = "0.1.3" # 2015-06-22
5
- # VERSION = "0.1.2"
3
+ VERSION = "0.1.6" # 2026-09-09
4
+ # VERSION = "0.1.5" # 2026-04-03
5
+ # VERSION = "0.1.4" # 2025-12-27
6
+ # VERSION = "0.1.3" # 2025-06-22
6
7
 
7
8
  Gem::Specification.new do |s|
8
9
  s.name = "confi"
@@ -20,6 +21,6 @@ Gem::Specification.new do |s|
20
21
  s.require_paths = ["lib"]
21
22
  s.required_ruby_version = ">= 3"
22
23
 
23
- s.add_development_dependency "simplecov", ">= 0"
24
- s.add_development_dependency "standard", ">= 0"
24
+ s.add_development_dependency "simplecov"
25
+ s.add_development_dependency "standard"
25
26
  end
data/lib/confi.rb CHANGED
@@ -20,14 +20,19 @@ module Confi
20
20
  @co_keys ||= []
21
21
  @co_keys << key.to_sym
22
22
  name = key.to_s
23
- writer = "#{name}="
24
- var_name = "@CO_#{name}"
25
23
 
24
+ define_accessors(name)
25
+ send("#{name}=", value)
26
+ end
27
+
28
+ def define_accessors(name)
29
+ return if respond_to?(name)
30
+
31
+ var_name = "@CO_#{name}"
26
32
  self.class.class_eval <<-RUBY, __FILE__, __LINE__ + 1
27
33
  def #{name}; #{var_name}; end
28
34
  def #{name}=(x); #{var_name} = x; end
29
35
  RUBY
30
- send(writer, value)
31
36
  end
32
37
 
33
38
  def method_missing(method_name, *args)
data/test/include_test.rb CHANGED
@@ -10,50 +10,53 @@ describe User do
10
10
  let(:int) { rand 1..10 }
11
11
  let(:symb) { :symbol }
12
12
  let(:hsh) { {"a" => 1, "b" => 2} }
13
- let(:user) { User.new }
13
+
14
+ def setup
15
+ @user = User.new
16
+ end
14
17
 
15
18
  it "rejects uninitialized attribute" do
16
19
  assert_raises {
17
- user.unknown
20
+ @user.unknown
18
21
  }
19
22
  end
20
23
 
21
24
  it "putter & getter" do
22
- user.a = symb
23
- assert_equal symb, user.a
25
+ @user.a = symb
26
+ assert_equal symb, @user.a
24
27
  end
25
28
 
26
29
  it "configures with hash" do
27
- user.configure(hsh)
30
+ @user.configure(hsh)
28
31
 
29
- assert_equal 1, user.a
30
- assert_equal 2, user.b
32
+ assert_equal 1, @user.a
33
+ assert_equal 2, @user.b
31
34
  end
32
35
 
33
36
  it "configures with block" do
34
- user.configure do |spec|
37
+ @user.configure do |spec|
35
38
  spec.c = :c
36
39
  end
37
40
 
38
- assert_equal :c, user.c
41
+ assert_equal :c, @user.c
39
42
  end
40
43
 
41
44
  it "configures with hash & block" do
42
- user.configure(hsh) do |spec|
45
+ @user.configure(hsh) do |spec|
43
46
  spec.c = :c
44
47
  end
45
48
 
46
- assert_equal 1, user.a
47
- assert_equal :c, user.c
49
+ assert_equal 1, @user.a
50
+ assert_equal :c, @user.c
48
51
  end
49
52
 
50
53
  it "configure independent instances" do
51
54
  user2 = User.new
52
- user.a = symb
55
+ @user.a = symb
53
56
  user2.a = int
54
57
 
55
- assert_equal symb, user.a
58
+ assert_equal symb, @user.a
56
59
  assert_equal int, user2.a
57
- refute_equal user.a, user2.a
60
+ refute_equal @user.a, user2.a
58
61
  end
59
62
  end
@@ -0,0 +1,24 @@
1
+ require "test_helper"
2
+ require_relative "../lib/confi"
3
+
4
+ class User
5
+ include Confi
6
+ end
7
+
8
+ describe User do
9
+ let(:symb) { :symbol }
10
+ let(:hsh) { {"a" => 1, "b" => 2} }
11
+
12
+ def setup
13
+ @user = User.new
14
+ end
15
+
16
+ it "rake warning" do
17
+ @user.a = symb
18
+ assert_equal symb, @user.a
19
+
20
+ @user.configure(hsh)
21
+ assert_equal 1, @user.a
22
+ assert_equal 2, @user.b
23
+ end
24
+ end
data/test/test_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  if ENV["COVERAGE"]
2
2
  require "simplecov"
3
3
  SimpleCov.start do
4
- add_filter "/test/"
4
+ skip "/test/"
5
5
  end
6
6
  end
7
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
@@ -45,11 +45,11 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - ".bundle/config"
48
49
  - ".github/workflows/rake.yml"
49
50
  - ".gitignore"
50
51
  - ".ruby-gemset"
51
52
  - ".ruby-version"
52
- - ".watchr"
53
53
  - BENCHMARKS
54
54
  - Gemfile
55
55
  - Gemfile.lock
@@ -61,6 +61,7 @@ files:
61
61
  - test/benchmark_test.rb
62
62
  - test/confi_test.rb
63
63
  - test/include_test.rb
64
+ - test/instance_test.rb
64
65
  - test/test_helper.rb
65
66
  homepage: https://github.com/matique/confi
66
67
  licenses:
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  - !ruby/object:Gem::Version
81
82
  version: '0'
82
83
  requirements: []
83
- rubygems_version: 4.0.3
84
+ rubygems_version: 4.0.20
84
85
  specification_version: 4
85
86
  summary: Auto attr_accessor for a kind of configuration
86
87
  test_files: []
data/.watchr DELETED
@@ -1 +0,0 @@
1
- /home/dk/shared/.watchr-simple