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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cb2c822a8b9538706989731334fe26334b83e65a59d2e9ecb124f90683273ed
4
- data.tar.gz: e82f983c0bb311bf57458546e8539842f6ba722252f64d200b39467b0045994d
3
+ metadata.gz: f8b82032e4bea7187d0dd4a00528472ce1a5b29d4aea64b94d6090b8d013b47b
4
+ data.tar.gz: 628dda5efddcfdc2b9de8df09245c5af67c233de24dee7654d7266b193b6ef95
5
5
  SHA512:
6
- metadata.gz: fe00a6f40481346f1eea34ed6f864dd70661d7bfb70753bd2142d793f3c5bf93f2999521cbcb19ddf3082bf11bac8613f2424fa5f4de2edf3345c13d12984ad6
7
- data.tar.gz: ad22470dd58fc30f6c5e2918afd60e3c6e22fea32dbee021fbb93aeabaa21a58de61e78c92d90d1399c9142e8d836375722efe21e5094df7135ba0bfefd12584
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
 
@@ -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 dsl_interpreter singleton method already exists for this class."
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? :dsl_interpreter
33
+ if klass.respond_to? :dsls
34
34
  raise GetDSLExecutionResultsMethodAlreadyExistsError
35
35
  end
36
36
 
37
- klass.define_singleton_method :dsl_interpreter do
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DSLCompose
4
- VERSION = "1.2.0"
4
+ VERSION = "1.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsl_compose
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott