gravatar 0.2 → 0.3
raw patch · 3 files changed
+26/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Network.Gravatar: instance Eq Size
+ Network.Gravatar: instance Ord Size
+ Network.Gravatar: instance Show Size
Files
- Network/Gravatar.hs +12/−1
- gravatar.cabal +9/−5
- tests/tests.hs +5/−0
Network/Gravatar.hs view
@@ -13,6 +13,15 @@ -- Return the URL of a gravatar image - an image associated with an -- email address. --+-- Simple use:+--+-- > > gravatar "dons@galois.com"+-- > "http://www.gravatar.com/avatar.php?gravatar_id=f21827076a1d0725c4f4bd5a640102e9"+--+-- Optional arguments to specify the maximum classification rating+-- allowed, a size of the image (between 1 and 80 pixels) and a default url+-- to redirect to are provided by 'gravatarWith'.+-- module Network.Gravatar ( gravatar, gravatarWith@@ -35,6 +44,7 @@ -- | An image size in pixels from 1 to 80. newtype Size = Size Int+ deriving (Eq,Ord,Show) -- | A smart constructor for the Size type, ensuring it is between 1 and 80 size :: Int -> Maybe Size@@ -53,7 +63,8 @@ gravatar who = gravatarWith who Nothing Nothing Nothing -- | Construct the url of a gravatar with optional classification--- ratings, an optional size, and optional default image.+-- rating to limit to, an optional size in pixels, and optional default+-- url to redirect to, should no image be found. -- gravatarWith :: String -> Maybe Rating
gravatar.cabal view
@@ -1,12 +1,16 @@ name: gravatar-version: 0.2+version: 0.3 homepage: http://code.haskell.org/~dons/code/gravatar synopsis: Find the url of the gravatar associated with an email address. description: - Gravatars (<http://gravatar.com>) are globally unique images associated with an email- address, widely used in social networking sites. This library- lets you find the URL of a gravatar .png associated with an email- address.+ Gravatars (<http://gravatar.com>) are globally unique images+ associated with an email address, widely used in social networking+ sites. This library lets you find the URL of a gravatar image+ associated with an email address.+ .+ Test coverage data for this library is available at:+ <http://code.haskell.org/~dons/tests/gravatar/hpc_index.html>+ . category: Network license: BSD3 license-file: LICENSE
tests/tests.hs view
@@ -5,3 +5,8 @@ print $ (gravatarWith "dons@galois.com" (Just R) Nothing (Just "http://haskell.org") ) == "http://www.gravatar.com/avatar.php?gravatar_id=f21827076a1d0725c4f4bd5a640102e9&rating=R&default=http%3A%2F%2Fhaskell.org" + print $ (gravatarWith "dons@galois.com" (Just R) (size 20) (Just "http://haskell.org") ) == "http://www.gravatar.com/avatar.php?gravatar_id=f21827076a1d0725c4f4bd5a640102e9&rating=R&size=20&default=http%3A%2F%2Fhaskell.org"++ -- illegal size+ print $ (gravatarWith "dons@galois.com" (Just R) (size 200) (Just "http://haskell.org") ) == "http://www.gravatar.com/avatar.php?gravatar_id=f21827076a1d0725c4f4bd5a640102e9&rating=R&default=http%3A%2F%2Fhaskell.org"+