battlenet-yesod (empty) → 0.1.0.1
raw patch · 4 files changed
+112/−0 lines, 4 filesdep +basedep +battlenetdep +http-conduitsetup-changed
Dependencies added: base, battlenet, http-conduit, yesod-core
Files
- BattleNet/Yesod.hs +19/−0
- LICENSE +20/−0
- Setup.hs +2/−0
- battlenet-yesod.cabal +71/−0
+ BattleNet/Yesod.hs view
@@ -0,0 +1,19 @@+module BattleNet.Yesod(YesodBattleNet(..), yesodBnetWithApp, yesodBnet) where++import BattleNet+import Yesod.Core+import Control.Monad+import Network.HTTP.Conduit++class YesodBattleNet app where+ battleNetKey :: app -> BattleNetApiKey+ battleNetHttp :: app -> Manager++yesodBnetWithApp :: (YesodBattleNet app) => app -> (Manager -> BattleNetApiKey -> IO a) -> IO a+yesodBnetWithApp yesod endpoint =+ endpoint manager key+ where key = battleNetKey yesod+ manager = battleNetHttp yesod++yesodBnet :: (MonadHandler m, YesodBattleNet (HandlerSite m)) => (Manager -> BattleNetApiKey -> IO a) -> m a+yesodBnet endpoint = getYesod >>= liftIO . (flip yesodBnetWithApp endpoint)
+ LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) 2014 Teo Klestrup Röijezon++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 above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++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.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ battlenet-yesod.cabal view
@@ -0,0 +1,71 @@+-- Initial battlenet.cabal generated by cabal init. For further+-- documentation, see http://haskell.org/cabal/users-guide/++-- The name of the package.+name: battlenet-yesod++-- The package version. See the Haskell package versioning policy (PVP)+-- for standards guiding when and how versions should be incremented.+-- http://www.haskell.org/haskellwiki/Package_versioning_policy+-- PVP summary: +-+------- breaking API changes+-- | | +----- non-breaking API additions+-- | | | +--- code changes with no API change+version: 0.1.0.1++-- A short (one-line) description of the package.+synopsis: Yesod integration for the battlenet package++-- A longer description of the package.+description: Yesod integration for the battlenet package++homepage: https://github.com/teozkr/hs-battlenet/++-- The license under which the package is released.+license: MIT++-- The file containing the license text.+license-file: LICENSE++-- The package author(s).+author: Teo Klestrup Röijezon++-- An email address to which users can send suggestions, bug reports, and+-- patches.+maintainer: teo@nullable.se++-- A copyright notice.+-- copyright:++category: Network++build-type: Simple++-- Extra files to be distributed with the package, such as examples or a+-- README.+-- extra-source-files:++-- Constraint on the version of Cabal needed to build this package.+cabal-version: >=1.10+++library+ -- Modules exported by the library.+ exposed-modules: BattleNet.Yesod++ -- Modules included in this library but not exported.+ -- other-modules:++ -- LANGUAGE extensions used by modules in this package.+ default-extensions: OverloadedStrings+ FlexibleContexts++ -- Other library packages from which modules are imported.+ build-depends: base >=4.7 && <4.8,+ http-conduit >=2.1.4 && <2.2,+ battlenet >=0.1 && <0.2,+ yesod-core+ -- Directories containing source files.+ -- hs-source-dirs:++ -- Base language which the package is written in.+ default-language: Haskell2010