Packages

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
Examples:
  1. 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)
  2. ,
  3. 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

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TemplateWriter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def bashFriendlyKeySurround(key: String): String
  6. def batFriendlyKeySurround(key: String): String
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def defaultCharset: Charset
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def generateScript(source: URL, replacements: Seq[(String, String)], eol: String = "\n", keySurround: (String) ⇒ String = bashFriendlyKeySurround, charset: Charset = defaultCharset): String
  13. 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

  14. def generateScriptFromString(source: String, replacements: Seq[(String, String)], eol: String = "\n", keySurround: (String) ⇒ String = bashFriendlyKeySurround, charset: Charset = defaultCharset): String
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped