string-random 0.1.0.0 → 0.1.1.0
raw patch · 2 files changed
+112/−54 lines, 2 filesdep +optparse-applicativedep ~textnew-component:exe:hstrrand
Dependencies added: optparse-applicative
Dependency ranges changed: text
Files
- app/hstrrand.hs +24/−0
- string-random.cabal +88/−54
+ app/hstrrand.hs view
@@ -0,0 +1,24 @@+{-# LANGUAGE Strict #-}+module Main (main) where++import Data.Monoid ((<>))+import qualified Options.Applicative as Options+import qualified Data.Text as Text+import qualified Data.Text.IO as Text+import qualified Text.StringRandom as StringRandom++argParser :: Options.Parser Text.Text+argParser = Text.pack <$> Options.strArgument+ ( Options.metavar "REGEXP"+ <> Options.help "Regexp as a template (e.g. '[1-3]{2}random[!?]')"+ )++main :: IO ()+main = do+ pat <- Options.execParser opts+ txt <- StringRandom.stringRandomIO pat+ Text.putStrLn txt+ where+ opts = Options.info (Options.helper <*> argParser)+ ( Options.fullDesc+ <> Options.header "hstrrand - Generate string which matches REGEXP" )
string-random.cabal view
@@ -1,60 +1,94 @@-name: string-random-version: 0.1.0.0-synopsis: A library for generating random string from a regular experession-description: With this package you can generate random strings from- regular expressions. If you are using QuickCheck, you can- also check the quickcheck-string-random package.-homepage: https://github.com/hiratara/hs-string-random#readme-license: BSD3-license-file: LICENSE-author: Masahiro Honma-maintainer: hiratara@cpan.org-copyright: Copyright (C) 2016- hiratara-category: Text-build-type: Simple-cabal-version: >=1.10-tested-with: GHC ==8.0.1+-- This file has been generated from package.yaml by hpack version 0.28.2.+--+-- see: https://github.com/sol/hpack+--+-- hash: ee087fb3e5d9dd1de970f1bd3e7e170f27f5e2a692d7ccc9eb345548dab06c07 +name: string-random+version: 0.1.1.0+synopsis: A library for generating random string from a regular experession+description: With this package you can generate random strings from+ regular expressions. If you are using QuickCheck, you can+ also check the quickcheck-string-random package.+category: Text+homepage: https://github.com/hiratara/hs-string-random#readme+bug-reports: https://github.com/hiratara/hs-string-random/issues+author: Masahiro Honma+maintainer: hiratara@cpan.org+copyright: Copyright (C) 2016- hiratara+license: BSD3+license-file: LICENSE+tested-with: GHC==8.0.1+build-type: Simple+cabal-version: >= 1.10++source-repository head+ type: git+ location: https://github.com/hiratara/hs-string-random+ library- hs-source-dirs: src- exposed-modules: Text.StringRandom- , Text.StringRandom.Parser- build-depends: base >= 4.9 && < 5- , attoparsec >=0.13.1 && <0.14- , containers >=0.5.7.1 && <0.6- , random >=1.1 && <1.2- , text >=1.2.2.1 && <1.3- , transformers >=0.5.2.0 && <0.6- default-language: Haskell2010+ exposed-modules:+ Text.StringRandom+ Text.StringRandom.Parser+ other-modules:+ Paths_string_random+ hs-source-dirs:+ src+ build-depends:+ attoparsec >=0.13.1 && <0.14+ , base >=4.9 && <5+ , containers >=0.5.7.1 && <0.6+ , random >=1.1 && <1.2+ , text >=1.2.2.1 && <1.3+ , transformers >=0.5.2.0 && <0.6+ default-language: Haskell2010 -test-suite string-random-test- type: exitcode-stdio-1.0- hs-source-dirs: test- main-is: string-random-test.hs- build-depends: base- , bytestring- , pcre-heavy- , string-random- , tasty- , tasty-hunit- , text- ghc-options: -threaded -rtsopts -with-rtsopts=-N- default-language: Haskell2010+executable hstrrand+ main-is: hstrrand.hs+ other-modules:+ Paths_string_random+ hs-source-dirs:+ app+ ghc-options: -O2 -threaded -Wall+ build-depends:+ base >=4.9 && <5+ , optparse-applicative+ , string-random+ , text+ default-language: Haskell2010 test-suite string-random-quickcheck- type: exitcode-stdio-1.0- hs-source-dirs: test- main-is: string-random-quickcheck.hs- build-depends: base- , pcre-heavy- , QuickCheck- , string-random- , tasty- , tasty-quickcheck- , text- ghc-options: -threaded -rtsopts -with-rtsopts=-N- default-language: Haskell2010+ type: exitcode-stdio-1.0+ main-is: string-random-quickcheck.hs+ other-modules:+ Paths_string_random+ hs-source-dirs:+ test+ ghc-options: -threaded -rtsopts -with-rtsopts=-N+ build-depends:+ QuickCheck+ , base+ , pcre-heavy+ , string-random+ , tasty+ , tasty-quickcheck+ , text+ default-language: Haskell2010 -source-repository head- type: git- location: https://github.com/hiratara/hs-string-random+test-suite string-random-test+ type: exitcode-stdio-1.0+ main-is: string-random-test.hs+ other-modules:+ Paths_string_random+ hs-source-dirs:+ test+ ghc-options: -threaded -rtsopts -with-rtsopts=-N+ build-depends:+ base+ , bytestring+ , pcre-heavy+ , string-random+ , tasty+ , tasty-hunit+ , text+ default-language: Haskell2010