initable 0.1.0 → 0.2.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: d077a6ae86ec556acd9cb1bb729502462f1f854a81038ab425b1785cea02953f
4
- data.tar.gz: 758d05271874c63d0d050126e83b79faf3e84376642c19842ee2ee58542185f4
3
+ metadata.gz: 96778d9b0314485a1c240e2c5ef7867df42092d4f906e794ec54097de2c6de93
4
+ data.tar.gz: 6b3619194eb1d9767e80ad31e13a7037fe10542c7b497a14df77ad7f04dade71
5
5
  SHA512:
6
- metadata.gz: f9aaf8054d7ce64c1d0ea29c4f1c8fd068cd5d634adad82da5720483962ce8a248f97528e1f3f54477920b0f12a4c6f7c9ab7c9e0f3183dcdf6e81394b76833f
7
- data.tar.gz: fc56bac11899b0042df1ebe715683bd680f82aceb849e51561e9c57f23c696aa5a55b7049257bae02458d914e642a8e3bc1ef2157ad7feb0cc2ae28e001226ff
6
+ metadata.gz: ddabf5ef26a500fd501f59a89a6a7dc370b00136206737a14f534ee72fb7dce5ce58848b7c03985952c66212e6d53cfa1ce8882acefd7d36ca23befb1f070acc
7
+ data.tar.gz: 65e7d06a70d8f00f24b5b3edc7b4ccaf6672e7a357533c38991f7f4ea1619c5a9411b673f26d95444ba5530642e03c1ed0a339d4eeba2bdd47091e4cd7c1252c
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -335,12 +335,11 @@ demo.new
335
335
 
336
336
  Notice, for the `one` optional positional parameter, we get a default value of `"One"` once evaluated. For the `two` optional keyword parameter, we get a new instance of `Object` as a default value.
337
337
 
338
- ⚠️ There a few caveats to be aware of when using proc-based defaults:
338
+ ⚠️ There a few caveats to be aware of when using defaults:
339
339
 
340
340
  * Use procs because lambdas will throw a `TypeError`.
341
- * Use procs _with no arguments_ because only the body of the `Proc` is meant to be parsed. Otherwise, you'll get an `ArgumentError`.
342
- * Ensure each parameter -- with a default -- is defined on a distinct line because the body of the `Proc` is extracted at runtime from the source location of the `Proc`. The goal is to improve upon this further once Ruby supports source location with line start, line end, column start, and column end information.
343
- * Avoid using C-based primitives since source code can't be obtained and you'll get a `StandardError`.
341
+ * Use procs _with no arguments_ because only the body of the `Proc` is parsed. Otherwise, you'll get an `ArgumentError`.
342
+ * Ensure each parameter -- with a default -- is defined on a distinct line because the body of the `Proc` is extracted at runtime from the source location of the `Proc`. The goal is to improve upon this further once Ruby link:https://bugs.ruby-lang.org/issues/21005[adds] source location with line start, line end, column start, and column end information.
344
343
 
345
344
  === Barewords
346
345
 
data/initable.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "initable"
5
- spec.version = "0.1.0"
5
+ spec.version = "0.2.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/initable"
@@ -50,13 +50,9 @@ module Initable
50
50
  end
51
51
 
52
52
  def define_readers ancestor
53
- (names - ancestor.names).each do |name|
54
- symbol = name.inspect
55
-
56
- instance_module.module_eval <<-READERS, __FILE__, __LINE__ + 1
57
- #{compute_scope} attr_reader #{symbol}
58
- READERS
59
- end
53
+ instance_module.module_eval <<-READERS, __FILE__, __LINE__ + 1
54
+ #{compute_scope} attr_reader(*#{names - ancestor.names})
55
+ READERS
60
56
  end
61
57
 
62
58
  def compute_scope = METHOD_SCOPES.include?(scope) ? scope : :private
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: initable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -34,7 +34,7 @@ cert_chain:
34
34
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
35
35
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
36
36
  -----END CERTIFICATE-----
37
- date: 2025-01-10 00:00:00.000000000 Z
37
+ date: 2025-02-05 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: marameters
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirements: []
91
- rubygems_version: 3.6.2
91
+ rubygems_version: 3.6.3
92
92
  specification_version: 4
93
93
  summary: An automatic object initializer.
94
94
  test_files: []
metadata.gz.sig CHANGED
@@ -1 +1,5 @@
1
- cg��Mk %
1
+ ���*;4�!��yl�U!\���3������3ZoG-�ʫ�$1��M{�ҡiW����������S���7���Ӆ�tV��k �c!�X T
2
+ ���I����X;������/֘b\t��#����\�
3
+ ���n�_�]S�bq������x�K�:��eE�X�>�3��<j
4
+ ,
5
+ p�c�����}��Ʉ2���!O�����3gl�Ү�Ǚ��U��=����\�[B/s�������/r��n@��4��{Tr�&��ia�