Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created May 18, 2011 04:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/977994 to your computer and use it in GitHub Desktop.
Save xuwei-k/977994 to your computer and use it in GitHub Desktop.
ScalaのREPL上から、Web browser上で指定したソースコードのページ開くスクリプト
object SourceCode{
val browser = """ "C:\Documents and Settings\scalaちゃん\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" """
val srcURL = "https://lampsvn.epfl.ch/trac/scala/browser/scala/tags/R_2_8_1_final/src//library/"
def apply(clazz:Class[_]){
val url = srcURL + clazz.getName.replace('.','/') + ".scala#L1"
Runtime.getRuntime.exec( browser + url )
}
def apply[ A <: Any:Manifest]{
apply( manifest[A].erasure )
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment