dsl_compose 1.2.0 → 1.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 +8 -0
- data/lib/dsl_compose/composer.rb +4 -4
- data/lib/dsl_compose/interpreter.rb +18 -0
- 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: f8b82032e4bea7187d0dd4a00528472ce1a5b29d4aea64b94d6090b8d013b47b
|
4
|
+
data.tar.gz: 628dda5efddcfdc2b9de8df09245c5af67c233de24dee7654d7266b193b6ef95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 670c5b83e8d8e3dd986933499d96d92604da968088b31dba613421712beb5ded7c7defec91714a1c23df1a4ba82d55a15a815864376d2ad3970a426232bb42cc
|
7
|
+
data.tar.gz: 48f76cf798a28b60efe4cf1c69d2f21c3594e86de5bbcf674d4a16f68114e76cde998a68c8dfbfbe8860362165bd9af7c37f6be3842e6efbdf9db8568ce72246
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.3.0](https://github.com/craigulliott/dsl_compose/compare/v1.2.0...v1.3.0) (2023-06-22)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* adding an executions_by_class method to make processing the configuration more convenient ([#8](https://github.com/craigulliott/dsl_compose/issues/8)) ([313507c](https://github.com/craigulliott/dsl_compose/commit/313507ca572f59c03162a91d58e62500a9464f25))
|
9
|
+
* fixing release please job ([#10](https://github.com/craigulliott/dsl_compose/issues/10)) ([880fa5b](https://github.com/craigulliott/dsl_compose/commit/880fa5b2aceed67aa9ff1e7cf53629af23e31b10))
|
10
|
+
|
3
11
|
## [1.2.0](https://github.com/craigulliott/dsl_compose/compare/v1.1.0...v1.2.0) (2023-06-22)
|
4
12
|
|
5
13
|
|
data/lib/dsl_compose/composer.rb
CHANGED
@@ -10,13 +10,13 @@ module DSLCompose
|
|
10
10
|
|
11
11
|
class MethodAlreadyExistsWithThisDSLNameError < StandardError
|
12
12
|
def message
|
13
|
-
"The define_dsl singleton method already exists for this class."
|
13
|
+
"The `define_dsl` singleton method already exists for this class."
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
class GetDSLExecutionResultsMethodAlreadyExistsError < StandardError
|
18
18
|
def message
|
19
|
-
"The
|
19
|
+
"The `dsls` singleton method already exists for this class."
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -30,11 +30,11 @@ module DSLCompose
|
|
30
30
|
interpreter = DSLCompose::Interpreter.new
|
31
31
|
|
32
32
|
# return a specific DSL which is defined for this class
|
33
|
-
if klass.respond_to? :
|
33
|
+
if klass.respond_to? :dsls
|
34
34
|
raise GetDSLExecutionResultsMethodAlreadyExistsError
|
35
35
|
end
|
36
36
|
|
37
|
-
klass.define_singleton_method :
|
37
|
+
klass.define_singleton_method :dsls do
|
38
38
|
interpreter
|
39
39
|
end
|
40
40
|
|
@@ -46,5 +46,23 @@ module DSLCompose
|
|
46
46
|
end
|
47
47
|
h
|
48
48
|
end
|
49
|
+
|
50
|
+
def executions_by_class
|
51
|
+
h = {}
|
52
|
+
executions.each do |execution|
|
53
|
+
h[execution.klass] ||= {}
|
54
|
+
h[execution.klass][execution.dsl.name] ||= []
|
55
|
+
execution_h = {
|
56
|
+
arguments: execution.arguments.to_h,
|
57
|
+
method_calls: {}
|
58
|
+
}
|
59
|
+
execution.method_calls.method_calls.each do |method_call|
|
60
|
+
execution_h[:method_calls][method_call.method_name] ||= []
|
61
|
+
execution_h[:method_calls][method_call.method_name] << method_call.to_h
|
62
|
+
end
|
63
|
+
h[execution.klass][execution.dsl.name] << execution_h
|
64
|
+
end
|
65
|
+
h
|
66
|
+
end
|
49
67
|
end
|
50
68
|
end
|
data/lib/dsl_compose/version.rb
CHANGED