Permalink
Browse files

Merge pull request #1 from kjozsa/master

upgrade to scala 2.10
  • Loading branch information...
2 parents 9f5782c + 8165c29 commit 477a5db544b4436117ed1097209ccf478602862e @d6y d6y committed Jan 11, 2013
View
@@ -2,13 +2,13 @@ name := "facebook"
liftVersion <<= liftVersion ?? "2.5-SNAPSHOT"
-version <<= liftVersion apply { _ + "-1.1-SNAPSHOT" }
+version <<= liftVersion apply { _ + "-1.2-SNAPSHOT" }
organization := "net.liftmodules"
-scalaVersion := "2.9.2"
-
-crossScalaVersions := Seq("2.9.2", "2.9.1-1", "2.9.1", "2.9.0-1", "2.9.0")
+scalaVersion := "2.10.0"
+
+crossScalaVersions := Seq("2.10.0", "2.9.2", "2.9.1-1", "2.9.1", "2.9.0-1", "2.9.0")
resolvers += "CB Central Mirror" at "http://repo.cloudbees.com/content/groups/public"
@@ -21,13 +21,10 @@ libraryDependencies <++= liftVersion { v =>
libraryDependencies <++= scalaVersion { sv =>
(sv match {
- case "2.9.2" | "2.9.1" | "2.9.1-1" => "org.scala-tools.testing" % "specs_2.9.1" % "1.6.9" % "test"
- case _ => "org.scala-tools.testing" %% "specs" % "1.6.8" % "test"
+ case "2.9.2" | "2.9.1" | "2.9.1-1" => "org.specs2" %% "specs2" % "1.12.3" % "test"
+ case "2.10.0" => "org.specs2" %% "specs2" % "1.13" % "test"
+ case "2.9.0-1" | "2.9.0" => "org.specs2" %% "specs2" % "1.7.1" % "test"
}) ::
- (sv match {
- case "2.9.2" => "org.scalacheck" % "scalacheck_2.9.1" % "1.9" % "test"
- case _ => "org.scalacheck" %% "scalacheck" % "1.9" % "test"
- }) ::
Nil
}
@@ -0,0 +1 @@
+sbt.version=0.12.1
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2013 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,13 +45,13 @@ object Facebook {
case _ => Empty
}
- def userId_! : Int = userId.open_!
+ def userId_! : Int = userId.openOr(sys.error("No userid"))
private def authToken : Box[String] = S.param("auth_token")
def sessionKey : Box[String] = S.param("fb_sig_session_key")
- def sessionKey_! : String = sessionKey.open_!
+ def sessionKey_! : String = sessionKey.openOr(sys.error("No session key"))
def loginUrl: String = "http://www.facebook.com/login.php?api_key=" + FacebookRestApi.apiKey + "&v=1.0"
def addUrl : String = "http://www.facebook.com/add.php?api_key=" + FacebookRestApi.apiKey
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 WorldWide Conferencing, LLC
+ * Copyright 2010-2013 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ class FacebookConnect(apiKey:String, apiSecret:String) {
def session:Box[FacebookSession] = for (p <- verifyCookiesSig; s <- toSession(p)) yield s
- def client:Box[FacebookClient[Node]] = session.map(session => new FacebookClient(apiKey, apiSecret, session, FacebookClient.xmlParser, FacebookFormat.xml))
+ def client:Box[FacebookClient[Node]] = session.map(session => new FacebookClient(apiKey, apiSecret, session, FacebookClient.xmlParser, FacebookFormat.XML))
def verifyParams(params: List[(String,String)], sig: String):Box[List[(String,String)]] = {
val actualSig = FacebookClient.genSignature(params, apiSecret)
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2011 WorldWide Conferencing, LLC
+ * Copyright 2007-2013 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -107,7 +107,7 @@ object FacebookClient {
callMethod(meth)
def fromSession(session: FacebookSession) : FacebookClient[Node] = {
- new FacebookClient(session, xmlParser,FacebookFormat.xml)
+ new FacebookClient(session, xmlParser,FacebookFormat.XML)
}
def fromAuthToken(authToken: String) : Option[FacebookClient[Node]] = {
@@ -129,8 +129,9 @@ object FacebookClient {
}
}
-object FacebookFormat extends Enumeration("XML", "JSON"){
- val xml, json = Value
+object FacebookFormat extends Enumeration {
+ type FacebookFormat = Value
+ val XML, JSON = Value
}
class FacebookClient[T](val apiKey: String, val secret: String, val session: FacebookSession, parser: InputStream=>T, format: FacebookFormat.Value) {

0 comments on commit 477a5db

Please sign in to comment.