marameters 0.9.0 → 1.0.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 +12 -3
- data/lib/marameters/categorizer.rb +2 -2
- data/lib/marameters/probe.rb +3 -1
- data/lib/marameters.rb +1 -1
- data/marameters.gemspec +3 -3
- data.tar.gz.sig +0 -0
- metadata +6 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82aa36d02b80fca6ee621275465c9a30c031e6021272e96c54fb033bf92cb7f0
|
4
|
+
data.tar.gz: 4f3e57de60b7bf3732a279c12526c64947ff40dad910d2bcbcb85e3d49a3aa6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ddf1a3249553afe0b90b75007b2f03abcaab6e38494117b951809524675b8132d63cad70829fb9f606365dd806d2f1f98885a063b848d7d835a723c27345774
|
7
|
+
data.tar.gz: 7104d97b6256f74787f8858d8c57ade23735a3a0f9c57c3243fbd9b757f5373779b11262c71b69754f94d26f8a159655607d2dcadec440bd666d4485e4f4f7c7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -44,7 +44,7 @@ gem "marameters"
|
|
44
44
|
|
45
45
|
== Usage
|
46
46
|
|
47
|
-
At a high level, you can use `Marameters` as a single
|
47
|
+
At a high level, you can use `Marameters` as a single Object API for accessing all capabilities provided by this gem. Here's an overview:
|
48
48
|
|
49
49
|
[source,ruby]
|
50
50
|
----
|
@@ -63,7 +63,7 @@ Marameters.categorize parameters, arguments
|
|
63
63
|
|
64
64
|
Marameters.of self, :demo # []
|
65
65
|
|
66
|
-
probe = Marameters.
|
66
|
+
probe = Marameters.for parameters
|
67
67
|
probe.to_a # [[:req, :one], [:opt, :two], [:key, :three]]
|
68
68
|
probe.positionals # [:one, :two]
|
69
69
|
probe.keywords # [:three]
|
@@ -79,7 +79,7 @@ Read on to learn more about the details on how each of these methods work and th
|
|
79
79
|
|
80
80
|
=== Probe
|
81
81
|
|
82
|
-
The probe allows you to analyze a method's parameters. To understand how, consider the following
|
82
|
+
The probe allows you to analyze a method's parameters. To understand how, consider the following:
|
83
83
|
|
84
84
|
[source,ruby]
|
85
85
|
----
|
@@ -383,6 +383,15 @@ puts Example.say "Hello"
|
|
383
383
|
|
384
384
|
== Development
|
385
385
|
|
386
|
+
To contribute, run:
|
387
|
+
|
388
|
+
[source,bash]
|
389
|
+
----
|
390
|
+
git clone https://github.com/bkuhlmann/marameters
|
391
|
+
cd marameters
|
392
|
+
bin/setup
|
393
|
+
----
|
394
|
+
|
386
395
|
You can also use the IRB console for direct access to all objects:
|
387
396
|
|
388
397
|
[source,bash]
|
@@ -34,8 +34,8 @@ module Marameters
|
|
34
34
|
|
35
35
|
def filter pair, value
|
36
36
|
case pair
|
37
|
-
in [:rest
|
38
|
-
in [:keyrest
|
37
|
+
in [:rest, :*] then splat_positional value
|
38
|
+
in [:keyrest, :**] then record.keywords = Hash value
|
39
39
|
in [:req, *] | [:opt, *] then record.positionals.append value
|
40
40
|
in [:rest, *] then record.positionals.append(*value)
|
41
41
|
in [:nokey] then nil
|
data/lib/marameters/probe.rb
CHANGED
@@ -45,7 +45,9 @@ module Marameters
|
|
45
45
|
|
46
46
|
def names = parameters.map { |_kind, name| name }
|
47
47
|
|
48
|
-
def only_bare_splats?
|
48
|
+
def only_bare_splats?
|
49
|
+
parameters in [[:rest, :*]] | [[:keyrest, :**]] | [[:rest, :*], [:keyrest, :**]]
|
50
|
+
end
|
49
51
|
|
50
52
|
def only_double_splats? = (parameters in [[:keyrest, *]])
|
51
53
|
|
data/lib/marameters.rb
CHANGED
data/marameters.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "marameters"
|
5
|
-
spec.version = "0.
|
5
|
+
spec.version = "1.0.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://www.alchemists.io/projects/marameters"
|
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.signing_key = Gem.default_key_path
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
24
24
|
|
25
|
-
spec.required_ruby_version = "~> 3.
|
26
|
-
spec.add_dependency "refinements", "~>
|
25
|
+
spec.required_ruby_version = "~> 3.2"
|
26
|
+
spec.add_dependency "refinements", "~> 10.0"
|
27
27
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
28
28
|
|
29
29
|
spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marameters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
|
29
29
|
RFE=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2022-
|
31
|
+
date: 2022-12-25 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: refinements
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '10.0'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '10.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: zeitwerk
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,14 +96,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
requirements:
|
97
97
|
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: '3.
|
99
|
+
version: '3.2'
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.4.1
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Provides dynamic method parameter construction and deconstruction.
|
metadata.gz.sig
CHANGED
Binary file
|