Moved formatW3 to web-encodings package
This commit is contained in:
parent
a607da06d3
commit
7df28f4f30
@ -40,7 +40,7 @@ import Data.Object
|
|||||||
import qualified Data.ByteString.Lazy as B
|
import qualified Data.ByteString.Lazy as B
|
||||||
import Data.Object.Instances
|
import Data.Object.Instances
|
||||||
|
|
||||||
import Web.Restful.Utils (formatW3)
|
import Web.Encodings (formatW3)
|
||||||
|
|
||||||
import Test.Framework (testGroup, Test)
|
import Test.Framework (testGroup, Test)
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@ module Web.Restful.Response.AtomFeed
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import Web.Restful.Response
|
import Web.Restful.Response
|
||||||
import Web.Restful.Utils
|
|
||||||
|
|
||||||
import Data.Time.Clock
|
import Data.Time.Clock
|
||||||
import Web.Encodings
|
import Web.Encodings
|
||||||
|
|||||||
@ -21,7 +21,6 @@ module Web.Restful.Response.Sitemap
|
|||||||
|
|
||||||
import Web.Restful.Handler
|
import Web.Restful.Handler
|
||||||
import Web.Restful.Response
|
import Web.Restful.Response
|
||||||
import Web.Restful.Utils
|
|
||||||
import Web.Encodings
|
import Web.Encodings
|
||||||
import qualified Hack
|
import qualified Hack
|
||||||
import Web.Restful.Request
|
import Web.Restful.Request
|
||||||
|
|||||||
@ -15,17 +15,12 @@
|
|||||||
module Web.Restful.Utils
|
module Web.Restful.Utils
|
||||||
( parseHttpAccept
|
( parseHttpAccept
|
||||||
, tryLookup
|
, tryLookup
|
||||||
, formatW3
|
|
||||||
, testSuite
|
, testSuite
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.List.Split (splitOneOf)
|
import Data.List.Split (splitOneOf)
|
||||||
import Data.Maybe (fromMaybe)
|
import Data.Maybe (fromMaybe)
|
||||||
|
|
||||||
import Data.Time.Clock
|
|
||||||
import System.Locale
|
|
||||||
import Data.Time.Format
|
|
||||||
|
|
||||||
import Test.Framework (testGroup, Test)
|
import Test.Framework (testGroup, Test)
|
||||||
import Test.Framework.Providers.HUnit
|
import Test.Framework.Providers.HUnit
|
||||||
import Test.HUnit hiding (Test)
|
import Test.HUnit hiding (Test)
|
||||||
@ -43,10 +38,6 @@ specialHttpAccept _ = False
|
|||||||
tryLookup :: Eq k => v -> k -> [(k, v)] -> v
|
tryLookup :: Eq k => v -> k -> [(k, v)] -> v
|
||||||
tryLookup def key = fromMaybe def . lookup key
|
tryLookup def key = fromMaybe def . lookup key
|
||||||
|
|
||||||
-- | Format a 'UTCTime' in W3 format; useful for setting cookies.
|
|
||||||
formatW3 :: UTCTime -> String
|
|
||||||
formatW3 = formatTime defaultTimeLocale "%FT%X-00:00"
|
|
||||||
|
|
||||||
----- Testing
|
----- Testing
|
||||||
testSuite :: Test
|
testSuite :: Test
|
||||||
testSuite = testGroup "Web.Restful.Response"
|
testSuite = testGroup "Web.Restful.Response"
|
||||||
|
|||||||
@ -29,8 +29,8 @@ library
|
|||||||
bytestring-class,
|
bytestring-class,
|
||||||
web-encodings >= 0.0.1,
|
web-encodings >= 0.0.1,
|
||||||
mtl >= 1.1.0.2,
|
mtl >= 1.1.0.2,
|
||||||
data-object,
|
data-object >= 0.0.2,
|
||||||
yaml >= 0.0.1,
|
yaml >= 0.0.4,
|
||||||
test-framework,
|
test-framework,
|
||||||
test-framework-quickcheck,
|
test-framework-quickcheck,
|
||||||
test-framework-hunit,
|
test-framework-hunit,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user