dsl_compose 2.5.2 → 2.6.0

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: 9530f024d2b46df98c44f9a5835a9a2492d8ed61af9542e36482323295aed93a
4
- data.tar.gz: 241b93305870e0a6e205f3535df506b89b4a548c5d202e94b6242c6e5952a937
3
+ metadata.gz: '048f2e5d2e94df09db474b6134cacb580dde9a88a751e2e0697d72234be0132e'
4
+ data.tar.gz: b336eb45f722b2fbafb0f12f43d760ad1de2287eb9beffc27227d020daf5cc43
5
5
  SHA512:
6
- metadata.gz: d025d6a6245c6e9e93f9727b7dde6cc7fd5ac66684bd3d17ba6c952b876aa3a6f41deb9d383324f7a5f7f3f32685be5b0f034fd6351e5852ea4064f0a8912019
7
- data.tar.gz: 79c467dde765e402b90439d003ef00c5509d0b50658d41ada8c6c344ee4fb986e68c679b7cfb643d0bf90255f41a505a1e65706f1adec7fe7aa38d74b6295818
6
+ metadata.gz: 412d7f101db06e26ad871a359d7d063a0086b0b2b3e8be2e96cd3b87e69ec1eb7f813c770326779e9b16c166433700b6751ecf9e8b35e568313f8350ed31fd30
7
+ data.tar.gz: 551f08b45107d633abbcdc008fd13e971c41c317e17ce07e86f0035b2d1ee1ef9ddb6e23b2c1505239279d7f90c1940f22b1d111542ecc51a253b588bb101823
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.6.0](https://github.com/craigulliott/dsl_compose/compare/v2.5.2...v2.6.0) (2023-08-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * optionally request an object containing all the dsl and dsl method args from within the parser ([8abfd64](https://github.com/craigulliott/dsl_compose/commit/8abfd64131e37f620a9443466028c5a81b6f5377))
9
+
3
10
  ## [2.5.2](https://github.com/craigulliott/dsl_compose/compare/v2.5.1...v2.5.2) (2023-08-17)
4
11
 
5
12
 
@@ -83,6 +83,17 @@ module DSLCompose
83
83
  end
84
84
  end
85
85
 
86
+ # a hash representation of all the method arguments, if requested
87
+ if BlockArguments.accepts_argument?(:method_arguments, &block)
88
+ args[:method_arguments] = {}
89
+ # process each argument, because we might need to coerce it
90
+ method_call.arguments.arguments.each do |name, value|
91
+ # if this value is a ClassCoerce object, then convert it from its original
92
+ # string value to a class
93
+ args[:method_arguments][name] = value.is_a?(ClassCoerce) ? value.to_class : value
94
+ end
95
+ end
96
+
86
97
  # set the method_call in an instance variable so that method calls to `description`
87
98
  # from within the block will have access to it
88
99
  @method_call = method_call
@@ -67,14 +67,28 @@ module DSLCompose
67
67
  # us to use keyword arguments to force a naming convention on these arguments
68
68
  # and to validate their use
69
69
  args = {}
70
+
70
71
  # the dsl name (if it's requested)
71
72
  if BlockArguments.accepts_argument?(:dsl_name, &block)
72
73
  args[:dsl_name] = dsl_execution.dsl.name
73
74
  end
75
+
76
+ # a hash representation of all the dsl arguments, if requested
77
+ if BlockArguments.accepts_argument?(:dsl_arguments, &block)
78
+ args[:dsl_arguments] = {}
79
+ # process each argument, because we might need to coerce it
80
+ dsl_execution.arguments.arguments.each do |name, value|
81
+ # if this value is a ClassCoerce object, then convert it from its original
82
+ # string value to a class
83
+ args[:dsl_arguments][name] = value.is_a?(ClassCoerce) ? value.to_class : value
84
+ end
85
+ end
86
+
74
87
  # an ExecutionReader object to access the exections methods (if it's requested)
75
88
  if BlockArguments.accepts_argument?(:reader, &block)
76
89
  args[:reader] = Reader::ExecutionReader.new(dsl_execution)
77
90
  end
91
+
78
92
  # add any arguments that were provided to the DSL
79
93
  dsl_execution.arguments.arguments.each do |name, value|
80
94
  if BlockArguments.accepts_argument?(name, &block)
@@ -83,6 +97,7 @@ module DSLCompose
83
97
  args[name] = value.is_a?(ClassCoerce) ? value.to_class : value
84
98
  end
85
99
  end
100
+
86
101
  # set the dsl_execution in an instance variable so that method calls to `for_method`
87
102
  # from within the block will have access to it
88
103
  @dsl_execution = dsl_execution
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DSLCompose
4
- VERSION = "2.5.2"
4
+ VERSION = "2.6.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsl_compose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-17 00:00:00.000000000 Z
11
+ date: 2023-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: class_spec_helper