dsl_compose 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '048f2e5d2e94df09db474b6134cacb580dde9a88a751e2e0697d72234be0132e'
4
- data.tar.gz: b336eb45f722b2fbafb0f12f43d760ad1de2287eb9beffc27227d020daf5cc43
3
+ metadata.gz: 5ab97e49cd1581273bc3555e75d7610cab0764024f5c87445cf7da2f48af97d4
4
+ data.tar.gz: bc8e659445fad939868276749ae23c8e5cd3a44d7afb45989d4cd5dac4b487a2
5
5
  SHA512:
6
- metadata.gz: 412d7f101db06e26ad871a359d7d063a0086b0b2b3e8be2e96cd3b87e69ec1eb7f813c770326779e9b16c166433700b6751ecf9e8b35e568313f8350ed31fd30
7
- data.tar.gz: 551f08b45107d633abbcdc008fd13e971c41c317e17ce07e86f0035b2d1ee1ef9ddb6e23b2c1505239279d7f90c1940f22b1d111542ecc51a253b588bb101823
6
+ metadata.gz: 3e7e18eec99d3b458d1a03e5a9feff3aad70696318d706bf17064646ceeb152d45f4b0b954aef83cb5edcf501502d76821a44c2da58f88d60a91cba31ae18c70
7
+ data.tar.gz: 8412d42847af88966b8e523ccda0c37f2724d71c319b244cb1a1f206694899b0cad65e5aaf48d9252e597dd9c1afc8ae50f3bc13e6d4b0459669340f7d242dbb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.6.1](https://github.com/craigulliott/dsl_compose/compare/v2.6.0...v2.6.1) (2023-08-29)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * renaming `description` to `add_documentation` for dynamically creating documentation from within parsers ([3e24194](https://github.com/craigulliott/dsl_compose/commit/3e2419492e61d94ea7d3c1f34ef4990fc0f6682a))
9
+
3
10
  ## [2.6.0](https://github.com/craigulliott/dsl_compose/compare/v2.5.2...v2.6.0) (2023-08-23)
4
11
 
5
12
 
@@ -148,7 +148,6 @@ module DSLCompose
148
148
  else
149
149
  optional_arg_value
150
150
  end
151
-
152
151
  rescue => e
153
152
  raise e, "Error processing optional argument #{optional_argument_name}: #{e.message}", e.backtrace
154
153
  end
@@ -239,7 +238,6 @@ module DSLCompose
239
238
  else
240
239
  required_arg_value
241
240
  end
242
-
243
241
  rescue => e
244
242
  raise e, "Error processing required argument #{argument_name}: #{e.message}", e.backtrace
245
243
  end
@@ -14,12 +14,12 @@ module DSLCompose
14
14
  @method_calls.filter { |mc| mc.method_name == method_name }.any?
15
15
  end
16
16
 
17
- def add_method_call dsl_method, *args, &block
17
+ def add_method_call(dsl_method, ...)
18
18
  # make sure we always have a variable which can be used in the exception message
19
19
  dsl_method_name = nil
20
20
  dsl_method_name = dsl_method.name
21
21
 
22
- method_call = MethodCall.new(dsl_method, *args, &block)
22
+ method_call = MethodCall.new(dsl_method, ...)
23
23
  @method_calls << method_call
24
24
  method_call
25
25
  rescue => e
@@ -59,7 +59,7 @@ module DSLCompose
59
59
  private
60
60
 
61
61
  # catch and process any method calls within the DSL block
62
- def method_missing method_name, *args, &block
62
+ def method_missing(method_name, ...)
63
63
  # if the method does not exist, then this will raise a MethodDoesNotExistError
64
64
  dsl_method = @dsl.dsl_method method_name
65
65
 
@@ -68,7 +68,7 @@ module DSLCompose
68
68
  raise MethodIsUniqueError, "This method `#{method_name}` is unique and can only be called once within this DSL"
69
69
  end
70
70
 
71
- @method_calls.add_method_call dsl_method, *args, &block
71
+ @method_calls.add_method_call(dsl_method, ...)
72
72
  end
73
73
 
74
74
  def respond_to_missing?(method_name, *args)
@@ -40,14 +40,14 @@ module DSLCompose
40
40
  # Execute/process a dynamically defined DSL on a class.
41
41
  # `klass` is the class in which the DSL is being used, not
42
42
  # the class in which the DSL was defined.
43
- def execute_dsl klass, dsl, *args, &block
43
+ def execute_dsl(klass, dsl, ...)
44
44
  # make sure we have these variables for the exception message below
45
45
  class_name = nil
46
46
  class_name = klass.name
47
47
  dsl_name = nil
48
48
  dsl_name = dsl.name
49
49
 
50
- execution = Execution.new(klass, dsl, *args, &block)
50
+ execution = Execution.new(klass, dsl, ...)
51
51
  @executions << execution
52
52
  execution
53
53
  rescue => e
@@ -107,8 +107,8 @@ module DSLCompose
107
107
  # takes a description of what this parser does and stores it against the DSL definition
108
108
  # of the current @child_class, this is used to generate documentation for what the parser
109
109
  # has done with the DSL
110
- def description description
111
- @method_call.add_parser_usage_note description
110
+ def add_documentation documentation
111
+ @method_call.add_parser_usage_note documentation
112
112
  end
113
113
  end
114
114
  end
@@ -142,8 +142,8 @@ module DSLCompose
142
142
  # takes a description of what this parser does and stores it against the DSL definition
143
143
  # of the current @child_class, this is used to generate documentation for what the parser
144
144
  # has done with the DSL
145
- def description description
146
- @dsl_execution.add_parser_usage_note description
145
+ def add_documentation documentation
146
+ @dsl_execution.add_parser_usage_note documentation
147
147
  end
148
148
  end
149
149
  end
@@ -125,8 +125,8 @@ module DSLCompose
125
125
  # takes a description of what this parser does and stores it against the DSL definition
126
126
  # of the current @child_class, this is used to generate documentation for what the parser
127
127
  # has done with the DSL
128
- def description description
129
- @base_class.dsls.add_parser_usage_note @child_class, description
128
+ def add_documentation documentation
129
+ @base_class.dsls.add_parser_usage_note @child_class, documentation
130
130
  end
131
131
  end
132
132
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DSLCompose
4
- VERSION = "2.6.0"
4
+ VERSION = "2.6.1"
5
5
  end
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.6.0
4
+ version: 2.6.1
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-08-23 00:00:00.000000000 Z
11
+ date: 2023-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: class_spec_helper