packages feed

forest-fire 0.2.1 → 0.2.2

raw patch · 4 files changed

+19/−5 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

app/Main.hs view
@@ -33,8 +33,7 @@                              putStrLn usage                              exitFailure -printVersion = do-  putStrLn $ "forest-fire v" ++ showVersion version+printVersion = putStrLn $ "forest-fire v" ++ showVersion version  descr = "Recursively find and delete CFn dependencies!\n\n" usage = "usage: forest-fire <stackname> [--delete]\n" ++
forest-fire.cabal view
@@ -1,5 +1,5 @@ name:                forest-fire-version:             0.2.1+version:             0.2.2 synopsis:            Recursively delete CloudFormation stacks and their dependants description:   This simple tool will repeatedly query CloudFormation
src/JSONInstances.hs view
@@ -10,7 +10,7 @@  instance FromJSON Export where   parseJSON = withObject "Export" $ \t ->-    Export <$> t .: "ExportName"+    Export <$> t .:? "ExportName" .!= ExportName ""  instance FromJSON Stacks where   parseJSON = withObject "Stacks" $ \t ->@@ -37,7 +37,9 @@ instance AWSExecution IO where   findExportsByStack s = do     json <- eitherDecode <$> jsonForDescribeStacks s :: IO (Either String Stacks)-    either error (pure . map eName . concatMap sExports . sStacks) json+    either error (pure . map eName . filter anon . concatMap sExports . sStacks) json+      where anon (Export name) | name == ExportName "" = False+                               | otherwise             = True    whoImportsThisValue e = do     json <- eitherDecode <$> jsonForListImports e :: IO (Either String Imports)
test/Spec.hs view
@@ -18,6 +18,7 @@     "Unit tests"     [trivialDepsTree, dagIsntTree     ,deletionTrivial, deletionDAG+    ,ignoreUnnamedExports     ,testJSONparsing]  main = defaultMain tests@@ -86,3 +87,15 @@       out     where stuff = do json <- eitherDecode <$> B.readFile "test/aws-output-test.json"                      either error (pure . map eName . concatMap sExports . sStacks) json++-- TODO make this actually use the code from findExportsByStack..+ignoreUnnamedExports =+  testCase "test stack-describe with missing ExportNames" $ do+    out <- stuff+    assertEqual []+      [ExportName "buildkite-agent-nnruto-gd-ut-oem"]+      out+    where stuff = do json <- eitherDecode <$> B.readFile "test/empty-exportname.json"+                     either error (pure . map eName . filter anon . concatMap sExports . sStacks) json+          anon (Export name) | name == ExportName "" = False+                             | otherwise             = True