Skip to content

Commit bf01754

Browse files
committed
Merge branch 'development'
2 parents cc27fdc + 973861c commit bf01754

17 files changed

+72
-32
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ sudo: required
2525
before_install:
2626
# CommandBox Keys
2727
- curl -fsSl https://downloads.ortussolutions.com/debs/gpg | sudo apt-key add -
28-
- sudo echo "deb http://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a
28+
- sudo echo "deb https://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a
2929
/etc/apt/sources.list.d/commandbox.list
3030

3131
install:
@@ -112,7 +112,7 @@ deploy:
112112
edge: true
113113
file_glob: true
114114
file: $TRAVIS_BUILD_DIR/.artifacts/$MODULE_ID/**/*
115-
release_notes_file: changelog.md
115+
release_notes_file: $TRAVIS_BUILD_DIR/changelog-latest.md
116116
name: v${TRAVIS_TAG}
117117
tag_name: v${TRAVIS_TAG}
118118
overwrite: true

box.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"ColdBox Validation",
33
"author":"Ortus Solutions <[email protected]>",
4-
"version":"2.2.0",
4+
"version":"2.3.0",
55
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbvalidation/@build.version@/[email protected]@.zip",
66
"slug":"cbvalidation",
77
"type":"modules",

build/Build.cfc

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ component{
7070
docs( argumentCollection=arguments );
7171

7272
// checksums
73-
buildChecksums();
73+
buildChecksums();
74+
75+
// Build latest changelog
76+
latestChangelog();
7477

7578
// Finalize Message
7679
print.line()
@@ -195,7 +198,28 @@ component{
195198
overwrite=true,
196199
recurse=true
197200
);
198-
}
201+
}
202+
203+
/**
204+
* Build the latest changelog file: changelog-latest.md
205+
*/
206+
function latestChangelog(){
207+
print.blueLine( "Building latest changelog..." ).toConsole();
208+
209+
if( !fileExists( variables.cwd & "changelog.md" ) ){
210+
return error( "Cannot continue building, changelog.md file doesn't exist!" );
211+
}
212+
213+
fileWrite(
214+
variables.cwd & "changelog-latest.md",
215+
fileRead( variables.cwd & 'changelog.md' ).split( '----' )[2].trim() & chr( 13 ) & chr( 10 )
216+
);
217+
218+
print
219+
.greenLine( "Latest changelog file created at `changelog-latest.md`" )
220+
.line()
221+
.line( fileRead( variables.cwd & "changelog-latest.md" ) );
222+
}
199223

200224
/********************************************* PRIVATE HELPERS *********************************************/
201225

changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
----
99

10+
## [2.3.0] => 2020-NOV-09
11+
12+
### Added
13+
14+
* New github latest changelog publish
15+
* Quote all memento keys so they can preserve their casing
16+
* Quote all metadata keys so they can preserve their casing
17+
18+
### Fixed
19+
20+
* Metadata for validations so the docs can be generated correctly
21+
22+
----
23+
1024
## [2.2.0] => 2020-JUN-02
1125

1226
### Added

models/result/ValidationError.cfc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ component accessors="true" {
131131
*/
132132
struct function getMemento(){
133133
return {
134-
message : message,
135-
field : field,
136-
rejectedValue : rejectedValue,
137-
validationType : validationType,
138-
validationData : validationData,
139-
errorMetadata : errorMetadata
134+
"message" : message,
135+
"field" : field,
136+
"rejectedValue" : rejectedValue,
137+
"validationType" : validationType,
138+
"validationData" : validationData,
139+
"errorMetadata" : errorMetadata
140140
};
141141
}
142142

models/validators/AcceptedValidator.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ component accessors="true" singleton {
5555
rejectedValue : ( isSimpleValue( arguments.targetValue ) ? arguments.targetValue : "" ),
5656
validationData : arguments.validationData
5757
};
58-
var error = validationResult.newError( argumentCollection = args ).setErrorMetadata( { max : arguments.validationData } );
58+
var error = validationResult.newError( argumentCollection = args ).setErrorMetadata( { 'max' : arguments.validationData } );
5959
validationResult.addError( error );
6060
return false;
6161
}

models/validators/AlphaValidator.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ component accessors="true" singleton {
5050
rejectedValue : ( isSimpleValue( arguments.targetValue ) ? arguments.targetValue : "" ),
5151
validationData : arguments.validationData
5252
};
53-
var error = validationResult.newError( argumentCollection = args ).setErrorMetadata( { max : arguments.validationData } );
53+
var error = validationResult.newError( argumentCollection = args ).setErrorMetadata( { 'max' : arguments.validationData } );
5454
validationResult.addError( error );
5555
return false;
5656
}

models/validators/DiscreteValidator.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ component accessors="true" singleton {
107107
var error = validationResult
108108
.newError( argumentCollection = args )
109109
.setErrorMetadata( {
110-
operation : operation,
111-
operationValue : operationValue
110+
'operation' : operation,
111+
'operationValue' : operationValue
112112
} );
113113
validationResult.addError( error );
114114
}

models/validators/MaxValidator.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ component accessors="true" singleton {
5050
rejectedValue : ( isSimpleValue( arguments.targetValue ) ? arguments.targetValue : "" ),
5151
validationData : arguments.validationData
5252
};
53-
var error = validationResult.newError( argumentCollection = args ).setErrorMetadata( { max : arguments.validationData } );
53+
var error = validationResult.newError( argumentCollection = args ).setErrorMetadata( { 'max' : arguments.validationData } );
5454
validationResult.addError( error );
5555
return false;
5656
}

models/validators/MethodValidator.cfc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ component accessors="true" singleton {
1919
/**
2020
* Will check if an incoming value validates
2121
*
22-
* @validationResultThe result object of the validation
23-
* @targetThe target object to validate on
24-
* @fieldThe field on the target object to validate on
25-
* @targetValueThe target value to validate
26-
* @validationDataThe validation data the validator was created with
22+
* @validationResult The result object of the validation
23+
* @target The target object to validate on
24+
* @field The field on the target object to validate on
25+
* @targetValue The target value to validate
26+
* @validationData The validation data the validator was created with
2727
*/
2828
boolean function validate(
2929
required any validationResult,

0 commit comments

Comments
 (0)