drdozer / graphviz-s

Graphviz Scala bindings
Other
54 stars 13 forks source link

assume dot is on path #10

Open joprice opened 9 years ago

joprice commented 9 years ago

On my local machine, dot is at /usr/local/bin/dot. If it is safe to assume that dot is on the path and executable, I don't see a problem with referencing it directly.

drdozer commented 9 years ago

Hi @joprice -- I think we need to make the location of dot configurable. It varies from place to place, and isn't necessarily on the command-line. I've had java exec calls not go through a path search at all on some versions of java with some platforms. What do you think?

joprice commented 9 years ago

Agreed that making it configurable or assuming it's on the path is better than hardcoding the location, since it puts the user in control. Do you think something is needed to make it more easily configurable? To maintain parity with the existing api, maybe a companion helper?

// library code
object Exec {
  def apply(binary: File) = new Exec { 
    val dotBinary = binary 
  }
}

// user code
val customExec = Exec("/usr/local/bin/dot")
import customExec._
drdozer commented 9 years ago

Or an akka-style config file? I think they are complementary options, actually. I like your Exec import trick for user-override of the binary location. If you could code this one up in this pull request, then I'll merge it in.

joprice commented 9 years ago

Updated with the helper.

joprice commented 5 years ago

@drdozer Think this one is ready? Simmering for 4 years. Nice and congealed.