nemesis 2010.10.4.1.1 → 2011.6.12
raw patch · 8 files changed
+50/−32 lines, 8 filesdep +airdep −mpsPVP ok
version bump matches the API change (PVP)
Dependencies added: air
Dependencies removed: mps
API changes (from Hackage documentation)
Files
- changelog.md +1/−1
- nemesis.cabal +6/−4
- readme.md +13/−12
- src/System/Nemesis.hs +2/−2
- src/System/Nemesis/DSL.hs +3/−2
- src/System/Nemesis/Env.hs +14/−0
- src/System/Nemesis/Runner.hs +9/−9
- src/System/Nemesis/Util.hs +2/−2
changelog.md view
@@ -29,7 +29,7 @@ 2009.8.4 -------- -### Fix for MPS ljust / rjust bug+### Fix for Air ljust / rjust bug 2009.6.25 ---------
nemesis.cabal view
@@ -1,5 +1,5 @@ Name: nemesis-Version: 2010.10.4.1.1+Version: 2011.6.12 Build-type: Simple Synopsis: a Rake like task management tool Description: smart per project code snippets@@ -16,18 +16,20 @@ library ghc-options: -Wall- build-depends: base >= 4 && < 5, old-time, time, haskell98, mtl, process, containers, data-default, Glob >= 0.4, mps >= 2009.9.18+ build-depends: base >= 4 && < 5, old-time, time, haskell98, mtl, process, containers, data-default, Glob >= 0.4, air >= 2011.6.12 hs-source-dirs: src/ exposed-modules: System.Nemesis System.Nemesis.DSL+ System.Nemesis.Env other-modules: System.Nemesis.Util+ Executable nemesis- ghc-options: -Wall- build-depends: base >= 4 && < 5, haskell98, mtl, process, containers, data-default, directory+ build-depends: base >= 4 && < 5, haskell98, mtl, process, containers, data-default, directory, air >= 2011.6.12 hs-source-dirs: src/ main-is: System/Nemesis/Runner.hs other-modules: System.Nemesis.Util System.Nemesis.DSL+
readme.md view
@@ -36,7 +36,7 @@ nemesis = do - -- desc is optional, it gives some description to the following task+ -- desc is optional, it gives some description to the task that follows desc "Hunter attack macro" -- syntax: task "keyword: dependencies" io-action@@ -58,10 +58,10 @@ run `nemesis` - attack : Hunter attack macro- auto-attack : Auto attack- mark : Hunter's mark- pet-attack : Pet attack+ attack Hunter attack macro+ auto-attack Auto attack+ mark Hunter's mark+ pet-attack Pet attack run `nemesis attack` @@ -101,7 +101,8 @@ Hints ----- -Please add `.nemesis` to `.gitignore` or equivalents.+* Please add `.nemesis` to `.gitignore` or equivalents.+* alias `nemesis` to something sweeter, e.g. `n` Advance usage -------------@@ -121,15 +122,15 @@ ### Bypass preprocessing, i.e. run as EDSL -Define `main`, i.e. add `main = run nemesis` in the code. The preprocessor looks for the function main, if it's defined, preprocessing is skipped.+Define `main`, i.e. add `main = run nemesis` in the code. The preprocessor looks for the function `main`, if it's defined, preprocessing is skipped. -This turns `Nemesis` into a pure EDSL in Haskell, which can be invoked by `runghc`.+This turns `Nemesis` into an EDSL in Haskell, runnable by `runghc`. For example: import System.Nemesis (run) import System.Nemesis.DSL- import MPS.Env ((-))+ import Air.Env ((-)) import Prelude hiding ((-)) nemesis = do@@ -143,8 +144,8 @@ runghc Nemesis hello -### Who is mnemosyne?+<br/> -+ -OK, I made a mistake in the project name, but she's a cool goddess none the less.+[The goddess](http://en.wikipedia.org/wiki/Mnemosyne_\(anime\)) is watching you, you shall have your revenge.
src/System/Nemesis.hs view
@@ -99,11 +99,11 @@ Nothing -> bye Just x -> revenge x where- bye = error - s ++ " does not exist!"+ bye = error - s + " does not exist!" revenge :: Task -> IO () revenge t = t.deps.mapM_ run' >> revenge_and_say where revenge_and_say = do- -- putStrLn - "running: " ++ t.name+ -- putStrLn - "running: " + t.name t.action
src/System/Nemesis/DSL.hs view
@@ -5,7 +5,8 @@ import Control.Monad.State hiding (State, join) import Data.Default import Data.List (nub, sort)-import Prelude hiding ((.), (>), (^), (-), lookup)+import Prelude ()+import Air.Env import System import System.Directory import System.FilePath.Glob@@ -53,7 +54,7 @@ status <- system s case status of ExitSuccess -> return ()- ExitFailure code -> error - s ++ " failed with status code: " ++ show code+ ExitFailure code -> error - s + " failed with status code: " + show code clean :: [String] -> Unit clean xs = do
+ src/System/Nemesis/Env.hs view
@@ -0,0 +1,14 @@+module System.Nemesis.Env ++(++ module System.Nemesis.DSL+, module System.Nemesis++)++where+ ++import System.Nemesis.DSL+import System.Nemesis (run)
src/System/Nemesis/Runner.hs view
@@ -13,11 +13,11 @@ start, end :: String-start = start_nemesis ++ start_nemesis_dsl ++ init_mps ++ init_prelude+start = start_nemesis + start_nemesis_dsl + init_air + init_prelude where start_nemesis = "import System.Nemesis (run)\n" start_nemesis_dsl = "import System.Nemesis.DSL\n"- init_mps = "import MPS.Light ((-))\n"+ init_air = "import Air.Light ((-))\n" init_prelude = "import Prelude hiding ((-))\n" end = "\nmain = run nemesis\n" @@ -27,7 +27,7 @@ when recompile compile args <- getArgs- system - "./.nemesis " ++ args.join " "+ system - "./.nemesis " + args.join " " return () where@@ -58,8 +58,8 @@ compile :: IO () compile = do src_name <- get_src_name- let src_o = src_base_name src_name ++ ".o"- src_hi = src_base_name src_name ++ ".hi"+ let src_o = src_base_name src_name + ".o"+ src_hi = src_base_name src_name + ".hi" src <- readFile src_name let maybe_patch_end = yield_string_if_no_line_starts_with main_src_prefix src end@@ -70,15 +70,15 @@ if (maybe_patch_end.isNothing && maybe_patch_start.isNothing && src_name.ends_with ".hs") then do- sh - "ghc --make -O1 " ++ src_name ++ " -o " ++ bin+ sh - "ghc --make -O1 " + src_name + " -o " + bin rm src_o rm src_hi else do if __nem_seperated_footer.null- then output_tmp - maybe_patch_start.fromMaybe "" ++ __nem_seperated_header ++ maybe_patch_end.fromMaybe ""- else output_tmp - __nem_seperated_header ++ maybe_patch_start.fromMaybe "" ++ "\n" ++ __nem_seperated_footer ++ maybe_patch_end.fromMaybe ""+ then output_tmp - maybe_patch_start.fromMaybe "" + __nem_seperated_header + maybe_patch_end.fromMaybe ""+ else output_tmp - __nem_seperated_header + maybe_patch_start.fromMaybe "" + "\n" + __nem_seperated_footer + maybe_patch_end.fromMaybe "" - sh - "ghc --make -O1 " ++ tmp_name ++ " -o " ++ bin+ sh - "ghc --make -O1 " + tmp_name + " -o " + bin rm tmp_name rm tmp_o rm tmp_hi
src/System/Nemesis/Util.hs view
@@ -1,14 +1,14 @@ {-# LANGUAGE NoMonomorphismRestriction #-} module System.Nemesis.Util (- module MPS.Env+ module Air.Env , ls , rm , rm_rf ) where import System.Directory-import MPS.Env hiding (lookup)+import Air.Env hiding (lookup, end) import Prelude () import Data.List ((\\))