servant-github 0.1.0.1 → 0.1.0.2
raw patch · 2 files changed
+1/−60 lines, 2 filesdep ~base
Dependency ranges changed: base
Files
- app/Main.hs +0/−48
- servant-github.cabal +1/−12
− app/Main.hs
@@ -1,48 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-module Main where--import System.Exit-import System.Environment-import Control.Monad.IO.Class-import Control.Monad-import Data.Monoid-import Data.Maybe-import Data.String-import Data.Text as T-import Data.Text.IO as T--import Network.GitHub--main :: IO ()-main = do-- -- Get AuthToken from environment variable- token <- fmap fromString <$> lookupEnv "GITHUB_TOKEN"-- -- Require the token for this to work- when (not $ isJust token) $ do- T.putStrLn "Please set the GITHUB_TOKEN env variable" - exitFailure-- -- Run GitHub computation, print errors if there are any- errors <- runGitHub (printTeams "dragonfly-science") token- case errors of- Left e -> liftIO $ print e- Right _ -> exitSuccess--printOrgsAndTeams :: GitHub ()-printOrgsAndTeams = do- os <- userOrganisations- forM_ os $ \o -> do- liftIO $ T.putStrLn (orgLogin o)- printTeams (orgLogin o)--printTeams :: OrgLogin -> GitHub ()-printTeams ol = do- teams <- organisationTeams ol- forM_ teams $ \t -> do- liftIO $ T.putStrLn $ " " <> teamName t- members <- teamMembers (teamId t)- liftIO $ T.putStrLn $ " " <> T.intercalate ", " [ memberLogin m | m <- members]- repos <- teamRepositories (teamId t)- liftIO $ T.putStrLn $ " " <> T.intercalate ", " [ repositoryName r | r <- repos]
servant-github.cabal view
@@ -1,5 +1,5 @@ name: servant-github-version: 0.1.0.1+version: 0.1.0.2 synopsis: Bindings to GitHub API using servant. description: This package provides a servant-client based client for accessing the <https://developer.github.com/v3/ GitHub API v3>.@@ -45,17 +45,6 @@ , servant-client , text , transformers- default-language: Haskell2010--executable servant-github-example- hs-source-dirs: app- main-is: Main.hs- ghc-options: -threaded -rtsopts -with-rtsopts=-N- build-depends: base- , either- , text- , transformers- , servant-github default-language: Haskell2010 test-suite servant-github-test