confi 0.1.1 → 0.1.2

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: 972b6f8e7309328bd9857eab968434da275e9c753c5a64d82cf0c039a460bbe4
4
- data.tar.gz: 265e5a20d66bb72bb005c51461307947dc71e97bbbe887612dc36e39d75adfdb
3
+ metadata.gz: 3d40fd27379146f00e48ffe806b1de31df72e3ad6149089fb9f2e5f08564a22a
4
+ data.tar.gz: 1c150083253cfa064aec3b05144c8b10e588d4a113bdfa1b17f897b87b8ff552
5
5
  SHA512:
6
- metadata.gz: a4b7cee86b97bf348d33c9659f69e434f7b5dbcacf0aaf22cb1573885c9d6637b1f620b1c685b0133a1bc53004170d5efc07cc0cb6779c91e4230607505bd95f
7
- data.tar.gz: 78bf046e3f95bf8a2bb3c61a56cd6df1b2a9611daa7290c1552e8f003397f496a4c39ff646c47205d224525443ac5a55560458781913ad5aac1951864afcbd2e
6
+ metadata.gz: 640a21c444cc3f90ddbf518f96b57d4b065534e77fb2ae07ac8b8661f2c10187c35685afa41f021e28a8a1d467cd03a06a00358b10809e4e8bf96d1c6e9b3e8d
7
+ data.tar.gz: e119908d501e8592d31986a5bbb8298a3ff74fe1a24a86d14fb89e52e92dc7e292b4ddfba01726f432b0d7d75e34f15dbbed10b109db2f5c0376418834a840a0
@@ -7,11 +7,9 @@ jobs:
7
7
  strategy:
8
8
  fail-fast: false
9
9
  matrix:
10
- # ruby_version: [head, "3.4", "3.0"]
11
- ruby_version: ["3.4"]
10
+ ruby_version: [head, "3.4", "3.1"]
12
11
  gemfile:
13
12
  - Gemfile
14
- # exclude:
15
13
  runs-on: ubuntu-latest
16
14
 
17
15
  steps:
@@ -21,11 +19,5 @@ jobs:
21
19
  with:
22
20
  ruby-version: ${{ matrix.ruby_version }}
23
21
  bundler-cache: true # 'bundle install' and cache
24
- # - name: Bundle install
25
- # run: |
26
- # bundle config set frozen false
27
- # bundle config path /home/runner/bundle
28
- # bundle install
29
- # bundle update
30
22
  - name: Build and test with Rake
31
23
  run: bundle exec rake
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- confi (0.1.1)
4
+ confi (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -26,7 +26,7 @@ gem "confi"
26
26
  ...
27
27
  ~~~~
28
28
 
29
- ## Usage
29
+ ## Usage (global Confi)
30
30
 
31
31
  ~~~~ruby
32
32
  require "confi"
@@ -39,20 +39,36 @@ end
39
39
  ...
40
40
  ~~~~
41
41
 
42
+
43
+ ## Configure (initialization)
44
+
45
+ ~~~~ruby
46
+ Confi.configure(hash)
47
+ ~~~~
48
+
49
+ ~~~~ruby
50
+ Confi.configure do |s|
51
+ s.option = :active
52
+ s.name = "name"
53
+ end
54
+ ~~~~
55
+
56
+
57
+ ## Usage (in instances)
58
+
42
59
  ~~~~ruby
43
60
  require "confi"
44
61
 
45
- class User
46
- include Confi
62
+ class User # a sample
63
+ include Confi
47
64
  end
48
65
  ...
66
+ # create instance
49
67
  user = User.new
68
+
69
+ # Functionality same as with Confi; use instance name
50
70
  user.debug = false
51
71
  ...
52
- if user.debug
53
- ...
54
- end
55
- ...
56
72
  ~~~~
57
73
 
58
74
  ~~~~ruby
data/confi.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # $LOAD_PATH.push File.expand_path("lib", __dir__)
2
2
 
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "confi"
data/lib/confi.rb CHANGED
@@ -12,16 +12,16 @@ module Confi
12
12
 
13
13
  def dump
14
14
  res = {}
15
- @keys.uniq.each { |key| res[key] = send(key) }
15
+ @co_keys.uniq.each { |key| res[key] = send(key) }
16
16
  res
17
17
  end
18
18
 
19
19
  def accessors(key, value)
20
- @keys ||= []
21
- @keys << key.to_sym
20
+ @co_keys ||= []
21
+ @co_keys << key.to_sym
22
22
  name = key.to_s
23
23
  writer = "#{name}="
24
- var_name = "@AWE_#{name}"
24
+ var_name = "@CO_#{name}"
25
25
 
26
26
  self.class.class_eval <<-RUBY, __FILE__, __LINE__ + 1
27
27
  def #{name}; #{var_name}; end
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall