Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from ottogroup/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
ktohme authored Feb 20, 2017
2 parents 4107807 + 3d2e367 commit 48004c6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ trait Commentable {
/**
* An optional comment about the named entity.
*/
var comment: Option[String] = None
private var _comment: Option[String] = None

/**
* Return the comment
*/
def comment = _comment

/**
* Provide a comment describing the named entity's purpose.
*/
def comment(aComment: String) {
comment = Some(aComment)
_comment = Some(aComment)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ case class ExternalView(view: View) extends View {

override def transformVia(ft: () => Transformation) = {}

override def comment = view.comment

override def exportTo(export: () => Transformation) = {}

override def configureExport(k: String, v: Any) = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ trait StructureDsl extends Named with Commentable {
def fieldOf[T: Manifest](orderWeight: Int = 100, comment: String = null, overrideName: String = null) = {
val f = Field[T](orderWeight, if (overrideName != null) Some(overrideName) else None)

f.comment = if (comment != null) Some(comment) else None
if (comment != null)
f.comment(comment)

registerField(f)
f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class SchedoscopeCliRepl(val schedoscope: SchedoscopeService) {
val ctrl = new SchedoscopeCliCommandRunner(schedoscope)
val reader = new ConsoleReader()
val history = new History()
history.setHistoryFile(new File(System.getenv("HOME") + "/.schedoscope_history"))
val histFileDir = Option(System.getenv("XDG_CACHE_HOME")).getOrElse(System.getenv("HOME") + "/.cache")
history.setHistoryFile(new File(histFileDir + "/schedoscope_history"))
reader.setHistory(history)
while (true) {
try {
Expand Down

0 comments on commit 48004c6

Please sign in to comment.