initable 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +3 -4
- data/initable.gemspec +1 -1
- data/lib/initable/builder.rb +3 -7
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96778d9b0314485a1c240e2c5ef7867df42092d4f906e794ec54097de2c6de93
|
4
|
+
data.tar.gz: 6b3619194eb1d9767e80ad31e13a7037fe10542c7b497a14df77ad7f04dade71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
data/lib/initable/builder.rb
CHANGED
@@ -50,13 +50,9 @@ module Initable
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def define_readers ancestor
|
53
|
-
|
54
|
-
|
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.
|
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-
|
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.
|
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