lono 6.1.1 → 6.1.2
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/lono/template/dsl/builder/helpers/param_helper.rb +10 -3
- data/lib/lono/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: afe49322e5d7821b70af120cb40bcac86c069124cb9d376bb4589eba6cee3dc8
|
|
4
|
+
data.tar.gz: 474b9a5234e7a5ea332f5b764281189be497f94f4cf2b667e160dfd858d731d2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2733f0680a4fee30a18f022733352953433840904b46c394eb18af312704b272462d82ad3d37e8570c5f778b12f848631cd6a9bca7b51a2b8b4ac80cbbbb268e
|
|
7
|
+
data.tar.gz: 5437718228848a4f27d951ca04a0bf84618d14b5c8e542f425d1caea2d57c2197dde9a05ffd7f8d7214c0d4f523a5fa416d7b9a57816cc1e184acce204d561f2
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
|
5
5
|
|
|
6
|
+
## [6.1.2]
|
|
7
|
+
- #20 improve param Conditional form with 3rd form
|
|
8
|
+
|
|
6
9
|
## [6.1.1]
|
|
7
10
|
- #19 fix param Conditional option
|
|
8
11
|
|
|
@@ -3,7 +3,8 @@ module Lono::Template::Dsl::Builder::Helpers
|
|
|
3
3
|
module ParamHelper
|
|
4
4
|
# Decorate the parameter method to make smarter.
|
|
5
5
|
def parameter(*definition)
|
|
6
|
-
name, second,
|
|
6
|
+
name, second, third = definition
|
|
7
|
+
create_condition = true
|
|
7
8
|
# medium form
|
|
8
9
|
if definition.size == 2 && second.is_a?(Hash) && second[:Conditional]
|
|
9
10
|
# Creates:
|
|
@@ -13,10 +14,16 @@ module Lono::Template::Dsl::Builder::Helpers
|
|
|
13
14
|
#
|
|
14
15
|
options = normalize_conditional_parameter_options(second)
|
|
15
16
|
super(name, options)
|
|
16
|
-
|
|
17
|
+
elsif definition.size == 3 && !second.is_a?(Hash) && third.is_a?(Hash)
|
|
18
|
+
options = normalize_conditional_parameter_options(third)
|
|
19
|
+
options[:Default] = second # probably a String, Integer, or Float
|
|
20
|
+
super(name, options)
|
|
17
21
|
else
|
|
18
22
|
super
|
|
23
|
+
create_condition = false
|
|
19
24
|
end
|
|
25
|
+
|
|
26
|
+
condition("Has#{name}", not!(equals(ref(name), ""))) if create_condition
|
|
20
27
|
end
|
|
21
28
|
|
|
22
29
|
# use long name to minimize method name collision
|
|
@@ -24,7 +31,7 @@ module Lono::Template::Dsl::Builder::Helpers
|
|
|
24
31
|
if options.is_a?(Hash)
|
|
25
32
|
options.delete(:Conditional)
|
|
26
33
|
options = if options.empty?
|
|
27
|
-
""
|
|
34
|
+
{ Default: "" }
|
|
28
35
|
else
|
|
29
36
|
defaults = { Default: "" }
|
|
30
37
|
options.reverse_merge(defaults)
|
data/lib/lono/version.rb
CHANGED