dsl_compose 2.2.2 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +6 -0
- data/lib/dsl_compose/parser/for_children_of_parser/for_dsl_parser.rb +10 -0
- data/lib/dsl_compose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fab8958e567edd7044bfef529f74c21930c7c1fba06bfd359d905249fc2d17c
|
4
|
+
data.tar.gz: a167ad2aaaf44b226b2884ee0f4d6447444ebe0629453ca5f288430c5198e683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcd2f5ff1b501cffd445d937f4a96e158250e8e76e48969d54760511dc339dc90e0d7d1d3f4f2ed5a14ffc0eafe037a8833122a0f649c071a8188e1819901bb4
|
7
|
+
data.tar.gz: e1df9014ea4b8a20db709e44284ce320a92808085aee70004a4bac19609fad866f271426e2e86c7ec46919f21795f55c91411b1404f73cfd0349544ef71ee408
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [2.3.0](https://github.com/craigulliott/dsl_compose/compare/v2.2.2...v2.3.0) (2023-07-28)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* added a method_called? helper method to the DSL parser ([48e68a8](https://github.com/craigulliott/dsl_compose/commit/48e68a8d799e297d3433f3d2a6bccb7a077dd9af))
|
9
|
+
|
3
10
|
## [2.2.2](https://github.com/craigulliott/dsl_compose/compare/v2.2.1...v2.2.2) (2023-07-27)
|
4
11
|
|
5
12
|
|
data/README.md
CHANGED
@@ -286,6 +286,12 @@ class MyParser < DSLCompose::Parser
|
|
286
286
|
other than making calls to `for_method`
|
287
287
|
DESCRIPTION
|
288
288
|
|
289
|
+
# Within a `for_dsl` block you can determine if a specific DSL method was used
|
290
|
+
# with the `method_called?` method. This method will return true if the method was
|
291
|
+
# used, otherwise it will return false. If a method with the provided name does not
|
292
|
+
# exist for the DSL, then an error will be raised.
|
293
|
+
was_some_method_name_used = method_called? :some_method_name
|
294
|
+
|
289
295
|
# `for_method` accepts a method name or an array of method names and will
|
290
296
|
# yield it's provided block once for each time a method with this name is
|
291
297
|
# executed within the DSL.
|
@@ -109,6 +109,16 @@ module DSLCompose
|
|
109
109
|
ForMethodParser.new(@base_class, @child_class, @dsl_execution, method_names, &block)
|
110
110
|
end
|
111
111
|
|
112
|
+
# Given a method name, will return true if the method was called within the current DSL
|
113
|
+
# execution, otherwise it will return false
|
114
|
+
def method_called? method_name
|
115
|
+
# get the dsl method from the current dsl execution, this
|
116
|
+
# will raise an error if the method does not exist
|
117
|
+
dsl_method = @dsl_execution.dsl.dsl_method(method_name)
|
118
|
+
# was this method called within the current DSL execution?
|
119
|
+
@dsl_execution.method_calls.method_called? dsl_method.name
|
120
|
+
end
|
121
|
+
|
112
122
|
# takes a description of what this parser does and stores it against the DSL definition
|
113
123
|
# of the current @child_class, this is used to generate documentation for what the parser
|
114
124
|
# has done with the DSL
|
data/lib/dsl_compose/version.rb
CHANGED
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.
|
4
|
+
version: 2.3.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-
|
11
|
+
date: 2023-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: class_spec_helper
|