Skip to content
Browse files

Upgrade libraries

  • Loading branch information...
1 parent f151dad commit 492005078f25b7a2458f7bbbf384cc3e7cc769dc @philcali committed Jul 3, 2012
Showing with 22 additions and 14 deletions.
  1. +8 −5 build.sbt
  2. +7 −1 project/plugins.sbt
  3. +2 −5 src/main/scala/AppCache.scala
  4. +5 −3 src/main/scala/LmxmlPlan.scala
View
13 build.sbt
@@ -5,11 +5,12 @@ scalaVersion := "2.9.1"
seq(appengineSettings: _*)
libraryDependencies ++= Seq (
- "com.github.philcali" %% "lmxml-html" % "0.1.1-SNAPSHOT",
- "com.github.philcali" %% "lmxml-template" % "0.1.1-SNAPSHOT",
- "com.github.philcali" %% "lmxml-json" % "0.1.1-SNAPSHOT",
- "com.github.philcali" %% "lmxml-cache" % "0.1.1-SNAPSHOT",
- "com.github.philcali" %% "scalendar" % "0.1.1",
+ "com.github.philcali" %% "lmxml-html" % "0.1.2",
+ "com.github.philcali" %% "lmxml-template" % "0.1.2",
+ "com.github.philcali" %% "lmxml-json" % "0.1.2",
+ "com.github.philcali" %% "lmxml-cache" % "0.1.2",
+ "com.github.philcali" %% "lmxml-markdown" % "0.1.2",
+ "com.github.philcali" %% "scalendar" % "0.1.2",
"net.databinder" %% "unfiltered-filter" % "0.5.3",
"net.databinder" %% "unfiltered-jetty" % "0.5.3",
"net.databinder" %% "unfiltered-json" % "0.5.3",
@@ -19,3 +20,5 @@ libraryDependencies ++= Seq (
unmanagedJars in Compile <++= gae.libPath in Compile map { libPath =>
(libPath / "user" * "*.jar").classpath
}
+
+javaOptions in (Compile, gae.devServer) += "-Dappengine.user.timezone=UTC"
View
8 project/plugins.sbt
@@ -1 +1,7 @@
-addSbtPlugin("com.eed3si9n" % "sbt-appengine" % "0.3.1")
+addSbtPlugin("com.eed3si9n" % "sbt-appengine" % "0.4.0")
+
+resolvers ++= Seq(
+ "spray repo" at "http://repo.spray.cc",
+ Resolver.url("sbt-plugin-releases",
+url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
+)
View
7 src/main/scala/AppCache.scala
@@ -6,7 +6,6 @@ import cache.{
FileHashStorage
}
-import java.util.{ HashMap => JMap }
import java.io.{
File,
ByteArrayOutputStream,
@@ -23,12 +22,10 @@ import scalendar._
object AppEngineCache extends FileHashStorage {
val cache = MemcacheServiceFactory.getMemcacheService("try-lmxml")
- def defaultExpiration = {
- Expiration.byDeltaMillis(1.month.into.milliseconds.toInt)
- }
+ def defaultExpiration = Expiration.onDate(Scalendar.now + 1.month)
def store(source: File, nodes: Seq[ParsedNode]) {
- val byteStream = new ByteArrayOutputStream()
+ val byteStream = new ByteArrayOutputStream()
DefaultPacker.serialize(nodes, byteStream)
View
8 src/main/scala/LmxmlPlan.scala
@@ -5,6 +5,7 @@ import template.FileTemplates
import cache.FileHashes
import shortcuts.html.HtmlShortcuts
import transforms.json.JSTransform
+import markdown.MarkdownParsing
import unfiltered.filter.Plan
import unfiltered.request._
@@ -16,7 +17,7 @@ import scala.io.Source.{fromFile => open}
import xml.PrettyPrinter
-object LmxmlText extends
+object LmxmlText extends
Params.Extract("lmxml-input", Params.first ~> Params.nonempty)
object JSonText extends
@@ -33,7 +34,8 @@ class LmxmlPlan extends Plan with LmxmlFactory with FileHashes {
lazy val base = config.getServletContext.getRealPath(".")
def createParser(step: Int) = {
- new PlainLmxmlParser(step) with HtmlShortcuts with FileTemplates {
+ new PlainLmxmlParser(step)
+ with MarkdownParsing with HtmlShortcuts with FileTemplates {
val working = new java.io.File(base)
}
}
@@ -46,7 +48,7 @@ class LmxmlPlan extends Plan with LmxmlFactory with FileHashes {
ContentType("text/html") ~>
ResponseString(converted.toString)
case POST(Path("/") & Params(LmxmlText(text)) & Params(JSonText(jsonStr))) =>
- val js = JSTransform(jsonStr).getOrElse(transforms.Transform())
+ val js = JSTransform().parse(jsonStr)
val process = js andThen XmlConvert andThen XmlFormat

0 comments on commit 4920050

Please sign in to comment.
Something went wrong with that request. Please try again.