on master help sign in
Show version numbers correctly.
b214741evancz
elm-server/Server.hs+5−4
@@ -4,6 +4,7 @@ module Main where
4import Control.Monad (msum,guard)
4import Control.Monad (msum,guard)
5import Control.Monad.Trans (MonadIO(liftIO))
5import Control.Monad.Trans (MonadIO(liftIO))
6import Data.List (isPrefixOf, isSuffixOf)
6import Data.List (isPrefixOf, isSuffixOf)
7+import Data.Version (showVersion)
7import Happstack.Server
8import Happstack.Server
8import Happstack.Server.Compression
9import Happstack.Server.Compression
9import System.Directory (makeRelativeToCurrentDirectory)
10import System.Directory (makeRelativeToCurrentDirectory)
@@ -11,11 +12,11 @@ import System.Environment
11import qualified Language.Elm as Elm
12import qualified Language.Elm as Elm
12import Paths_elm_server
13import Paths_elm_server
13
14
14−runtime = "/elm-" ++ show version ++ ".js"
15+runtime = "elm-" ++ showVersion version ++ ".js"
15
16
16serve :: String -> IO ()
17serve :: String -> IO ()
17serve libLoc = do
18serve libLoc = do
18− putStrLn ("Elm Server "++show version++": running at <http://localhost:8000>")
19+ putStrLn ("Elm Server " ++ showVersion version ++ ": running at <http://localhost:8000>")
19 simpleHTTP nullConf $ do
20 simpleHTTP nullConf $ do
20 _ <- compressedResponseFilter
21 _ <- compressedResponseFilter
21 msum [ uriRest serveElm
22 msum [ uriRest serveElm
@@ -34,7 +35,7 @@ serveElm fp = do
34 ok . toResponse $ Elm.toHtml runtime (pageTitle filePath) content
35 ok . toResponse $ Elm.toHtml runtime (pageTitle filePath) content
35
36
36serveLib libLoc fp = do
37serveLib libLoc fp = do
37− guard (fp == runtime)
38+ guard (fp == '/' : runtime)
38 serveFile (asContentType "application/javascript") libLoc
39 serveFile (asContentType "application/javascript") libLoc
39
40
40main :: IO ()
41main :: IO ()
@@ -42,7 +43,7 @@ main = getArgs >>= parse
42
43
43parse :: [String] -> IO ()
44parse :: [String] -> IO ()
44parse ("--help":_) = putStrLn usage
45parse ("--help":_) = putStrLn usage
45−parse ("--version":_) = putStrLn ("The Elm Server " ++ show version)
46+parse ("--version":_) = putStrLn ("The Elm Server " ++ showVersion version)
46parse [] = serve =<< Elm.runtimeLocation
47parse [] = serve =<< Elm.runtimeLocation
47parse [arg]
48parse [arg]
48 | "--runtime-location=" `isPrefixOf` arg =
49 | "--runtime-location=" `isPrefixOf` arg =
elm-server/elm-server.cabal+2−2
@@ -1,5 +1,5 @@
1Name: elm-server
1Name: elm-server
2−Version: 0.4.0.3
2+Version: 0.4.0.4
3Synopsis: The Elm language server.
3Synopsis: The Elm language server.
4Description: This package provides a standalone, Happstack-based Elm server.
4Description: This package provides a standalone, Happstack-based Elm server.
5
5
@@ -35,4 +35,4 @@ Executable elm-server
35 happstack-server == 7.0.2,
35 happstack-server == 7.0.2,
36 deepseq,
36 deepseq,
37 directory,
37 directory,
38− Elm >= 0.4.0.3
38+ Elm >= 0.4.0.4
elm/Elm.cabal+2−2
@@ -1,6 +1,6 @@
1
1
2Name: Elm
2Name: Elm
3−Version: 0.4.0.3
3+Version: 0.4.0.4
4Synopsis: The Elm language module.
4Synopsis: The Elm language module.
5Description: Elm aims to make client-side web-development more pleasant.
5Description: Elm aims to make client-side web-development more pleasant.
6 It is a statically/strongly typed, functional reactive
6 It is a statically/strongly typed, functional reactive
@@ -22,7 +22,7 @@ Category: Compiler, Language
22Build-type: Simple
22Build-type: Simple
23
23
24Extra-source-files: changelog.txt
24Extra-source-files: changelog.txt
25−Data-files: elm-runtime-0.4.0.3.js
25+Data-files: elm-runtime-0.4.0.4.js
26Cabal-version: >=1.8
26Cabal-version: >=1.8
27
27
28source-repository head
28source-repository head
elm/elm-runtime-0.4.0.3.js → elm/elm-runtime-0.4.0.4.jsrenamed

The content is the same.

elm/src/Compiler.hs+3−2
@@ -4,6 +4,7 @@ module Main where
4import Data.Either (lefts, rights)
4import Data.Either (lefts, rights)
5import Data.List (intersect, intercalate)
5import Data.List (intersect, intercalate)
6import Data.Maybe (fromMaybe)
6import Data.Maybe (fromMaybe)
7+import Data.Version (showVersion)
7import System.Console.CmdArgs
8import System.Console.CmdArgs
8import Text.Blaze.Html.Renderer.String (renderHtml)
9import Text.Blaze.Html.Renderer.String (renderHtml)
9
10
@@ -40,11 +41,11 @@ elm = ELM { make = False &= help "automatically compile dependencies."
40 , minify = False &= help "Minify generated JavaScript"
41 , minify = False &= help "Minify generated JavaScript"
41 } &=
42 } &=
42 help "Compile Elm programs to HTML, CSS, and JavaScript." &=
43 help "Compile Elm programs to HTML, CSS, and JavaScript." &=
43− summary ("The Elm Compiler " ++ show version ++ ", (c) Evan Czaplicki")
44+ summary ("The Elm Compiler " ++ showVersion version ++ ", (c) Evan Czaplicki")
44
45
45main = do
46main = do
46 args <- cmdArgs elm
47 args <- cmdArgs elm
47− mini <- getDataFileName ("elm-runtime-" ++ show version ++ ".js")
48+ mini <- getDataFileName ("elm-runtime-" ++ showVersion version ++ ".js")
48 compileArgs mini args
49 compileArgs mini args
49
50
50compileArgs mini (ELM _ [] _ _ _ _ _ _) =
51compileArgs mini (ELM _ [] _ _ _ _ _ _) =
elm/src/Language/Elm.hs+2−1
@@ -16,6 +16,7 @@ module Language.Elm (
16 runtimeLocation
16 runtimeLocation
17 ) where
17 ) where
18
18
19+import Data.Version (showVersion)
19import CompileToJS
20import CompileToJS
20import ExtractNoscript
21import ExtractNoscript
21import GenerateHtml
22import GenerateHtml
@@ -27,7 +28,7 @@ import Paths_Elm
27import qualified Data.Text as TS
28import qualified Data.Text as TS
28import qualified Data.Text.Lazy as TL
29import qualified Data.Text.Lazy as TL
29
30
30−runtimeLocation = getDataFileName ("elm-runtime-" ++ show version ++ ".js")
31+runtimeLocation = getDataFileName ("elm-runtime-" ++ showVersion version ++ ".js")
31
32
32class ElmSource a where
33class ElmSource a where
33 -- |This function compiles Elm code to three separate parts: HTML, CSS,
34 -- |This function compiles Elm code to three separate parts: HTML, CSS,