Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
cfsimplicity committed Nov 15, 2023
2 parents ea1b32a + bf97235 commit 74b3ddb
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 33 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## 3.11.1 - 15 November 2023

- \#345 readCsv(): Commons CSV boolean options should default to true

## 3.11.0 - 14 November 2023

- Enhancements
- \#343 Improve csvToQuery() performance
- \#340 Add readCsv() for large file/advanced csv processing
- \#336 Add parallelization option to queryToCsv()

Expand Down
2 changes: 1 addition & 1 deletion ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ component{
this.author = "Julian Halliwell";
this.webURL = "https://github.com/cfsimplicity/spreadsheet-cfml";
this.description = "CFML Spreadsheet Library";
this.version = "3.11.0";
this.version = "3.11.1";
this.autoMapModels = false;

function configure(){
Expand Down
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,15 @@ You may wish to place the spreadsheet library files in a central location with a
* [addConditionalFormatting](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/addConditionalFormatting)
* [addDataValidation](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/addDataValidation)
* [addPrintGridlines](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/addPrintGridlines)
* [binaryFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/binaryFromQuery)
* [cleanUpStreamingXml](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/cleanUpStreamingXml)
* [clearCell](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/clearCell)
* [clearCellRange](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/clearCellRange)
* [createCellStyle](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/createCellStyle)
* [csvToQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/csvToQuery)
* [download](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/download)
* [downloadCsvFromFile](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/downloadCsvFromFile)
* [downloadFileFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/downloadFileFromQuery)
* [getCellComments](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/getCellComments)
* [getCellFormat](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/getCellFormat)
* [getCellHyperLink](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/getCellHyperLink)
Expand All @@ -142,6 +147,10 @@ You may wish to place the spreadsheet library files in a central location with a
* [isRowHidden](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/isRowHidden)
* [isStreamingXmlFormat](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/isStreamingXmlFormat)
* [isXmlFormat](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/isXmlFormat)
* [newStreamingXlsx](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newStreamingXlsx)
* [newXls](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newXls)
* [newXlsx](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newXlsx)
* [queryToCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/queryToCsv)
* [readCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/readCsv)
* [readLargeFile](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/readLargeFile)
* [removePrintGridlines](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/removePrintGridlines)
Expand All @@ -150,6 +159,7 @@ You may wish to place the spreadsheet library files in a central location with a
* [setActiveCell](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setActiveCell)
* [setCellHyperLink](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setCellHyperLink)
* [setCellRangeValue](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setCellRangeValue)
* [setDateFormats](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setDateFormats)
* [setFitToPage](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setFitToPage)
* [setFooterImage](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setFooterImage)
* [setHeaderImage](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setHeaderImage)
Expand All @@ -167,23 +177,10 @@ You may wish to place the spreadsheet library files in a central location with a
* [sheetInfo](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/sheetInfo)
* [showColumn](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/showColumn)
* [showRow](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/showRow)
* [writeToCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/writeToCsv)

### Additional Convenience methods

* [binaryFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/binaryFromQuery)
* [csvToQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/csvToQuery)
* [download](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/download)
* [downloadCsvFromFile](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/downloadCsvFromFile)
* [downloadFileFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/downloadFileFromQuery)
* [newStreamingXlsx](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newStreamingXlsx)
* [newXls](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newXls)
* [newXlsx](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newXlsx)
* [queryToCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/queryToCsv)
* [setDateFormats](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setDateFormats)
* [workbookFromCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/workbookFromCsv)
* [workbookFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/workbookFromQuery)
* [writeFileFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/writeFileFromQuery)
* [writeToCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/writeToCsv)

### Enhanced Read() method

Expand Down
2 changes: 1 addition & 1 deletion Spreadsheet.cfc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
component accessors="true"{

//"static"
property name="version" default="3.11.0" setter="false";
property name="version" default="3.11.1" setter="false";
property name="osgiLibBundleVersion" default="5.2.4.1" setter="false"; //first 3 octets = POI version; increment 4th with other jar updates
property name="osgiLibBundleSymbolicName" default="spreadsheet-cfml" setter="false";
property name="exceptionType" default="cfsimplicity.spreadsheet" setter="false";
Expand Down
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "Spreadsheet CFML",
"slug" : "spreadsheet-cfml",
"version" : "3.11.0",
"version" : "3.11.1",
"shortDescription" : "CFML spreadsheet library",
"author" : "Julian Halliwell",
"location" : "forgeboxStorage",
Expand Down
16 changes: 8 additions & 8 deletions objects/ReadCsv.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ component accessors="true"{
}

/* Format configuration */
public ReadCsv function withAllowMissingColumnNames( required boolean state ){
public ReadCsv function withAllowMissingColumnNames( boolean state=true ){
variables.format = variables.format.builder().setAllowMissingColumnNames( JavaCast( "boolean", arguments.state ) ).build();
return this;
}

public ReadCsv function withAutoFlush( required boolean state ){
public ReadCsv function withAutoFlush( boolean state=true ){
variables.format = variables.format.builder().setAutoFlush( JavaCast( "boolean", arguments.state ) ).build();
return this;
}
Expand Down Expand Up @@ -81,17 +81,17 @@ component accessors="true"{
return this;
}

public ReadCsv function withIgnoreEmptyLines( required boolean state ){
public ReadCsv function withIgnoreEmptyLines( boolean state=true ){
variables.format = variables.format.builder().setIgnoreEmptyLines( JavaCast( "boolean", arguments.state ) ).build();
return this;
}

public ReadCsv function withIgnoreHeaderCase( required boolean state ){
public ReadCsv function withIgnoreHeaderCase( boolean state=true ){
variables.format = variables.format.builder().setIgnoreHeaderCase( JavaCast( "boolean", arguments.state ) ).build();
return this;
}

public ReadCsv function withIgnoreSurroundingSpaces( required boolean state ){
public ReadCsv function withIgnoreSurroundingSpaces( boolean state=true ){
variables.format = variables.format.builder().setIgnoreSurroundingSpaces( JavaCast( "boolean", arguments.state ) ).build();
return this;
}
Expand All @@ -106,17 +106,17 @@ component accessors="true"{
return this;
}

public ReadCsv function withSkipHeaderRecord( required boolean state ){
public ReadCsv function withSkipHeaderRecord( boolean state=true ){
variables.format = variables.format.builder().setSkipHeaderRecord( JavaCast( "boolean", arguments.state ) ).build();
return this;
}

public ReadCsv function withTrailingDelimiter( required boolean state ){
public ReadCsv function withTrailingDelimiter( boolean state=true ){
variables.format = variables.format.builder().setTrailingDelimiter( JavaCast( "boolean", arguments.state ) ).build();
return this;
}

public ReadCsv function withTrim( required boolean state ){
public ReadCsv function withTrim( boolean state=true ){
variables.format = variables.format.builder().setTrim( JavaCast( "boolean", arguments.state ) ).build();
return this;
}
Expand Down
16 changes: 8 additions & 8 deletions test/specs/readCsv.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,22 @@ describe( "readCsv", function(){
it( "allows Commons CSV format options to be applied", function(){
var path = getTestFilePath( "test.csv" );
var object = s.readCsv( path )
.withAllowMissingColumnNames( true )
.withAutoFlush( true )
.withAllowMissingColumnNames()
.withAutoFlush()
.withCommentMarker( "##" )
.withDelimiter( "|" )
.withDuplicateHeaderMode( "ALLOW_EMPTY" )
.withEscapeCharacter( "\" )
.withHeader( [ "Name", "Number" ] )
.withHeaderComments( [ "comment1", "comment2" ] )
.withIgnoreEmptyLines( true )
.withIgnoreHeaderCase( true )
.withIgnoreSurroundingSpaces( true )
.withIgnoreEmptyLines()
.withIgnoreHeaderCase()
.withIgnoreSurroundingSpaces()
.withNullString( "" )
.withQuoteCharacter( "'" )
.withSkipHeaderRecord( true )
.withTrailingDelimiter( true )
.withTrim( true );
.withSkipHeaderRecord()
.withTrailingDelimiter()
.withTrim();
expect( object.getFormat().getAllowMissingColumnNames() ).toBeTrue();
expect( object.getFormat().getAutoFlush() ).toBeTrue();
expect( object.getFormat().getCommentMarker() ).toBe( "##" );
Expand Down

0 comments on commit 74b3ddb

Please sign in to comment.