Move swapExt() methods to QScriptUtils, have versions in QScript class call into the util versions
This commit is contained in:
parent
66cf22b28f
commit
5fd3d2be76
|
|
@ -82,8 +82,7 @@ trait QScript extends Logging with PrimitiveOptionConversions with StringFileCon
|
||||||
* @param newExtension New extension to append.
|
* @param newExtension New extension to append.
|
||||||
* @return new File with the new extension in the current directory.
|
* @return new File with the new extension in the current directory.
|
||||||
*/
|
*/
|
||||||
protected def swapExt(file: File, oldExtension: String, newExtension: String) =
|
protected def swapExt(file: File, oldExtension: String, newExtension: String) = QScriptUtils.swapExt(file, oldExtension, newExtension)
|
||||||
new File(file.getName.stripSuffix(oldExtension) + newExtension)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exchanges the extension on a file.
|
* Exchanges the extension on a file.
|
||||||
|
|
@ -93,8 +92,7 @@ trait QScript extends Logging with PrimitiveOptionConversions with StringFileCon
|
||||||
* @param newExtension New extension to append.
|
* @param newExtension New extension to append.
|
||||||
* @return new File with the new extension in dir.
|
* @return new File with the new extension in dir.
|
||||||
*/
|
*/
|
||||||
protected def swapExt(dir: File, file: File, oldExtension: String, newExtension: String) =
|
protected def swapExt(dir: File, file: File, oldExtension: String, newExtension: String) = QScriptUtils.swapExt(dir, file, oldExtension, newExtension)
|
||||||
new File(dir, file.getName.stripSuffix(oldExtension) + newExtension)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds one or more command line functions to be run.
|
* Adds one or more command line functions to be run.
|
||||||
|
|
@ -181,4 +179,5 @@ object QScript {
|
||||||
def resetAddOrder() {
|
def resetAddOrder() {
|
||||||
addOrder = 0
|
addOrder = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,27 @@ import collection.JavaConversions._
|
||||||
|
|
||||||
object QScriptUtils {
|
object QScriptUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exchanges the extension on a file.
|
||||||
|
* @param file File to look for the extension.
|
||||||
|
* @param oldExtension Old extension to strip off, if present.
|
||||||
|
* @param newExtension New extension to append.
|
||||||
|
* @return new File with the new extension in the current directory.
|
||||||
|
*/
|
||||||
|
def swapExt(file: File, oldExtension: String, newExtension: String) =
|
||||||
|
new File(file.getName.stripSuffix(oldExtension) + newExtension)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exchanges the extension on a file.
|
||||||
|
* @param dir New directory for the file.
|
||||||
|
* @param file File to look for the extension.
|
||||||
|
* @param oldExtension Old extension to strip off, if present.
|
||||||
|
* @param newExtension New extension to append.
|
||||||
|
* @return new File with the new extension in dir.
|
||||||
|
*/
|
||||||
|
def swapExt(dir: File, file: File, oldExtension: String, newExtension: String) =
|
||||||
|
new File(dir, file.getName.stripSuffix(oldExtension) + newExtension)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes a bam list file and produces a scala sequence with each file allowing the bam list
|
* Takes a bam list file and produces a scala sequence with each file allowing the bam list
|
||||||
* to have empty lines and comment lines (lines starting with #).
|
* to have empty lines and comment lines (lines starting with #).
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue