diff options
| author | Joey Hess <joey@kitenet.net> | 2014-03-31 00:43:28 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-03-31 00:43:28 -0400 |
| commit | 2383674638d14b18a668fa2fcd2689724b4ae4cc (patch) | |
| tree | a9e0b6863ad909440e9d7d91b7dcd782882e90b9 /Propellor/Property/File.hs | |
| parent | 88f876324450ea0d988ee7842cb5243133e05c94 (diff) | |
haddock improvemnts
Diffstat (limited to 'Propellor/Property/File.hs')
| -rw-r--r-- | Propellor/Property/File.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Propellor/Property/File.hs b/Propellor/Property/File.hs index befcc59d..02bf27c0 100644 --- a/Propellor/Property/File.hs +++ b/Propellor/Property/File.hs @@ -4,12 +4,12 @@ import Propellor type Line = String -{- | Replaces all the content of a file. -} +-- | Replaces all the content of a file. hasContent :: FilePath -> [Line] -> Property f `hasContent` newcontent = fileProperty ("replace " ++ f) (\_oldcontent -> newcontent) f -{- | Ensures that a line is present in a file, adding it to the end if not. -} +-- | Ensures that a line is present in a file, adding it to the end if not. containsLine :: FilePath -> Line -> Property f `containsLine` l = fileProperty (f ++ " contains:" ++ l) go f where @@ -17,13 +17,13 @@ f `containsLine` l = fileProperty (f ++ " contains:" ++ l) go f | l `elem` ls = ls | otherwise = ls++[l] -{- | Ensures that a line is not present in a file. - - Note that the file is ensured to exist, so if it doesn't, an empty - - file will be written. -} +-- | Ensures that a line is not present in a file. +-- Note that the file is ensured to exist, so if it doesn't, an empty +-- file will be written. -} lacksLine :: FilePath -> Line -> Property f `lacksLine` l = fileProperty (f ++ " remove: " ++ l) (filter (/= l)) f -{- | Removes a file. Does not remove symlinks or non-plain-files. -} +-- | Removes a file. Does not remove symlinks or non-plain-files. notPresent :: FilePath -> Property notPresent f = check (doesFileExist f) $ Property (f ++ " not present") $ makeChange $ nukeFile f |
