From 4ae03a797f8901e1f606e07ce70c3fedea443285 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 12 Apr 2011 11:47:26 +0200 Subject: Dummy resource provider for testing purposes --- src/Hakyll/Core/Resource/Provider/Dummy.hs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/Hakyll/Core/Resource/Provider/Dummy.hs (limited to 'src/Hakyll/Core/Resource/Provider') diff --git a/src/Hakyll/Core/Resource/Provider/Dummy.hs b/src/Hakyll/Core/Resource/Provider/Dummy.hs new file mode 100644 index 0000000..bc0b16d --- /dev/null +++ b/src/Hakyll/Core/Resource/Provider/Dummy.hs @@ -0,0 +1,21 @@ +-- | Dummy resource provider for testing purposes +-- +module Hakyll.Core.Resource.Provider.Dummy + ( dummyResourceProvider + ) where + +import Data.Map (Map) +import qualified Data.Map as M + +import qualified Data.ByteString.Lazy.Char8 as LBC + +import Hakyll.Core.Resource +import Hakyll.Core.Resource.Provider + +-- | Create a dummy 'ResourceProvider' +-- +dummyResourceProvider :: Map String String -> IO ResourceProvider +dummyResourceProvider vfs = makeResourceProvider + (map Resource (M.keys vfs)) + (return . (vfs M.!) . unResource) + (return . LBC.pack . (vfs M.!) . unResource) -- cgit v1.2.3