Skip to content

Commit 94da71e

Browse files
committed
Merge branch 'development'
2 parents f652fff + c42d39c commit 94da71e

File tree

48 files changed

+857
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+857
-176
lines changed

apidocs/server.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"force":true,
3+
"jvm":{
4+
"heapSize":"1024"
5+
},
36
"openbrowser":"false",
47
"web":{
58
"http":{

build/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ java.debug=true
1111
#dependencies
1212
dependencies.dir=${basedir}/lib
1313
cfml.version=5.2.9.31
14-
cfml.loader.version=2.1.14
14+
cfml.loader.version=2.1.16
1515
cfml.cli.version=${cfml.loader.version}.${cfml.version}
1616
lucee.version=${cfml.version}
1717
lucee.config.version=5.2.4.37

build/build.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ External Dependencies:
1616
<property name="distro.groupID" value="ortussolutions" />
1717
<property name="distro.name" value="commandbox"/>
1818
<!-- Special things happen when the version and stableVersion are the same value as that signifies a "stable" build. -->
19-
<property name="commandbox.version" value="4.3.0"/>
20-
<property name="commandbox.stableVersion" value="4.3.0"/>
19+
<property name="commandbox.version" value="4.4.0"/>
20+
<property name="commandbox.stableVersion" value="4.4.0"/>
2121

2222
<!-- Time Label -->
2323
<tstamp prefix="start"/>

src/cfml/system/Quotes.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Computers are good at following instructions, but not at reading your mind.
5353
while( ! ( succeed = try() ) );
5454
Talk is cheap. Show me the code. --Linus Torvalds
5555
In theory, theory and practice are the same. In practice, they're not.
56-
Did you know CFML is the 4th most used web language according to W3Techs?
5756
There's a box for that
5857
Publish your CFML projects big and small to https://www.ForgeBox.io
5958
Quit slouching in your chair!

src/cfml/system/config/WireBox.cfc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ component extends='wirebox.system.ioc.config.Binder' {
2828

2929
// LogBox
3030
wirebox.logBoxConfig = 'commandbox.system.config.LogBox';
31-
31+
3232
wirebox.cacheBox = {
3333
enabled = true,
3434
configFile = 'commandbox.system.config.CacheBox'
3535
};
36-
36+
3737
wirebox.metadataCache='metadataCache';
3838

3939
// Register CommandBox DSL for special injection namespaces
@@ -61,6 +61,7 @@ component extends='wirebox.system.ioc.config.Binder' {
6161
var ortusArtifactsURL = 'http://downloads.ortussolutions.com/';
6262
var ortusPRDArtifactsURL = 'http://downloads.ortussolutions.com/';
6363
var colors256Data = deserializeJSON( fileRead( homedir & '/cfml/system/config/colors.json' ) );
64+
var semverRegex = '\d{1,3}(?:\.\d{1,3}){2}(?:-\w+(?:\.\w+)*)?(?:\+\w+(?:\.\w+)*)?';
6465
// engine versions, first is default - for lucee, first is internal version
6566

6667
// map constants
@@ -78,10 +79,11 @@ component extends='wirebox.system.ioc.config.Binder' {
7879
map( 'ortusPRDArtifactsURL@constants' ).toValue( ortusPRDArtifactsURL );
7980
map( 'rewritesDefaultConfig@constants' ).toValue( '#homeDir#/cfml/system/config/urlrewrite.xml' );
8081
map( 'colors256Data@constants' ).toValue( colors256Data );
82+
map( 'semverRegex@constants' ).toValue( semverRegex );
8183

8284
// Map Directories
8385
mapDirectory( '/commandbox/system/services' );
84-
mapDirectory( '/commandbox/system/util' );
86+
mapDirectory( '/commandbox/system/util' );
8587
}
8688

8789
}

src/cfml/system/endpoints/ForgeBox.cfc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ component accessors="true" implements="IEndpointInteractive" singleton {
8686

8787
// Only bother checking if we have a version range. If an exact version is stored in
8888
// box.json, we're never going to update it anyway.
89-
if( semanticVersion.isExactVersion( boxJSONversion ) ) {
89+
// UNLESS the box.json has been udpated to have a new exact version that is different from what's installed (ignoreing buildID)
90+
if( semanticVersion.isExactVersion( boxJSONversion ) && semanticVersion.compare( boxJSONversion, version, false ) == 0 ) {
9091
return result;
9192
}
9293

src/cfml/system/endpoints/Gist.cfc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
*********************************************************************************
3+
* Copyright Since 2014 CommandBox by Ortus Solutions, Corp
4+
* www.coldbox.org | www.ortussolutions.com
5+
********************************************************************************
6+
* @author Brad Wood, Luis Majano, Denny Valliant
7+
*
8+
* I am the gist endpoint
9+
*
10+
* - gist:<gistID>
11+
* - gist:<gistID>#<commit-ish>
12+
* - gist:<githubname>/<gistID>
13+
* - gist:<githubname>/<gistID>#<commit-ish>
14+
*
15+
* If no <commit-ish> is specified, then master is used.
16+
*
17+
*/
18+
component accessors=true implements="IEndpoint" extends="commandbox.system.endpoints.Git" singleton {
19+
20+
// Properties
21+
property name="namePrefixes" type="string";
22+
23+
function init() {
24+
setNamePrefixes( 'gist' );
25+
return this;
26+
}
27+
28+
private function getProtocol() {
29+
return 'https://gist.github.com/';
30+
}
31+
32+
}

src/cfml/system/endpoints/Git.cfc

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ component accessors="true" implements="IEndpoint" singleton {
3232
property name="system" inject="system@constants";
3333
property name="shell" inject="shell";
3434
property name='wirebox' inject='wirebox';
35+
property name="semanticVersion" inject="provider:semanticVersion@semver";
36+
property name='semverRegex' inject='semverRegex@constants';
3537

3638
// Properties
3739
property name="namePrefixes" type="string";
@@ -56,7 +58,7 @@ component accessors="true" implements="IEndpoint" singleton {
5658

5759
// The main Git API
5860
var Git = createObject( 'java', 'org.eclipse.jgit.api.Git' );
59-
61+
6062
var progressMonitor = createDynamicProxy(
6163
wirebox.getInstance( 'JGitProgressMonitor@package-commands' ),
6264
[ 'org.eclipse.jgit.lib.ProgressMonitor' ]
@@ -70,7 +72,7 @@ component accessors="true" implements="IEndpoint" singleton {
7072
var CommandCaller = createObject( 'java', 'com.ortussolutions.commandbox.jgit.CommandCaller' ).init();
7173

7274
try {
73-
75+
7476
// Clone the repo locally into a temp folder
7577
var cloneCommand = Git.cloneRepository()
7678
.setURI( GitURL )
@@ -80,30 +82,30 @@ component accessors="true" implements="IEndpoint" singleton {
8082

8183
// Conditionally apply security
8284
var command = secureCloneCommand( cloneCommand );
83-
// call with our special java wrapper
85+
// call with our special java wrapper
8486
local.result = CommandCaller.call( command );
85-
87+
8688
// Get a list of all branches
8789
var branchListCommand = local.result.branchList();
8890
var listModeAll = createObject( 'java', 'org.eclipse.jgit.api.ListBranchCommand$ListMode' ).ALL;
8991
var branchList = [].append( CommandCaller.call( branchListCommand.setListMode( listModeAll ) ), true );
9092
branchList = branchList.map( function( ref ){ return ref.getName(); } );
9193

92-
if( arguments.verbose ){ job.addLog( 'Available branches are #branchList.toList()#' ); }
94+
if( arguments.verbose ){ job.addLog( 'Available branches are #branchList.toList()#' ); }
95+
96+
// If the commit-ish looks like it's a branch, modify the ref's name.
97+
if( branchList.containsNoCase( branch ) ) {
98+
if( arguments.verbose ){ job.addLog( 'Commit-ish [#branch#] appears to be a branch.' ); }
99+
branch = 'origin/' & branch;
100+
}
93101

94-
// If the commit-ish looks like it's a branch, modify the ref's name.
95-
if( branchList.containsNoCase( branch ) ) {
96-
if( arguments.verbose ){ job.addLog( 'Commit-ish [#branch#] appears to be a branch.' ); }
97-
branch = 'origin/' & branch;
98-
}
102+
// Checkout branch, tag, or commit hash.
103+
CommandCaller.call( local.result.checkout().setName( branch ) );
99104

100-
// Checkout branch, tag, or commit hash.
101-
CommandCaller.call( local.result.checkout().setName( branch ) );
102-
103105
} catch( any var e ) {
104106
// Check for Ctrl-C
105107
shell.checkInterrupted();
106-
108+
107109
// If the exception came from the Java call, this exception won't be null
108110
var theRealJavaException = CommandCaller.getException();
109111

@@ -118,7 +120,7 @@ component accessors="true" implements="IEndpoint" singleton {
118120
theRealJavaException = theRealJavaException.getCause()
119121
} while( !isNull( theRealJavaException ) )
120122

121-
throw( message="Error Cloning Git repository", detail="#deepMessage#", type="endpointException");
123+
throw( message="Error cloning #getNamePrefixes()# repository", detail="#deepMessage#", type="endpointException");
122124
}
123125

124126
} finally {
@@ -170,15 +172,21 @@ component accessors="true" implements="IEndpoint" singleton {
170172
}
171173

172174
public function getUpdate( required string package, required string version, boolean verbose=false ) {
173-
var result = {
174-
// Repo URLs with a semver in the name are considered to not have an update since we assume they are an exact version
175-
isOutdated = !package
176-
.listRest( '##' )
177-
.reFindNoCase( '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ),
178-
version = 'unknown'
179-
};
175+
// Check to see if commit-ish semver exists and if so use that
176+
var versionMatch = reMatch( semverRegex, package.listRest( '##' ) );
177+
178+
if ( versionMatch.len() ) {
179+
return {
180+
isOutdated: semanticVersion.isNew( current=arguments.version, target=versionMatch.last() ),
181+
version: versionMatch.last()
182+
};
183+
}
180184

181-
return result;
185+
// Did not find a version in the commit-ish so assume package is outdated
186+
return {
187+
isOutdated: true,
188+
version: 'unknown'
189+
};
182190
}
183191

184192
// Default is no auth

src/cfml/system/endpoints/HTTP.cfc

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ component accessors=true implements="IEndpoint" singleton {
1818
property name="progressBar" inject="ProgressBar";
1919
property name="CR" inject="CR@constants";
2020
property name='wirebox' inject='wirebox';
21+
property name="semanticVersion" inject="provider:semanticVersion@semver";
22+
property name='semverRegex' inject='semverRegex@constants';
2123

2224
// Properties
2325
property name="namePrefixes" type="string";
@@ -85,17 +87,22 @@ component accessors=true implements="IEndpoint" singleton {
8587
return reReplaceNoCase( arguments.package, '[^a-zA-Z0-9]', '', 'all' );
8688
}
8789

88-
public function getUpdate( required string package, required string version, boolean verbose=false ) {
89-
var result = {
90-
// URLs with a semver in the name are considered to not have an update since we assume they are an exact version
91-
isOutdated = !package
92-
.reReplaceNoCase( 'http(s)?://', '' )
93-
.listRest( '/\' )
94-
.reFindNoCase( '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ),
95-
version = 'unknown'
96-
};
90+
public function getUpdate( required string package, required string version, boolean verbose = false ) {
91+
// Check to see if a semver exists in the URL and if so use that
92+
var versionMatch = reMatch( semverRegex, package.reReplaceNoCase( '(https?:)?//', '' ).listRest( '/\' ) );
93+
94+
if ( versionMatch.len() ) {
95+
return {
96+
isOutdated: semanticVersion.isNew( current = arguments.version, target = versionMatch.last() ),
97+
version: versionMatch.last()
98+
};
99+
}
97100

98-
return result;
101+
// Did not find a version in the URL so assume package is outdated
102+
return {
103+
isOutdated: true,
104+
version: 'unknown'
105+
};
99106
}
100107

101108
}

src/cfml/system/endpoints/Jar.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ component accessors=true implements="IEndpoint" singleton {
9696
var result = {
9797
// Jars with a semver in the name are considered to not have an update since we assume they are an exact version
9898
isOutdated = !package
99-
.reReplaceNoCase( 'http(s)?://', '' )
99+
.reReplaceNoCase( '^([\w:]+)?//', '' )
100100
.listRest( '/\' )
101101
.reFindNoCase( '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ),
102102
version = 'unknown'

src/cfml/system/endpoints/S3.cfc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ component accessors="true" implements="IEndpoint" singleton {
1818
property name="S3Service" inject="S3Service";
1919
property name="tempDir" inject="tempDir@constants";
2020
property name='wirebox' inject='wirebox';
21+
property name="semanticVersion" inject="provider:semanticVersion@semver";
22+
property name='semverRegex' inject='semverRegex@constants';
2123

2224
// Properties
2325
property name="namePrefixes" type="string";
@@ -66,7 +68,21 @@ component accessors="true" implements="IEndpoint" singleton {
6668
}
6769

6870
public function getUpdate(required string package, required string version, boolean verbose=false) {
69-
return httpsEndpoint.getUpdate(argumentCollection = arguments);
71+
// Check to see if a semver exists in the path and if so use that
72+
var versionMatch = reMatch( semverRegex, package.reReplaceNoCase( '(s3:)?//', '' ).listRest( '/\' ) );
73+
74+
if ( versionMatch.len() ) {
75+
return {
76+
isOutdated: semanticVersion.isNew( current = arguments.version, target = versionMatch.last() ),
77+
version: versionMatch.last()
78+
};
79+
}
80+
81+
// Did not find a version in the path so assume package is outdated
82+
return {
83+
isOutdated: true,
84+
version: 'unknown'
85+
};
7086
}
7187

7288
}

src/cfml/system/modules/JSONPrettyPrint/box.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name":"JSONPrettyPrint",
3-
"version":"1.3.3",
3+
"version":"1.4.1",
44
"author":"",
5-
"location":"Ortus-Solutions/JSONPrettyPrint#v1.3.3",
5+
"location":"Ortus-Solutions/JSONPrettyPrint#v1.4.1",
66
"homepage":"https://github.com/Ortus-Solutions/JSONPrettyPrint",
77
"documentation":"https://github.com/Ortus-Solutions/JSONPrettyPrint",
88
"repository":{
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
component accessors="true" {
2+
3+
property ANSIDefaults;
4+
5+
function init() {
6+
setANSIDefaults( {
7+
'constant' : chr( 27 ) & '[38;5;0m',
8+
'key' : chr( 27 ) & '[38;5;0m',
9+
'number' : chr( 27 ) & '[38;5;0m',
10+
'string' : chr( 27 ) & '[38;5;0m'
11+
} );
12+
return this;
13+
}
14+
15+
function wrap( str, type, colors ) {
16+
var code = 0;
17+
18+
if ( type == 'key' ) {
19+
code = colors.key;
20+
} else if ( left( str, 1 ) == '"' ) {
21+
code = colors.string;
22+
} else if ( len( str ) > 3 && arrayFind( [ 'true', 'false', 'null' ], str ) ) {
23+
code = colors.constant;
24+
} else {
25+
code = colors.number;
26+
}
27+
28+
if ( code.len() ) {
29+
return code & str & ANSIReset();
30+
}
31+
return str;
32+
}
33+
34+
private function ANSIReset() {
35+
return chr( 27 ) & '[0m';
36+
}
37+
38+
}

0 commit comments

Comments
 (0)