Skip to content
Browse files

fix stuff

  • Loading branch information...
1 parent 89e32d1 commit 24f7cc9a3e26f1479665febe509f41c4b383d921 @softprops committed
View
18 conscript/src/main/scala/conscripted.scala
@@ -1,5 +1,11 @@
package pictureshow
+object Main extends PictureShowScript {
+ def main(args: Array[String]) {
+ startShow(args)
+ }
+}
+
class PictureShowScript extends xsbti.AppMain {
/**
@@ -24,10 +30,10 @@ class PictureShowScript extends xsbti.AppMain {
case class Exit(val code: Int) extends xsbti.Exit
- def run(config: xsbti.AppConfiguration) = {
- Options(config.arguments) match {
+ def startShow(args: Array[String]) =
+ Options(args) match {
case Options.Server =>
- Server.instance(config.arguments).fold({ errs =>
+ Server.instance(args).fold({ errs =>
println(errs)
Exit(1)
}, { svr =>
@@ -39,7 +45,7 @@ class PictureShowScript extends xsbti.AppMain {
Exit(0)
})
case Options.Offline =>
- offline.Main.instance(config.arguments).fold({ errs =>
+ offline.Main.instance(args).fold({ errs =>
println(errs)
Exit(1)
}, { ol =>
@@ -47,5 +53,7 @@ class PictureShowScript extends xsbti.AppMain {
Exit(0)
})
}
- }
+
+ def run(config: xsbti.AppConfiguration) =
+ startShow(config.arguments)
}
View
7 core/src/main/scala/Resolver.scala
@@ -19,13 +19,14 @@ class GistGitResolver(uri: URI) extends Resolver {
class GistHttpResolver(id: String) extends Resolver {
def gh = :/("api.github.com").secure <:< Map("User-Agent"->"picture-show/0.1.0")
- private lazy val files: Map[String, String] =
+ private lazy val files: Map[String, String] = {
(for {
JObject(fs) <- Http(gh / "gists" / id > as.json4s.Json)()
("files", JObject(files)) <- fs
(name, JObject(data)) <- files
("content", JString(content)) <- data
} yield (name, content)).toMap
+ }
lazy val configuration = files("conf.js")
def lastSeg(p: String) = p.split('/').last
@@ -53,9 +54,9 @@ class FileSystemResolver(uri: URI) extends Resolver {
class Resolved(uri: URI) extends Resolver {
object GistHttp {
- val ID = """^/(.+)""".r
+ val ID = """^(.+)/(.+)""".r
def unapply(uri: URI) = (uri.getScheme, uri.getHost, uri.getPath) match {
- case ("https", "gist.github.com", ID(id)) => Some(id)
+ case ("https", "gist.github.com", ID(_, id)) => Some(id)
case _ => None
}
}
View
7 notes/0.1.1.markdown
@@ -0,0 +1,7 @@
+## fixes
+
+- fixed broken github gist support
+
+## features
+
+- [subtitle support](https://github.com/softprops/picture-show/#subtitles) added by [@eed3si9n](https://github.com/eed3si9n/)
View
4 project/build.scala
@@ -7,7 +7,7 @@ object Build extends sbt.Build {
lazy val standardSettings = Defaults.defaultSettings ++ Seq(
organization := "me.lessis",
- version := "0.1.1-SNAPSHOT",
+ version := "0.1.1",
scalaVersion := "2.9.2", // knockoff not published for anything greater
libraryDependencies ++= Seq(knockoff, dispatch),
scalacOptions ++= Seq("-deprecation", "-unchecked")
@@ -87,7 +87,7 @@ object Build extends sbt.Build {
val knockoff = "net.databinder" %% "pamflet-knockoff" % "0.4.2"
val codec = "commons-codec" % "commons-codec" % "1.4"
val specs = "org.scala-tools.testing" %% "specs" % "1.6.9" % "test"
- val uf_version = "0.6.8"
+ val uf_version = "0.6.1"
val uff = "net.databinder" %% "unfiltered-filter" % uf_version
val ufj = "net.databinder" %% "unfiltered-jetty" % uf_version
val dispatch = "net.databinder.dispatch" %% "json4s-native" % "0.9.4"
View
2 src/main/conscript/pshow/launchconfig
@@ -1,5 +1,5 @@
[app]
- version: 0.1.1-SNAPSHOT
+ version: 0.1.1
org: me.lessis
name: pictureshow-conscript
class: pictureshow.PictureShowScript

0 comments on commit 24f7cc9

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