object TemplateWriter
This object provides methods to generate scripts from templates. This involves
- procesing - replacing a placeholders with actual values
- TODO: validating - check the script if there are no remaining placeholders
a bash script can be generated like this
val template = getClass getResource "template-your-bashscript" val replacements = Seq("name" -> "your-app", "custom" -> "1") TemplateWriter.generateScript(template, replacements)
, a bat script can be generated like this
val template = getClass getResource "template-your-batscript" val replacements = Seq("name" -> "your-app", "custom" -> "1") TemplateWriter.generateScript(template, replacements, "\r\n", TemplateWriter.batFriendlyKeySurround)
TODO move out of archetypes package
Examples:
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- TemplateWriter
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bashFriendlyKeySurround(key: String): String
- def batFriendlyKeySurround(key: String): String
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def defaultCharset: Charset
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def generateScript(source: URL, replacements: Seq[(String, String)], eol: String = "\n", keySurround: (String) ⇒ String = bashFriendlyKeySurround, charset: Charset = defaultCharset): String
-
def
generateScriptFromLines(lines: Seq[String], replacements: Seq[(String, String)], keySurround: (String) ⇒ String = bashFriendlyKeySurround, charset: Charset = defaultCharset): Seq[String]
- keySurround
defaults to bashFriendlyKeySurround
- charset
defaults to UTF-8
- def generateScriptFromString(source: String, replacements: Seq[(String, String)], eol: String = "\n", keySurround: (String) ⇒ String = bashFriendlyKeySurround, charset: Charset = defaultCharset): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()