dsl_compose 2.2.0 → 2.2.1
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/lib/dsl_compose/reader.rb +9 -8
- data/lib/dsl_compose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc5d05054343d31af8700ec10104ef0040615583c026d5588354888092670e63
|
4
|
+
data.tar.gz: a211ab077787f947eb2337a727c516e600903b6ec5dd4dc4650d3cb16aa264bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 438b429f3fd729f655b474c9d23a4224e41e66d6bcbfd32bf227607772a83c54a5400cb7e5dbdc947a101240ee43f8656fb1f7c4798e0a3c4218679090db00d3
|
7
|
+
data.tar.gz: 8717ba33401dcc579de9de6bb6132263ba1737e87b8820874cc5e1d161651bdffe1481d3f676fb10d1ffef8da254eaaea95a83e1c1bccc58cc16b9511428efc5
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [2.2.1](https://github.com/craigulliott/dsl_compose/compare/v2.2.0...v2.2.1) (2023-07-27)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* last_execution was raising error instead of returning nil when no executions were found ([bedef1e](https://github.com/craigulliott/dsl_compose/commit/bedef1ec606801a4507ce77c39a33d14cb79818f))
|
9
|
+
|
3
10
|
## [2.2.0](https://github.com/craigulliott/dsl_compose/compare/v2.1.1...v2.2.0) (2023-07-27)
|
4
11
|
|
5
12
|
|
data/lib/dsl_compose/reader.rb
CHANGED
@@ -66,22 +66,23 @@ module DSLCompose
|
|
66
66
|
# Returns an ExecutionReader class which exposes a simple API to access the
|
67
67
|
# arguments, methods and method arguments provided when using this DSL.
|
68
68
|
#
|
69
|
-
# If the dsl has been executed once or more on the provided class, then
|
70
|
-
# the last (most recent) execution will be returned. If the DSL was not
|
69
|
+
# If the dsl has been executed once or more on the provided class, then a reader
|
70
|
+
# for the last (most recent) execution will be returned. If the DSL was not
|
71
71
|
# executed on the provided class, then we traverse up the classes ancestors
|
72
72
|
# and look for the last time it was executed on each ancestor.
|
73
73
|
# If no execution of the DSL is found, then nil will be returned
|
74
74
|
def last_execution
|
75
|
-
|
75
|
+
execution = @dsl_defining_class.dsls.get_last_dsl_execution(@klass, @dsl_name)
|
76
|
+
if execution.nil?
|
77
|
+
nil
|
78
|
+
else
|
79
|
+
ExecutionReader.new execution
|
80
|
+
end
|
76
81
|
end
|
77
82
|
|
78
83
|
# A wrapper for last_execution which raises an error if no execution exists
|
79
84
|
def last_execution!
|
80
|
-
execution
|
81
|
-
if execution.nil?
|
82
|
-
raise NoDSLExecutionFound, "No execution of the `#{@dsl_name}` dsl was found on `#{@klass}` or any of its ancestors"
|
83
|
-
end
|
84
|
-
ExecutionReader.new execution
|
85
|
+
last_execution || (raise NoDSLExecutionFound, "No execution of the `#{@dsl_name}` dsl was found on `#{@klass}` or any of its ancestors")
|
85
86
|
end
|
86
87
|
|
87
88
|
# Returns an array of ExecutionReaders to represent each time the DSL was used
|
data/lib/dsl_compose/version.rb
CHANGED