dsl_compose 2.3.0 → 2.4.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: 4fab8958e567edd7044bfef529f74c21930c7c1fba06bfd359d905249fc2d17c
4
- data.tar.gz: a167ad2aaaf44b226b2884ee0f4d6447444ebe0629453ca5f288430c5198e683
3
+ metadata.gz: 43cfe766f3e464ba7f5a22128e7f5155806f92686555aef5f2f06af2b58916af
4
+ data.tar.gz: 999dc31a662af4684b2956a50c226aa596b345ece609d2b9ace058eea211f924
5
5
  SHA512:
6
- metadata.gz: fcd2f5ff1b501cffd445d937f4a96e158250e8e76e48969d54760511dc339dc90e0d7d1d3f4f2ed5a14ffc0eafe037a8833122a0f649c071a8188e1819901bb4
7
- data.tar.gz: e1df9014ea4b8a20db709e44284ce320a92808085aee70004a4bac19609fad866f271426e2e86c7ec46919f21795f55c91411b1404f73cfd0349544ef71ee408
6
+ metadata.gz: 78b2add3e95f52ae184abb3d2a30f9218d966a8d44e378b72ea37c5ad2dfd6c3409f7a9cf08e4762d17cf717c2ff35c2f7da4ce5a28d8959eacbcf92c484c0db
7
+ data.tar.gz: 7d4e1550f001a40d0665c6258eff2cd16d0052f209b1c6741a3252b0623f698345d8344014555153649dd705077dda8cc39d08531bb95bd5df4611cde257c156
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.4.0](https://github.com/craigulliott/dsl_compose/compare/v2.3.0...v2.4.0) (2023-07-31)
4
+
5
+
6
+ ### Features
7
+
8
+ * access an ExecutionReader object from within a parser ([53e9c29](https://github.com/craigulliott/dsl_compose/commit/53e9c29073389217d8526c43eec67325587c45b9))
9
+
3
10
  ## [2.3.0](https://github.com/craigulliott/dsl_compose/compare/v2.2.2...v2.3.0) (2023-07-28)
4
11
 
5
12
 
data/README.md CHANGED
@@ -274,8 +274,13 @@ class MyParser < DSLCompose::Parser
274
274
  # then the requested dsl argument must be present on all DSLs otherwise an
275
275
  # error will be raised. The parser is aware of class inheritance, and will
276
276
  # consider a DSL to have been executed on the actual class it was used, and
277
- # any classes which are descendants of that class
278
- for_dsl [:dsl1, :dsl2] do |dsl_name:, a_dsl_argument:|
277
+ # any classes which are descendants of that class.
278
+ #
279
+ # You can also request an ExecutionReader object here by including the
280
+ # argument `:reader`. The resulting reader object will allow to to access the methods
281
+ # which were called within this use of your DSL. There is more documentation about
282
+ # Reader classes below.
283
+ for_dsl [:dsl1, :dsl2] do |dsl_name:, a_dsl_argument:, reader:|
279
284
  description <<-DESCRIPTION
280
285
  You can optionally provide a description of anything specific that your parser
281
286
  does in this block, this description will be used when generating documentation.
@@ -67,9 +67,14 @@ 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
+ # the dsl name (if it's requested)
70
71
  if BlockArguments.accepts_argument?(:dsl_name, &block)
71
72
  args[:dsl_name] = dsl_execution.dsl.name
72
73
  end
74
+ # an ExecutionReader object to access the exections methods (if it's requested)
75
+ if BlockArguments.accepts_argument?(:reader, &block)
76
+ args[:reader] = Reader::ExecutionReader.new(dsl_execution)
77
+ end
73
78
  # add any arguments that were provided to the DSL
74
79
  dsl_execution.arguments.arguments.each do |name, value|
75
80
  if BlockArguments.accepts_argument?(name, &block)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DSLCompose
4
- VERSION = "2.3.0"
4
+ VERSION = "2.4.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.3.0
4
+ version: 2.4.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-07-28 00:00:00.000000000 Z
11
+ date: 2023-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: class_spec_helper