alexarchambault on 1.6.3
alexarchambault on master
1.6.3 (compare)
lihaoyi on gh-pages
5ad9ae5538f23cab92ccd8c6b1617d8… (compare)
alexarchambault on master
Partly revert 84d48542 (#923) … (compare)
Hi guys,ammonite-sshd
doesn't run predef
when running inside docker container.
I'm running ammonite embedded in play server. When I start play via runProd
and connect to ammonite via ssh I get this
Compiling /home/milan/dev/traceability/traceability/server/playserver/target/universal/stage/(console)
Setting front-end. // My println in predef
Welcome to the Ammonite Repl 1.7.4
However when I run the same play server inside alpine-java docker container I only get this:
Password:
Welcome to the Ammonite Repl 1.7.4
Any ideas?
大学院小学高校入試高校受験
校
. Even Cmd+E doesn't work and it doesn't take you to the end of the line.
Test / useSuperShell := false
but it did not work. Does someone has an alternative workaround than just calling sbt with --supershell=false
?
I had the following two lines in my predef.sc
import coursier.MavenRepository
interp.repositories() ++= Seq(MavenRepository("https://repository.mulesoft.org/nexus/content/repositories/public/"))
These used to work fine. today I upgraded my ammonite to 1.7.4 and now its broken. Error
predef.sc:17: not found: value coursier
import coursier.MavenRepository
scala> val formula = "class" ~
formula: smile.data.formula.FormulaBuilder = FormulaBuilder(Some(class),ListBuffer())
ammonite.$sess.cmd29$Helper$SimpleTuple
without access to the scope that this class was defined in.case class SimpleTuple(id: Int, desc: String) {
def >(other:SimpleTuple) = this.id > other.id
}
case class SimpleTuple4(id: Int, desc: String) {
def >(other:SimpleTuple4) = this.id > other.id
}
org.apache.spark.sql.catalyst.encoders.OuterScopes.addOuterScope(this)
textFile.map(line => SimpleTuple4(line.split(" ").size,line)).reduce((a, b) => if (a > b) a else b)
Main
as suggested in https://ammonite.io/#Debugging, and running it with the run
command inside sbt
, but that did not work...
@diesalbla Use this :
libraryDependencies += {
val version = scalaBinaryVersion.value match {
case "2.10" => "1.0.3"
case _ ⇒ "1.8.0"
}
"com.lihaoyi" % "ammonite" % version % "test" cross CrossVersion.full
}
sourceGenerators in Test += Def.task {
val file = (sourceManaged in Test).value / "amm.scala"
IO.write(file, """object amm extends App { ammonite.Main.main(args) }""")
Seq(file)
}.taskValue
and if you want, add a shortcut :addCommandAlias("repl", "test:runMain amm")
Anyone familiar with importing from a secure private bintray? I've tried to follow various snippets I've found through Google, but can't make it go.
import coursier.core.Authentication, coursier.MavenRepository
interp.repositories() ++= Seq(MavenRepository(
"https://some.bintray.com/maven"
authentication = Some(Authentication("user", "pass"))
))
import $ivy.{
`com.some:artifact_2.12:1.0.9-85`
}
gives me
Failed to resolve ivy dependencies:Error downloading com.some:artifact_2.12:1.0.9-85
not found: /Users/nderraugh/.ivy2/local/com.some/artifact_2.12/1.0.9-85/ivys/ivy.xml
not found: https://repo1.maven.org/maven2/com/some/artifact_2.12/1.0.9-85/artifact_2.12-1.0.9-85.pom
HI, may be somebody can assist
I have to call
git blame <file> | grep -n '^0{8} ' | cut -f1 -d:
This gives me line numbers of changed git files
Can I somehow to execut this as a native command, it just hungs
Ammonite-Shell/Scripting
chapter in documentation I understand that this usecase is supported. One of essentials here is an ability to invoke system binaries. I see we have this ability throuhg %
, %%
commands. I have installed ammonite per instructions on ammonite.io
. In this setup percent commands are available only when amm is run interactivly. This is because predef code with necessary imports is pre-executed only for interactive sessions. Should I solve this by importing predef file by hand in all my future scripts? Or is this a bad idea for some reason. If on the other hand it is a good idea why predef is not pre-executed when scripts are run non-interactively as well? Or is there another .ammonite file which is run before scripts like this? I hope you see my confusion. And thanks for ammonite!
import $plugin.$ivy.`org.typelevel:::kind-projector:0.11.0`
interp.configureCompiler(_.settings.YpartialUnification.value = true)
interp.configureCompiler(_.settings.Ydelambdafy.tryToSetColon(List("inline")))
object load {
def fs2Version(version: String) = {
repl.load.apply(s"""
import $$ivy.`co.fs2::fs2-io:$version`, fs2._, fs2.concurrent._, cats._, cats.implicits._, cats.effect._, cats.effect.implicits._, scala.concurrent.duration._
implicit val ioContextShift: ContextShift[IO] = IO.contextShift(scala.concurrent.ExecutionContext.Implicits.global)
implicit val ioTimer: Timer[IO] = IO.timer(scala.concurrent.ExecutionContext.Implicits.global)
""")
if (!version.startsWith("1")) repl.load.apply("""
val globalBlocker: Blocker = cats.effect.Blocker.liftExecutionContext(scala.concurrent.ExecutionContext.Implicits.global)
""")
}
def fs2 = fs2Version("2.0.1")
}
println("Enter encrypted data:")
val encryptedDataStr = scala.io.StdIn.readLine()
Hi everyone, can someone explain to me the behavior depicted in this screenshot?
I am saving a repl session and then import a script file which just contains a dummy function called test
that simply prints "hi ho". Then I load the previously saved repl session again and import the file again but it cannot find the test
function. Am I just not understanding something about file imports or is this strange behavior?
import $fs2.blahblahblah
instead of calling a magic function, but that's not really any better. Just a different spelling in the end
ls.rec.iter!
as mentioned in the docs (I'm using amm-1.8.1 in scala 2.12.10) and it doesn't seem to exist. I've tried ever other thing I can think of. If this doesn't exist, is there a good replacement, or advice on the best way to use ammonite.ops to do a ls.rec
on a huge tree in a "streaming" fashion?