dsl_compose 2.1.0 → 2.1.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/README.md +3 -3
- data/lib/dsl_compose/reader/execution_reader.rb +2 -0
- data/lib/dsl_compose/reader.rb +10 -4
- data/lib/dsl_compose/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 826d148f5440924eeea1a56699ec7f6a421dcf5fe273012e7e9cf9010ab4cb66
|
4
|
+
data.tar.gz: 0fa06d0fcf99bea843da3b3b5cb66f196be88a923287ba4df64459e6289f7054
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4bcce09e0c5b3028c97ac09dbd16a6481ed8514857e7bcaecbbe7b40aebec22b8d7b4220f299380363dd9b87de9c0585fa456d8c70c031e967d3e6048711b60
|
7
|
+
data.tar.gz: 20eb3288cafb32aafddc8efe78e2e8fba5cf088c1896b5a9e82eb42e21c63c84d6e2536888d5e938f9f4b9bc80d064bfb5e95ca2fdb410316707f0362e0bf6cf
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [2.1.1](https://github.com/craigulliott/dsl_compose/compare/v2.1.0...v2.1.1) (2023-07-26)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* fixed bug where Execution classes were being returned from within the Reader but ExecutionReader classes were expected ([#56](https://github.com/craigulliott/dsl_compose/issues/56)) ([546cdaf](https://github.com/craigulliott/dsl_compose/commit/546cdaf323f3fc3be6ad09a47e5f99c3a59a50e2))
|
9
|
+
|
3
10
|
## [2.1.0](https://github.com/craigulliott/dsl_compose/compare/v2.0.1...v2.1.0) (2023-07-24)
|
4
11
|
|
5
12
|
|
data/README.md
CHANGED
@@ -168,7 +168,7 @@ You can use `import_shared` anywhere within your DSL definition, you can even us
|
|
168
168
|
Child classes can then use your new DSL
|
169
169
|
|
170
170
|
```ruby
|
171
|
-
class Bar
|
171
|
+
class Bar < Foo
|
172
172
|
|
173
173
|
your_dsl :first_dsl_argument, do
|
174
174
|
your_method "first_method_argument", optional_argument: 123
|
@@ -239,7 +239,7 @@ A parser class can be used to process complicated DSLs. In the example below, a
|
|
239
239
|
|
240
240
|
```ruby
|
241
241
|
# create your own parser by creating a new class which extends DSLCompose::Parser
|
242
|
-
MyParser < DSLCompose::Parser
|
242
|
+
class MyParser < DSLCompose::Parser
|
243
243
|
# `for_children_of` will process SomeBaseClass and yield the provided
|
244
244
|
# block once for every class which extends SomeBaseClass.
|
245
245
|
#
|
@@ -312,7 +312,7 @@ MyParser < DSLCompose::Parser
|
|
312
312
|
end
|
313
313
|
```
|
314
314
|
|
315
|
-
In addition to parser classes (or as a useful tool within parser classes) you can access the results of DSL execution
|
315
|
+
In addition to parser classes (or as a useful tool within parser classes) you can access the results of DSL execution with a Reader class.
|
316
316
|
|
317
317
|
```ruby
|
318
318
|
# Create a new Reader object.
|
data/lib/dsl_compose/reader.rb
CHANGED
@@ -51,13 +51,15 @@ module DSLCompose
|
|
51
51
|
# and look for the last time it was executed on each ancestor.
|
52
52
|
# If no execution of the DSL is found, then nil will be returned
|
53
53
|
def last_execution
|
54
|
-
@dsl_defining_class.dsls.get_last_dsl_execution
|
54
|
+
ExecutionReader.new(@dsl_defining_class.dsls.get_last_dsl_execution(@klass, @dsl_name))
|
55
55
|
end
|
56
56
|
|
57
57
|
# Returns an array of ExecutionReaders to represent each time the DSL was used
|
58
58
|
# on the provided class.
|
59
59
|
def executions
|
60
|
-
@dsl_defining_class.dsls.class_dsl_executions
|
60
|
+
@dsl_defining_class.dsls.class_dsl_executions(@klass, @dsl_name, true, false).map do |execution|
|
61
|
+
ExecutionReader.new execution
|
62
|
+
end
|
61
63
|
end
|
62
64
|
|
63
65
|
# Returns an array of ExecutionReaders to represent each time the DSL was used
|
@@ -66,7 +68,9 @@ module DSLCompose
|
|
66
68
|
# earliest ancestor first and if the DSL was used more than once on a class then
|
67
69
|
# the order they were used.
|
68
70
|
def ancestor_executions
|
69
|
-
@dsl_defining_class.dsls.class_dsl_executions
|
71
|
+
@dsl_defining_class.dsls.class_dsl_executions(@klass, @dsl_name, false, true).map do |execution|
|
72
|
+
ExecutionReader.new execution
|
73
|
+
end
|
70
74
|
end
|
71
75
|
|
72
76
|
# Returns an array of ExecutionReaders to represent each time the DSL was used
|
@@ -74,7 +78,9 @@ module DSLCompose
|
|
74
78
|
# be returned in the order they were executed, which is the earliest ancestor first
|
75
79
|
# and if the DSL was used more than once on a class then the order they were used.
|
76
80
|
def all_executions
|
77
|
-
@dsl_defining_class.dsls.class_dsl_executions
|
81
|
+
@dsl_defining_class.dsls.class_dsl_executions(@klass, @dsl_name, true, true).map do |execution|
|
82
|
+
ExecutionReader.new execution
|
83
|
+
end
|
78
84
|
end
|
79
85
|
end
|
80
86
|
end
|
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.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig Ulliott
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: class_spec_helper
|
@@ -79,13 +79,13 @@ files:
|
|
79
79
|
- lib/dsl_compose/reader/execution_reader/arguments_reader.rb
|
80
80
|
- lib/dsl_compose/shared_configuration.rb
|
81
81
|
- lib/dsl_compose/version.rb
|
82
|
-
homepage:
|
82
|
+
homepage:
|
83
83
|
licenses:
|
84
84
|
- MIT
|
85
85
|
metadata:
|
86
86
|
source_code_uri: https://github.com/craigulliott/dsl_compose/
|
87
87
|
changelog_uri: https://github.com/craigulliott/dsl_compose/blob/main/CHANGELOG.md
|
88
|
-
post_install_message:
|
88
|
+
post_install_message:
|
89
89
|
rdoc_options: []
|
90
90
|
require_paths:
|
91
91
|
- lib
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubygems_version: 3.3.26
|
104
|
-
signing_key:
|
104
|
+
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Ruby gem to add dynamic DSLs to classes
|
107
107
|
test_files: []
|