Permalink
Browse files

Update dependencies

Now using sbt 0.11.2 and Dispatch 0.8.8
  • Loading branch information...
1 parent 4a30b84 commit 271598d6e16d14b8838ecfd1168045025f78e36c @pr1001 pr1001 committed Apr 25, 2012
View
@@ -16,7 +16,7 @@ BFUrbanAirship is a Scala library for the [Urban Airship](http://www.urbanairshi
## Getting the library
-Currently you'll need to checkout the source code and build it using [sbt](https://github.com/harrah/xsbt/wiki) **0.7.4**. `sbt publish-local` should do the trick.
+Currently you'll need to checkout the source code and build it using [sbt](https://github.com/harrah/xsbt/wiki) **0.11.2**. `sbt publish-local` should do the trick.
## TODO
View
@@ -0,0 +1,13 @@
+name := "BFUrbanAirship"
+
+version := "0.2-SNAPSHOT"
+
+organization := "com.bubblefoundry"
+
+scalaVersion := "2.9.1"
+
+libraryDependencies += "net.databinder" %% "dispatch-gae" % "0.8.8"
+
+libraryDependencies += "net.liftweb" %% "lift-json" % "2.4"
+
+libraryDependencies += "net.liftweb" %% "lift-util" % "2.4"
@@ -1,8 +1 @@
-#Project properties
-#Sat Jan 15 10:23:57 CET 2011
-project.organization=com.bubblefoundry
-project.name=bfurbanairship
-sbt.version=0.7.4
-project.version=0.1
-build.scala.versions=2.8.1
-project.initialize=false
+sbt.version=0.11.2
@@ -1,20 +0,0 @@
-import sbt._
-
-class BFUrbanAirshipProject(info: ProjectInfo) extends DefaultProject(info)
-{
- // val dispatch_json = "net.databinder" %% "dispatch-json" % "0.7.8"
- // val dispatch_lift_json = "net.databinder" %% "dispatch-lift-json" % "0.7.8"
- val scalatoolsSnapshot = "Scala Tools Snapshot" at "http://scala-tools.org/repo-snapshots/"
- val liftVersion = "2.3-M1"
-
- val dispatch_vers = "0.8.0.Beta3"
- // lazy val dispatch_meetup = "net.databinder" %% "dispatch-meetup" % dispatch_vers
- lazy val dispatch_gae = "net.databinder" %% "dispatch-http-gae" % dispatch_vers
- lazy val dispatch_liftjson = "net.databinder" %% "dispatch-lift-json" % dispatch_vers
-
- val appengineRepo = "nexus" at "http://maven-gae-plugin.googlecode.com/svn/repository/"
-
- // val dispatch = "net.databinder" %% "dispatch" % "0.7.8"
- val lift_common = "net.liftweb" %% "lift-common" % liftVersion
- val lift_util = "net.liftweb" %% "lift-util" % liftVersion
-}
@@ -1,7 +1,6 @@
package com.bubblefoundry.bfurbanairship
import dispatch._
-import dispatch.liftjson.Js._
import net.liftweb.json.parse
import net.liftweb.json.JsonAST._
import net.liftweb.json.Serialization.write
@@ -108,27 +107,27 @@ class UrbanAirship(app_token: String, app_secret: Box[String], app_master_secret
def register_device(device: Device): Box[Device] = app_secret.flatMap(secret => {
val req = devicesReq / device.device_token <<< write(device) <:< Map("Content-Type" -> "application/json") as (app_token, secret)
- Helpers.tryo(http(req ># (json => {
- json.extract[Device] // then update the returned object with its tags, since it apparently doesn't return them?
- })))
+ Helpers.tryo(http(req >- (jsonStr =>
+ parse(jsonStr).extract[Device] // then update the returned object with its tags, since it apparently doesn't return them?
+ )))
}) ?~ "App Secret required"
// GET device
def device(device_token: String): Box[Device] = app_master_secret.flatMap(secret => {
val req = devicesReq / device_token as (app_token, secret)
- Helpers.tryo(http(req ># (json => {
- json.extract[Device]
- })))
+ Helpers.tryo(http(req >- (jsonStr =>
+ parse(jsonStr).extract[Device]
+ )))
}) ?~ "App Master Secret Required"
def device(d: Device): Box[Device] = device(d.device_token)
// get device tokens
def devices: Box[Stream[Device]] = app_master_secret.flatMap(secret => {
def getPage(page: Int) = {
val req = devicesReq / "" <<? Map("page" -> page.toString) as (app_token, secret)
- Helpers.tryo(http(req ># (json => {
- json.extract[DevicesPage]
- })))
+ Helpers.tryo(http(req >- (jsonStr =>
+ parse(jsonStr).extract[DevicesPage]
+ )))
}
// get the first page
@@ -150,20 +149,24 @@ class UrbanAirship(app_token: String, app_secret: Box[String], app_master_secret
// feedback service
def feedback(since: String): Box[List[Device]] = app_master_secret.flatMap(secret => {
val req = feedbackReq / "" <<? Map("since" -> since) as (app_token, secret)
- Helpers.tryo(http(req ># (json => {
- json.children.map(_.extract[Device])
- })))
+ Helpers.tryo(http(req >- (jsonStr =>
+ parse(jsonStr).children.map(_.extract[Device])
+ )))
}) ?~ "App Master Secret Required"
def devices_count: Box[DevicesCount] = app_master_secret.flatMap(secret => {
val req = devicesReq / "count" / "" as (app_token, secret)
- Helpers.tryo(http(req ># (_.extract[DevicesCount])))
+ Helpers.tryo(http(req >- (jsonStr =>
+ parse(jsonStr).extract[DevicesCount]
+ )))
}) ?~ "App Master Secret Required"
def push[M <: PushMessage[_]](message: M): Box[ScheduledPushes] = app_master_secret.flatMap(secret => {
val req = pushReq / "" << (write(message), "application/json") as (app_token, secret)
- Helpers.tryo(http(req ># (json => json.extract[ScheduledPushes])))
+ Helpers.tryo(http(req >- (jsonStr =>
+ parse(jsonStr).extract[ScheduledPushes]
+ )))
}) ?~ "App Master Secret Required"
/*
@@ -258,9 +261,9 @@ class UrbanAirship(app_token: String, app_secret: Box[String], app_master_secret
def statistics(start: String, end: String): Box[List[HourlyStatistics]] = app_master_secret.flatMap(secret => {
val req = statisticsReq <<? Map("start" -> start, "end" -> end) as (app_token, secret)
- Helpers.tryo(http(req ># (json => {
- json.children.map(_.extract[HourlyStatistics])
- })))
+ Helpers.tryo(http(req >- (jsonStr =>
+ parse(jsonStr).children.map(_.extract[HourlyStatistics])
+ )))
}) ?~ "App Master Secret required"
/* TAGS */

0 comments on commit 271598d

Please sign in to comment.