- Do not raise an ArgumentError if env() was used with a missing argument
- Reraise RegexpError as Conditions::ArgumentError
- Do not raise Type Error when a missing env var is used as a regular expression
- Raise an argument error if the given condition is not a single string (see #14)
- Multiple regular expressions would fail to parse in certain scenarios (see #12)
- Add subcommands
parse
andeval
totravis-conditions
(previously only supported evaluating conditions, see docs#1978)
- Fix normalizing env vars when mixed with secure vars (see 0c5172)
- Fix broken error class name
- Performance degradation, extract env var parsing to a separate parser.
- Multiple env vars given as a single string would not be recognized properly (see #6)
- Add a
concat
function (see d7de8b) - Add a binary
travis-conditions
for testing conditions
- Allow evaluating individual values according to Ruby's truethiness (see ebc500)
- Allow
||
and&&
(aliases toor
andand
) - Introduce a common base error class for both v0 and v1
- Disallow strings and variables starting with a
$
(no shell code)
Major parser rewrite, removing Parslet
- Variables
os
,dist
,group
,sudo
,language
,commit_message
- Boolean aliases
&&
(alias toAND
),||
(alias toOR
),!
(alias toNOT
) - Operator aliases
==
(alias to=
),~=
(alias to=~
) - Predicates
true
,false
- Line continuation using
\
- Negated
IN
andIS
operators:NOT branch IN (master, dev) # this worked, and continues to work branch NOT IN (master, dev) # this did not work, and now does NOT env(foo) IS present # this worked, and continues to work env(foo) IS NOT present # this did not work, and now does env(foo) IS blank # btw this is the same
- Better boolean language parsing of:
# evaluate individual terms (no operator) true false env(FOO) # compare values 1 = 1 # compare function calls env(FOO) = env(BAR) # compare function calls to variables env(FOO) = type # nested function calls env(env(FOO)) # function calls in lists repo IN (env(ONE), env(OTHER)) # parenthesis (tag =~ ^v) AND (branch = master)
- All values continue to be treated as strings, except
true
andfalse
which are now treated like Ruby's types. - Individual terms such as
true
orenv(FOO)
will now evaluate according to Ruby's concept of truthiness: everything is true except forfalse
and absent values. - Var names and unquoted strings starting with a dollar char
$
now raise a parse error. Bash code is not available. Quoted strings still can start with a dollar char.
- Reraise Parselet::ParseFailed as Travis::Conditions::ParseError
Initial release