Created
May 18, 2011 04:36
-
-
Save xuwei-k/977994 to your computer and use it in GitHub Desktop.
ScalaのREPL上から、Web browser上で指定したソースコードのページ開くスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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