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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 409bc8ce86ea967b4a22f675ea029b609a9bb925d8b35255dd4f0a010049f115
4
- data.tar.gz: e8d99aa8be417b6c670978dc5cf4461be8ca65dc4316b27ee840b63d82128738
3
+ metadata.gz: dc5d05054343d31af8700ec10104ef0040615583c026d5588354888092670e63
4
+ data.tar.gz: a211ab077787f947eb2337a727c516e600903b6ec5dd4dc4650d3cb16aa264bc
5
5
  SHA512:
6
- metadata.gz: a57708bdfb09d3d35cfa3b3e6a76ffa931bcf71c34c14ece5b8737079f6660fefc9596ab5d079cfbf7fed3f733896212b60f81f23a02504dccbcd89a110e01c1
7
- data.tar.gz: d87d67e5e6a1f22d49d0b8bb0642f97755f004684d8c0fa7ca1850ba3ce64e46dc016f3ab5fb21edd068e221734d2bae52c09e92f59135f94b0fabd7ac7d3356
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
 
@@ -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
- ExecutionReader.new(@dsl_defining_class.dsls.get_last_dsl_execution(@klass, @dsl_name))
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 = @dsl_defining_class.dsls.get_last_dsl_execution(@klass, @dsl_name)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DSLCompose
4
- VERSION = "2.2.0"
4
+ VERSION = "2.2.1"
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: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott