packages feed

madlang 2.4.1.6 → 2.4.2.0

raw patch · 5 files changed

+65/−15 lines, 5 filesdep +bytestringdep +http-clientdep +tarsetup-changed

Dependencies added: bytestring, http-client, tar, zlib

Files

Setup.hs view
@@ -26,7 +26,7 @@             config <- readFile bashRc             unless ("#manpath updated by madlang" `elem` lines config)                 (appendFile bashRc "\n#manpath updated by madlang\nexport MANPATH=~/.local/share:$MANPATH\n" >>-                 void (readCreateProcessWithExitCode (shell "MANPATH=~/.local/share:$MANPATH mandb") ""))+                 void (readCreateProcessWithExitCode (shell $ "MANPATH=" ++ x ++ "/.local/share mandb") ""))         Nothing -> pure ()  writeManpages :: IO ()
madlang.cabal view
@@ -1,5 +1,5 @@ name:                madlang-version:             2.4.1.6+version:             2.4.2.0 synopsis:            Randomized templating language DSL description:         Madlang is a text templating language written in Haskell,                      meant to explore computational creativity and generative@@ -75,6 +75,10 @@                      , mtl                      , ansi-wl-pprint                      , containers+                     , bytestring+                     , http-client+                     , tar+                     , zlib   default-language:    Haskell2010   default-extensions:  OverloadedStrings                      , DeriveGeneric
man/madlang.1 view
@@ -7,12 +7,15 @@ madlang \- a text templating language for generative literature .SH SYNOPSIS .PP-madlang run <file> madlang debug <file> madlang lint <file>+madlang run <file>+.PP+madlang debug <file>+.PP+madlang lint <file> .SH DESCRIPTION .PP \f[B]madlang\f[] is an interpreted language for generative literature and computational creativity.-It is implemented in Haskell. .SH OPTIONS .TP .B \f[B]\-h\f[] \f[B]\-\-help\f[]@@ -24,12 +27,42 @@ Generate output more than once .RS .RE+.TP+.B \f[B]\-i\f[]+Set an input to the template+.RS+.RE .SH CONFIGURATION .PP Place files in $HOME/.madlang for them to be available globally as libraries.+You can also download prebundled packages using+.PP+madlang install+.SH EDITOR INTEGRATION+.PP+A vim plugin is available from+.PP+https://github.com/vmchale/madlang\-vim+.SH MODIFIERS+.PP+Strings in madlang can be followed by modifiers, for instance+.PP+1.0 "some very bad idea".oulipo+.PP+Currently supported modifiers are:+.IP \[bu] 2+to_lower+.IP \[bu] 2+to_upper+.IP \[bu] 2+capitalize+.IP \[bu] 2+reverse+.IP \[bu] 2+oulipo (removes all instances of the letter \[aq]e\[aq]) .SH EXAMPLES .PP-You can examine some examples by+You can examine some examples in .SH AUTHORS Vanessa McHale<vanessa.mchale@reconfigure.io>.
src/Text/Madlibs/Exec/Helpers.hs view
@@ -1,11 +1,24 @@-module Text.Madlibs.Exec.Helpers (writeBashCompletions) where+module Text.Madlibs.Exec.Helpers (fetchPackages) where -import           System.Environment (lookupEnv)+import qualified Codec.Archive.Tar      as Tar+import           Codec.Compression.GZip (decompress)+import qualified Data.ByteString.Lazy   as BSL+import           Network.HTTP.Client    hiding (decompress)+import           System.Environment     (getEnv) --- TODO something less stupid with error messages-writeBashCompletions :: IO ()-writeBashCompletions = do-    home <- lookupEnv "HOME"-    case home of-        Just x -> appendFile (x ++ "/.bashrc") "\n# Added by madlang\neval \"$(madlang --bash-completion-script madlang)\"\n"-        Nothing -> pure ()+-- TODO set remote package url flexibly+fetchPackages :: IO ()+fetchPackages = do++    putStrLn "fetching libraries..."+    manager <- newManager defaultManagerSettings+    initialRequest <- parseRequest "http://vmchale.com/static/packages.tar.gz"+    response <- httpLbs (initialRequest { method = "GET" }) manager+    BSL.writeFile "crapfile.tar.gz" $ responseBody response++    putStrLn "unpacking libraries..."+    home <- getEnv "HOME"+    let packageDir = home ++ "/.madlang"+    Tar.unpack packageDir . Tar.read . decompress =<< BSL.readFile "crapfile.tar.gz"++    putStrLn "done."
src/Text/Madlibs/Exec/Main.hs view
@@ -95,7 +95,7 @@ template :: Program -> IO () template rec = do     case sub rec of-        Install -> writeBashCompletions+        Install -> fetchPackages         _ -> do             let toFolder = input . sub $ rec             if getDir toFolder == "" then pure () else setCurrentDirectory (getDir toFolder)