From 44ffd6a707a3de212b49672d7bba6898ee5c1d02 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 4 Sep 2010 18:05:28 -0700 Subject: [PATCH] Missing files from last patch, oops --- extra/mason/server/server-tests.factor | 16 +++++++++++++ extra/webapps/mason/counter/counter.factor | 14 +++++++++++ extra/webapps/mason/dashboard.xml | 23 +++++++++++++++++++ .../webapps/mason/dashboard/dashboard.factor | 20 ++++++++++++++++ .../increment-counter.factor | 14 +++++++++++ 5 files changed, 87 insertions(+) create mode 100644 extra/mason/server/server-tests.factor create mode 100644 extra/webapps/mason/counter/counter.factor create mode 100644 extra/webapps/mason/dashboard.xml create mode 100644 extra/webapps/mason/dashboard/dashboard.factor create mode 100644 extra/webapps/mason/increment-counter/increment-counter.factor diff --git a/extra/mason/server/server-tests.factor b/extra/mason/server/server-tests.factor new file mode 100644 index 0000000000..2923678af8 --- /dev/null +++ b/extra/mason/server/server-tests.factor @@ -0,0 +1,16 @@ +USING: continuations db db.sqlite io.directories io.files.temp +mason.server tools.test ; +IN: mason.server.tests + +[ "test.db" temp-file delete-file ] ignore-errors + +[ 0 2 ] [ + "test.db" temp-file [ + init-mason-db + + counter-value + increment-counter-value + increment-counter-value + counter-value + ] with-db +] unit-test diff --git a/extra/webapps/mason/counter/counter.factor b/extra/webapps/mason/counter/counter.factor new file mode 100644 index 0000000000..8e2de2385a --- /dev/null +++ b/extra/webapps/mason/counter/counter.factor @@ -0,0 +1,14 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors furnace.actions http.server.responses +mason.server math.parser ; +IN: webapps.mason.counter + +: ( -- action ) + + [ + [ + counter-value number>string + "text/plain" + ] with-mason-db + ] >>display ; diff --git a/extra/webapps/mason/dashboard.xml b/extra/webapps/mason/dashboard.xml new file mode 100644 index 0000000000..31516fc0a9 --- /dev/null +++ b/extra/webapps/mason/dashboard.xml @@ -0,0 +1,23 @@ + + + + Mason dashboard + +

Force build now

+ +

+
+ +

Crashed builders

+ + +

Make a release

+ + + + +
Version:
Announcement URL:
+ +

+
+
diff --git a/extra/webapps/mason/dashboard/dashboard.factor b/extra/webapps/mason/dashboard/dashboard.factor new file mode 100644 index 0000000000..57ce008006 --- /dev/null +++ b/extra/webapps/mason/dashboard/dashboard.factor @@ -0,0 +1,20 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors kernel mason.server furnace.actions +html.forms sequences xml.syntax webapps.mason.utils ; +IN: webapps.mason.downloads + +: crashed-builder-list ( -- xml ) + crashed-builders [ + [ package-url ] [ [ os>> ] [ cpu>> ] bi "/" glue ] bi + [XML
  • ><->
  • XML] + ] map + [XML
      <->
    XML] ; + +: ( -- action ) + + [ + [ + crashed-builder-list "crashed" set-value + ] with-mason-db + ] >>init ; diff --git a/extra/webapps/mason/increment-counter/increment-counter.factor b/extra/webapps/mason/increment-counter/increment-counter.factor new file mode 100644 index 0000000000..75287abbb4 --- /dev/null +++ b/extra/webapps/mason/increment-counter/increment-counter.factor @@ -0,0 +1,14 @@ +! Copyright (C) 2010 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors furnace.actions math.parser +http.server.responses mason.server ; +IN: webapps.mason.increment-counter + +: ( -- action ) + + [ + [ + increment-counter-value + number>string "text/plain" + ] with-mason-db + ] >>submit ;