language-puppet 1.3.19 → 1.3.19.1
raw patch · 4 files changed
+28/−20 lines, 4 filesdep ~yaml
Dependency ranges changed: yaml
Files
- CHANGELOG +9/−2
- language-puppet.cabal +3/−3
- src/Puppet/Parser.hs +14/−13
- src/Puppet/Runner/Preferences.hs +2/−2
CHANGELOG view
@@ -1,8 +1,15 @@-language-puppet (1.3.18) UNRELEASED; urgency=medium+language-puppet (1.3.19.1) xenial; urgency=medium + * Relaxed yaml version bounds++ -- Simon Marechal <simon.marechal@edf.fr> Wed, 11 Jul 2018 09:38:28 +0200++language-puppet (1.3.19) xenial; urgency=medium+ * Added prefix and suffix functions (Fix #246)+ * Many travis/GHC fixes - -- Simon Marechal <bartavelle@gmail.com> Fri, 18 May 2018 11:42:19 +0200+ -- Simon Marechal <simon.marechal@edf.fr> Thu, 05 Jul 2018 09:36:55 +0200 language-puppet (1.3.17) artful; urgency=medium * Loose upperbound for servant to include 0.13
language-puppet.cabal view
@@ -2,9 +2,9 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: language-puppet-version: 1.3.19+version: 1.3.19.1 synopsis: Tools to parse and evaluate the Puppet DSL.-description: This is a set of tools that is supposed to fill all your Puppet needs : syntax checks, catalog compilation, PuppetDB queries, simulationg of complex interactions between nodes, Puppet master replacement, and more !+description: This is a set of tools that is supposed to fill all your Puppet needs : syntax checks, catalog compilation, PuppetDB queries, simulation of complex interactions between nodes, Puppet master replacement, and more ! homepage: http://lpuppet.banquise.net/ license: BSD3 license-file: LICENSE@@ -137,7 +137,7 @@ , unix >= 2.7 && < 2.8 , unordered-containers == 0.2.* , vector >= 0.10- , yaml >= 0.8.8 && < 0.9+ , yaml >= 0.8.8 && < 0.10 Test-Suite spec hs-source-dirs: tests type: exitcode-stdio-1.0
src/Puppet/Parser.hs view
@@ -50,7 +50,7 @@ -- | Run a puppet parser against some 'Text' input. runPuppetParser :: String -> Text -> Either PuppetParseError (Vector Statement)-runPuppetParser src input = parse puppetParser src input+runPuppetParser = parse puppetParser -- space consumer sc :: Parser ()@@ -296,7 +296,7 @@ terminalG :: Parser Expression -> Parser Expression terminalG g = parens expression <|> fmap (Terminal . UInterpolable) interpolableString- <|> (reserved "undef" *> return (Terminal UUndef))+ <|> (Terminal UUndef <$ reserved "undef") <|> fmap (Terminal . URegexp) termRegexp <|> variable <|> fmap Terminal puppetArray@@ -471,8 +471,8 @@ zipChain (EndOfChain _) = [] depOperator :: Parser LinkType-depOperator = (operator "->" *> pure RBefore)- <|> (operator "~>" *> pure RNotify)+depOperator = (RBefore <$ operator "->")+ <|> (RNotify <$ operator "~>") assignment :: Parser AttributeDecl assignment = (AttributeDecl <$> key <*> arrowOp <*> expression)@@ -481,8 +481,8 @@ key = identl (satisfy Char.isAsciiLower) (satisfy acceptable) <?> "Assignment key" acceptable x = Char.isAsciiLower x || Char.isAsciiUpper x || Char.isDigit x || (x == '_') || (x == '-') arrowOp =- (symbol "=>" *> pure AssignArrow)- <|> (symbol "+>" *> pure AppendArrow)+ (AssignArrow <$ symbol "=>")+ <|> (AppendArrow <$ symbol "+>") searchExpression :: Parser SearchExpression searchExpression = makeExprParser (lexeme searchterm) searchTable@@ -494,7 +494,8 @@ searchterm = parens searchExpression <|> check check = do attrib <- parameterName- opr <- (operator "==" *> return EqualitySearch) <|> (operator "!=" *> return NonEqualitySearch)+ opr <- (EqualitySearch <$ operator "==")+ <|> (NonEqualitySearch <$ operator "!=") term <- stringExpression return (opr attrib term) @@ -789,12 +790,12 @@ <*> fmap tostrict (optional expression) <* symbolic '}' where lambFunc :: Parser LambdaFunc- lambFunc = (reserved "each" *> pure LambEach)- <|> (reserved "map" *> pure LambMap )- <|> (reserved "reduce" *> pure LambReduce)- <|> (reserved "filter" *> pure LambFilter)- <|> (reserved "slice" *> pure LambSlice)- <|> (reserved "lookup" *> pure LambLookup)+ lambFunc = (LambEach <$ reserved "each")+ <|> (LambMap <$ reserved "map")+ <|> (LambReduce <$ reserved "reduce")+ <|> (LambFilter <$ reserved "filter")+ <|> (LambSlice <$ reserved "slice")+ <|> (LambLookup <$ reserved "lookup") lambParams :: Parser LambdaParameters lambParams = between (symbolic '|') (symbolic '|') hp where
src/Puppet/Runner/Preferences.hs view
@@ -99,7 +99,7 @@ testdir = dirpaths ^. testPath hierafile = basedir <> "/hiera.yaml" defaultfile = testdir <> "/defaults.yaml"- defaults <- ifM (Directory.doesFileExist defaultfile) (Yaml.decodeFile defaultfile) (pure Nothing)+ defaults <- ifM (Directory.doesFileExist defaultfile) (either (const Nothing) Just <$> Yaml.decodeFileEither defaultfile) (pure Nothing) hieradir <- ifM (Directory.doesFileExist hierafile) (pure $ Just hierafile) (pure Nothing) loadedtypes <- loadedTypes modulesdir labsFunctions <- Puppetlabs.extFunctions modulesdir@@ -122,7 +122,7 @@ loadedTypes :: FilePath -> IO (HM.HashMap NativeTypeName NativeTypeMethods) loadedTypes modulesdir = do- typenames <- map (Text.pack . FilePath.takeBaseName) <$> (getFiles modulesdir "lib/puppet/type" ".rb")+ typenames <- map (Text.pack . FilePath.takeBaseName) <$> getFiles modulesdir "lib/puppet/type" ".rb" pure $ HM.fromList (map defaulttype typenames) where getFiles :: FilePath -> FilePath -> FilePath -> IO [FilePath]