Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Adds new :evaluated Modifier #118

Merged
merged 3 commits into from
Sep 18, 2016
Merged

Adds new :evaluated Modifier #118

merged 3 commits into from
Sep 18, 2016

Conversation

juanpedromoreno
Copy link
Contributor

This PR brings an additional tut:evaluated modifier in order to be able to post just the evaluated statement as output.

println(1 + 1)

will produce:

2

When this new feature might be useful? For instance, together with the sbt-buildinfo plugin we could:

println(s"""libraryDependencies += "your.organization" %% "artifact" % "${yourpackage.BuildInfo.version}"""")

will produce the following output:

libraryDependencies += "your.organization" %% "artifact" % "1.2.3"

in case that 1.2.3 is the current version for the artifact.

Please, review at your convenience. Thanks!

@tpolecat
Copy link
Owner

Hi, this looks good. Can you add a few more tests please:

  • The current test shows that printed output is captured; can you also show that the result of evaluating an expression is shown (i.e., 2+2)?
  • It would be helpful to show what happens if you have multiple expressions in an :evaluated block (mostly the newline behavior in between).
  • What happens when combined with other modifiers (:book for instance)?

@juanpedromoreno
Copy link
Contributor Author

Hi, I've just added few more test cases that may cover the points you mentioned. Could you verify it? Please, let me know if something additional could be added. Thanks!

@tpolecat
Copy link
Owner

Perfect! Great contribution, thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants