marameters 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82aa36d02b80fca6ee621275465c9a30c031e6021272e96c54fb033bf92cb7f0
4
- data.tar.gz: 4f3e57de60b7bf3732a279c12526c64947ff40dad910d2bcbcb85e3d49a3aa6b
3
+ metadata.gz: 412515b3ab8097e97ba8afd6a50409a7147a348dea97496f1c0890ad59898106
4
+ data.tar.gz: 93d2fdca4a29bfedf5c26a0b09903054ebf24166195d51d0a49844ba3483d184
5
5
  SHA512:
6
- metadata.gz: 2ddf1a3249553afe0b90b75007b2f03abcaab6e38494117b951809524675b8132d63cad70829fb9f606365dd806d2f1f98885a063b848d7d835a723c27345774
7
- data.tar.gz: 7104d97b6256f74787f8858d8c57ade23735a3a0f9c57c3243fbd9b757f5373779b11262c71b69754f94d26f8a159655607d2dcadec440bd666d4485e4f4f7c7
6
+ metadata.gz: 8aa5d6593bc252c89e9e09df31662e399f659b69a8bb480c41020d38e559fba9446412bf2ec84738f69941718721f703ddced9d69d54ed03c194cf76e4821853
7
+ data.tar.gz: 2dbe53dfa534c25b6efe55791b72bb0164702d3c3b44e2c755909f5a11787bdc7bc5ee19e6468a97a4962cc1808bbce8e0e533fbf72fa97e1ea6d9de92da01f6
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -405,7 +405,7 @@ To test, run:
405
405
 
406
406
  [source,bash]
407
407
  ----
408
- bundle exec rake
408
+ bin/rake
409
409
  ----
410
410
 
411
411
  == link:https://www.alchemists.io/policies/license[License]
@@ -34,8 +34,8 @@ module Marameters
34
34
 
35
35
  def filter pair, value
36
36
  case pair
37
- in [:rest, :*] then splat_positional value
38
- in [:keyrest, :**] then record.keywords = Hash value
37
+ in [:rest] | [:rest, :*] then splat_positional value
38
+ in [:keyrest] | [: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
@@ -46,12 +46,17 @@ module Marameters
46
46
  def names = parameters.map { |_kind, name| name }
47
47
 
48
48
  def only_bare_splats?
49
- parameters in [[:rest, :*]] | [[:keyrest, :**]] | [[:rest, :*], [:keyrest, :**]]
49
+ parameters in [[:rest]] \
50
+ | [[:keyrest]] \
51
+ | [[:rest], [:keyrest]] \
52
+ | [[:rest, :*]] \
53
+ | [[:keyrest, :**]] \
54
+ | [[:rest, :*], [:keyrest, :**]]
50
55
  end
51
56
 
52
- def only_double_splats? = (parameters in [[:keyrest, *]])
57
+ def only_double_splats? = (parameters in [[:keyrest]] | [[:keyrest, *]])
53
58
 
54
- def only_single_splats? = (parameters in [[:rest, *]])
59
+ def only_single_splats? = (parameters in [[:rest]] | [[:rest, *]])
55
60
 
56
61
  def positionals? = positionals.any?
57
62
 
@@ -2,12 +2,7 @@
2
2
 
3
3
  module Marameters
4
4
  # Captures arguments, by category, for message splatting.
5
- Splat = Struct.new :positionals, :keywords, :block, keyword_init: true do
6
- def initialize *arguments
7
- super
8
-
9
- self[:positionals] ||= []
10
- self[:keywords] ||= {}
11
- end
5
+ Splat = Struct.new :positionals, :keywords, :block do
6
+ def initialize(positionals: [], keywords: {}, block: nil) = super
12
7
  end
13
8
  end
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 = "1.0.0"
5
+ spec.version = "1.0.2"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://www.alchemists.io/projects/marameters"
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: 1.0.0
4
+ version: 1.0.2
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-12-25 00:00:00.000000000 Z
31
+ date: 2023-01-22 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: refinements
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.4.1
106
+ rubygems_version: 3.4.4
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