epub-tools 2.7 → 2.8
raw patch · 4 files changed
+52/−3 lines, 4 files
Files
- changelog.md +6/−1
- epub-tools.cabal +1/−1
- src/EpubTools/EpubName/Doc/Rules.hs +6/−1
- testsuite/EpubTools/Test/EpubName/Format.hs +39/−0
changelog.md view
@@ -1,6 +1,11 @@+2.8 (2015-09-18)++ * Fixed some magazine and anthology naming rules++ 2.7 (2015-05-29) - * Added back Control.Applicative import for GHC 7.8 compatibility+ * Added back Control.Applicative import for GHC 7.8 compatibility 2.6 (2015-05-25)
epub-tools.cabal view
@@ -1,6 +1,6 @@ name: epub-tools cabal-version: >= 1.8-version: 2.7+version: 2.8 build-type: Simple license: BSD3 license-file: LICENSE
src/EpubTools/EpubName/Doc/Rules.hs view
@@ -72,7 +72,7 @@ , " name \"(1)(3)-(monthNum 2)\"" , "" , "magLightspeed_issue"- , " titlePat \"(Lightspeed).* Issue (.*)\""+ , " titlePat \"(Lightspeed).* Issue ([^ ]+)(.*)\"" , " name \"(1)(pad 3 2)\"" , "" , "magNemesis"@@ -116,6 +116,11 @@ , " authorMatch \"Woman's Institute\"" , " titlePat \"(.*)\"" , " name \"(scrub 1)\""+ , ""+ , "anthology_date"+ , " subjectMatch \"anthology\""+ , " titlePat \"(.*) - ([^ ]+) ([0-9]{4})\""+ , " name \"(scrub 1)(3)-(monthNum 2)\"" , "" , "anthology" , " subjectMatch \"anthology\""
testsuite/EpubTools/Test/EpubName/Format.hs view
@@ -95,6 +95,7 @@ , testLightspeedDate , testLightspeedMagIssue , testLightspeedIssue+ , testLightspeedMagIssueDate , testMagWeirdTales , testMagGalaxysEdge , testMagPlasmaFreq@@ -103,6 +104,7 @@ , testMagGenericVolNo3 , testMagSubjWithIssue , testWomensInstituteLib+ , testAnthologyDate , testAnthology ] @@ -1346,6 +1348,21 @@ ) +testLightspeedMagIssueDate :: (Globals, [Formatter]) -> Test+testLightspeedMagIssueDate (gs, fs) = TestCase $+ assertNewName gs { gMetadata = meta } fs+ "Lightspeed Magazine, both issue and date in title" expected+ where+ meta = emptyMetadata+ { metaTitles = [Title Nothing Nothing Nothing+ "Lightspeed Magazine, Issue 62 (July 2015)"]+ }+ expected =+ ( "magLightspeed_issue"+ , "Lightspeed062.epub"+ )++ testMagWeirdTales :: (Globals, [Formatter]) -> Test testMagWeirdTales (gs, fs) = TestCase $ assertNewName gs { gMetadata = meta } fs@@ -1484,6 +1501,28 @@ expected = ( "nonficWomensInstituteLibrary" , "WomansInstituteLibraryOfCookery_Volume1_EssentialsOfCookeryCerealsBreadHotBreads.epub"+ )+++testAnthologyDate :: (Globals, [Formatter]) -> Test+testAnthologyDate (gs, fs) = TestCase $+ assertNewName gs { gMetadata = meta } fs+ "anthology with date in title" expected+ where+ meta = emptyMetadata+ { metaTitles = [Title Nothing Nothing Nothing "Flash Fiction Online - June 2015"]+ , metaCreators =+ [ Creator (Just "art") (Just "Bijelac, Dario") Nothing+ "Dario Bijelac"+ , Creator (Just "aut") (Just "Pearlman, Laura") Nothing+ "Laura Pearlman"+ ]+ , metaDates = [ Date Nothing "2015-05-30T18:47:28.000000+00:00" ]+ , metaSubjects = ["anthology"]+ }+ expected =+ ( "anthology_date"+ , "FlashFictionOnline2015-06.epub" )