arion 0.1.0.4 → 0.1.0.5
raw patch · 6 files changed
+34/−36 lines, 6 files
Files
- LICENSE +17/−20
- arion.cabal +8/−8
- src/Arion/EventProcessor.hs +2/−2
- src/Arion/Runner.hs +2/−2
- src/Arion/Types.hs +4/−3
- src/Arion/Utilities.hs +1/−1
LICENSE view
@@ -1,24 +1,21 @@-This is free and unencumbered software released into the public domain.+The MIT License (MIT) -Anyone is free to copy, modify, publish, use, compile, sell, or-distribute this software, either in source code form or as a compiled-binary, for any purpose, commercial or non-commercial, and by any-means.+Copyright (c) 2015 Karun Ramakrishnan -In jurisdictions that recognize copyright laws, the author or authors-of this software dedicate any and all copyright interest in the-software to the public domain. We make this dedication for the benefit-of the public at large and to the detriment of our heirs and-successors. We intend this dedication to be an overt act of-relinquishment in perpetuity of all present and future rights to this-software under copyright law.+Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR-OTHER DEALINGS IN THE SOFTWARE.+The above copyright notice and this permission notice shall be included in+all copies or substantial portions of the Software. -For more information, please refer to <http://unlicense.org/>+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN+THE SOFTWARE.
arion.cabal view
@@ -1,8 +1,8 @@ name: arion-version: 0.1.0.4+version: 0.1.0.5 synopsis: Watcher and runner for Hspec description: Watcher and runner for Hspec-license: PublicDomain+license: MIT license-file: LICENSE author: Karun Ramakrishnan maintainer: karun012@gmail.com@@ -18,8 +18,8 @@ executable arion main-is: Main.hs- build-depends: base >=4.6 && <4.7,- fsnotify ==0.1.0.3,+ build-depends: base >=4.6 && <5,+ fsnotify >=0.1.0.3, filemanip, system-filepath, containers,@@ -27,7 +27,7 @@ split, text, safe,- process >= 1.2.0.0,+ process >=1.2.0.0, directory, transformers other-modules: Arion.Runner,@@ -42,9 +42,9 @@ test-suite test default-language: Haskell2010 HS-Source-Dirs: test, src- build-depends: base >=4.6 && <4.7,+ build-depends: base >=4.6 && <5, hspec,- fsnotify ==0.1.0.3,+ fsnotify >=0.1.0.3, filemanip, time, system-filepath,@@ -53,7 +53,7 @@ split, text, safe,- process >= 1.2.0.0,+ process >=1.2.0.0, directory type: exitcode-stdio-1.0 ghc-options: -threaded
src/Arion/EventProcessor.hs view
@@ -4,7 +4,7 @@ ) where import Arion.Types-import System.FSNotify+import System.FSNotify (Event(..)) import Filesystem.Path.CurrentOS (encodeString) import Data.List (isSuffixOf) import qualified Data.Map as M@@ -22,7 +22,7 @@ Source -> let testFiles = M.lookup filePath sourceToTestFileMap in toCommandCandidates testFiles Test -> [filePath]- in Echo (filePath ++ " changed") : map (CabalCommand . RunHaskell sourceFolder) commandCandidates+ in Echo (filePath ++ " changed") : map (CabalExec . RunHaskell sourceFolder) commandCandidates | otherwise = [] toCommandCandidates :: Maybe [TestFile] -> [String]
src/Arion/Runner.hs view
@@ -13,8 +13,8 @@ import Control.Exception (try, SomeException) import Control.Concurrent (forkIO) import System.Directory (canonicalizePath)-import Control.Applicative ((<$>), liftA2, (<*>))-import Control.Monad ((=<<), liftM2)+import Control.Applicative ((<$>))+import Control.Monad ((=<<)) import Arion.Types import Arion.EventProcessor
src/Arion/Types.hs view
@@ -12,17 +12,17 @@ import Data.List (isInfixOf) import Data.List.Split (splitOn)-import Text.Regex.Posix+import Text.Regex.Posix ((=~), getAllTextMatches) import Data.Map (Map) data Command = RunHaskell { sourceFolder :: String, commandString :: String } | Echo String |- CabalCommand { command :: Command } deriving (Eq)+ CabalExec { command :: Command } deriving (Eq) instance Show Command where show (RunHaskell sourceFolder commandString) = "runhaskell -- -i" ++ sourceFolder ++ " " ++ commandString show (Echo stringToEcho) = "echo " ++ stringToEcho- show (CabalCommand command) = "cabal exec " ++ show command+ show (CabalExec command) = "cabal exec " ++ show command type FileContent = String @@ -75,6 +75,7 @@ importedModule :: [String] -> String importedModule [_, moduleName] = moduleName+importedModule [_, _, moduleName, _, _] = moduleName importedModule _ = "" getModuleName :: FileContent -> String
src/Arion/Utilities.hs view
@@ -4,7 +4,7 @@ import Arion.Types import Data.Map (Map, fromList)-import Data.List+import Data.List (union) associate :: [SourceFile] -> [TestFile] -> Map FilePath [TestFile] associate sourceFiles testFiles = let preTransitive = map (createAssociations testFiles) sourceFiles