packages feed

lambdabot-novelty-plugins 5.0 → 5.0.1

raw patch · 2 files changed

+15/−10 lines, 2 filesdep ~bytestringdep ~lambdabot-core

Dependency ranges changed: bytestring, lambdabot-core

Files

lambdabot-novelty-plugins.cabal view
@@ -1,5 +1,5 @@ name:                   lambdabot-novelty-plugins-version:                5.0+version:                5.0.1  license:                GPL license-file:           LICENSE@@ -15,13 +15,21 @@                         Provided plugins:                         .                         [bf] Run Brainf*ck code.+                        .                         [dice] Roll some dice.+                        .                         [elite] zPEak Gib8erI$|-|.+                        .                         [filter] More gibberish.+                        .                         [numberwang] Sorry, that's not Numberwang.+                        .                         [quote] Parrot profound wisdom.+                        .                         [slap] Delegate punishment.+                        .                         [unlambda] Run Unlambda code.+                        .                         [vixen] Let's chat, honey.  homepage:               http://haskell.org/haskellwiki/Lambdabot@@ -59,7 +67,7 @@                         containers              >= 0.4,                         dice                    >= 0.1,                         directory               >= 1.1,-                        lambdabot-core          >= 5 && < 5.1,+                        lambdabot-core          >= 5.0.1 && < 5.1,                         misfortune              >= 0.1,                         process                 >= 1.1,                         random-fu               >= 0.2,
src/Lambdabot/Plugin/Novelty/Vixen.hs view
@@ -12,6 +12,7 @@ import Control.Monad import Data.Binary import qualified Data.ByteString.Char8 as P+import qualified Data.ByteString.Lazy as L import System.Directory import Text.Regex.TDFA @@ -52,14 +53,10 @@      -- suck in our (read only) regex state from disk     -- compile it, and stick it in the plugin state-    , moduleInit = do-        vixenFile <- lb (findOrCreateLBFile "vixen")-        b <- io (doesFileExist vixenFile)-        when b $ do-            st <- io (decodeFile vixenFile)-            let compiled = map (makeRegex *** id) (st :: [(String, WTree)])-                s = vixen (mkResponses compiled)-            modifyMS $ \(v,_) -> (v, s)+    , moduleSerialize = Just $ readOnly $ \bs ->+         let st = decode (L.fromStrict bs)+             compiled = map (makeRegex *** id) (st :: [(String, WTree)])+         in  (True, vixen (mkResponses compiled))     }  ------------------------------------------------------------------------