This file contains hidden or 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
diff --git a/pom.xml b/pom.xml | |
index ac0f723..32853f0 100644 | |
--- a/pom.xml | |
+++ b/pom.xml | |
@@ -30,7 +30,7 @@ | |
</scm> | |
<properties> | |
- <scala.version>2.7.4</scala.version> | |
+ <scala.version>2.8.0</scala.version> |
This file contains hidden or 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
// Test Method | |
@Stache("unitTest", Some(3600)) def foo(x: Int) = { | |
println("Multiplying X (%s) by 2".format(x)) | |
x * 2 | |
} | |
// Compiler steps | |
var block = tree.find( _.isInstanceOf[Block] ) orElse tree.find( _.isInstanceOf[Apply] ) getOrElse(throw new IllegalArgumentException("Cannot find method body for Stache annotated DefDef '%s'. Was looking for either a code block or a one liner. Is method abstract or something else boneheaded?".format(dDef.name))) |
This file contains hidden or 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
val notHaveBlankRows = new Matcher[Iterable[Map[String, String]]] { | |
def apply(x: => Iterable[Map[String, String]]) = { | |
(x().forall(row => row.forall(kv => kv._2 != null && kv._2 != "" && kv._2 != None)), | |
"No blank rows contained in Iterable.", | |
"Blank rows (all values in row are either '', null or None) found in Iterable.") | |
} | |
} |
This file contains hidden or 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
require 'formula' | |
class Scala <Formula | |
homepage 'http://www.scala-lang.org/' | |
url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.8.1.RC4.tgz' | |
version '2.8.1.RC4' | |
md5 '835f07e494004b33b82ded8f9b291cb1' | |
def install | |
rm_f Dir["bin/*.bat"] |
This file contains hidden or 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
require 'formula' | |
class Scala <Formula | |
homepage 'http://www.scala-lang.org/' | |
url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.8.1.final.tgz' | |
version '2.8.1' | |
md5 '4fa66742341b5c9f6877ce64d409cb92' | |
def install | |
rm_f Dir["bin/*.bat"] |
This file contains hidden or 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
[error] /Users/bwmcadams/code/mongodb/casbah/casbah-query/src/test/scala/DSLCoreOperatorsSpec.scala:1271: type mismatch; | |
[error] found : ((some other)$anon(in value <local DSLCoreOperatorsSpec>) forSome { type (some other)$anon(in value <local DSLCoreOperatorsSpec>) <: java.lang.Object with com.mongodb.casbah.commons.MongoDBObject{def $maxDistance[T](radius: T)(implicit evidence$15: Numeric[T]): (some other)$anon(in value <local DSLCoreOperatorsSpec>)} }) | |
[error] required: $anon(in value <local DSLCoreOperatorsSpec>) where type $anon(in value <local DSLCoreOperatorsSpec>) <: java.lang.Object with com.mongodb.casbah.commons.MongoDBObject{def $maxDistance[T](radius: T)(implicit evidence$15: Numeric[T]): $anon(in value <local DSLCoreOperatorsSpec>)} | |
[error] near must notBeNull | |
[error] ^ | |
((some other)$anon(in value <local DSLCoreOperatorsSpec>) forSome { type (some other)$anon(in value <local DSLCoreOperatorsSpec>) <: java.lang.Object with com.mongodb.casbah.commons.MongoDBObject{def $maxDista |
This file contains hidden or 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
[error] /Users/bwmcadams/code/mongodb/casbah/casbah-query/src/test/scala/DSLCoreOperatorsSpec.scala:1271: type mismatch; | |
[error] found : ((some other)$anon(in value <local DSLCoreOperatorsSpec>) forSome { type (some other)$anon(in value <local DSLCoreOperatorsSpec>) <: java.lang.Object with com.mongodb.casbah.commons.MongoDBObject{def $maxDistance[T](radius: T)(implicit evidence$15: Numeric[T]): (some other)$anon(in value <local DSLCoreOperatorsSpec>)} }) | |
[error] required: $anon(in value <local DSLCoreOperatorsSpec>) where type $anon(in value <local DSLCoreOperatorsSpec>) <: java.lang.Object with com.mongodb.casbah.commons.MongoDBObject{def $maxDistance[T](radius: T)(implicit evidence$15: Numeric[T]): $anon(in value <local DSLCoreOperatorsSpec>)} | |
[error] near must notBeNull | |
[error] ^ | |
((some other)$anon(in value <local DSLCoreOperatorsSpec>) forSome { type (some other)$anon(in value <local DSLCoreOperatorsSpec>) <: java.lang.Object with com.mongodb.casbah.commons.MongoDBObject{def $maxDista |
This file contains hidden or 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
import com.mongodb.casbah.Imports._ | |
val conn = MongoConnection() | |
val db = conn("test") | |
val coll = db("foo") | |
for (x <- coll.find(MongoDBObject("_id" -> new ObjectId("4cd2d357c575954934c5a975")), | |
MongoDBObject("x" -> 1))) println(x) |
This file contains hidden or 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
implicit def pimpMyMap(underlying: Map[_,_]) = new { | |
/** Lazy utility method to allow typing without conflicting with Map's required get() method and causing ambiguity */ | |
def getAs[A <: Any : Manifest](key: Any): Option[A] = { | |
require(manifest[A] != manifest[scala.Nothing], | |
"Type inference failed; getAs[A]() requires an explicit type argument " + | |
"(e.g. mapObject.getAs[<ReturnType>](somegetAKey) ) to function correctly.") | |
underlying.get(key) match { | |
case null => None |
This file contains hidden or 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
class CallableMap extends scala.collection.mutable.HashMap[String, Any] with Dynamic { | |
def invokeDynamic(name: String)(args: Any*) = { | |
println("Invoke Dynamic: (name = %s)(args: %s)".format(name, args)) | |
get(name) | |
} | |
def typed[T]: T = { | |
asInstanceOf[T] | |
} |
OlderNewer