travis-conditions 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +58 -1
- data/lib/travis/conditions/v1/parser.rb +2 -0
- data/lib/travis/conditions/version.rb +1 -1
- data/spec/v1/parser_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea032c74717ced7cdcdbf1f9fed09af0eafb65e0
|
4
|
+
data.tar.gz: 81e2e8d949278dda1bee0673293fa349cc344f9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea8155f5a42a6e5c6783d7c5b62c8833d4ccecd06e3457c1545ae36f4c89e54bf0df324dac264b61b763dc5516e361f49c18b59e7a28d7e56943f1aba7f9c899
|
7
|
+
data.tar.gz: 89cf722d13984d39c98c56b322346b2dfb62fc03514d39b77712699a24527a648a6406bdbd2e8ec42389e450467dff358168a64ce96c9001050bd916ffc7cfe7
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,63 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## v1.0.7
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- Raise an argument error if the given condition is not a single string (see [#14](https://github.com/travis-ci/travis-conditions/pull/14))
|
8
|
+
|
9
|
+
## v1.0.6
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
|
13
|
+
- Multiple regular expressions would fail to parse in certain scenarios (see [#12](https://github.com/travis-ci/travis-conditions/pull/12))
|
14
|
+
|
15
|
+
### Added
|
16
|
+
|
17
|
+
- Add subcommands `parse` and `eval` to `travis-conditions` (previously only supported evaluating conditions, see [docs#1978](https://github.com/travis-ci/docs-travis-ci-com/pull/1978))
|
18
|
+
|
19
|
+
## v1.0.5
|
20
|
+
|
21
|
+
### Fixed
|
22
|
+
|
23
|
+
- Fix normalizing env vars when mixed with secure vars (see [0c5172](https://github.com/travis-ci/travis-conditions/commit/0c517267fd490a7cecd12e4dd484f1c5bfbacba2))
|
24
|
+
|
25
|
+
## v1.0.4
|
26
|
+
|
27
|
+
### Fixed
|
28
|
+
|
29
|
+
- Fix broken error class name
|
30
|
+
|
31
|
+
## v1.0.3
|
32
|
+
|
33
|
+
### Fixed
|
34
|
+
|
35
|
+
- Performance degradation, extract env var parsing to a [separate parser](https://github.com/travis-ci/travis-env_vars).
|
36
|
+
|
37
|
+
## v1.0.2
|
38
|
+
|
39
|
+
### Fixed
|
40
|
+
|
41
|
+
- Multiple env vars given as a single string would not be recognized properly (see [#6](https://github.com/travis-ci/travis-conditions/pull/6))
|
42
|
+
|
43
|
+
## v1.0.1
|
44
|
+
|
45
|
+
### Added
|
46
|
+
|
47
|
+
- Add a `concat` function (see [d7de8b](https://github.com/travis-ci/travis-conditions/commit/d7de8b1dc4f0b17efa9e2caaee43798c782890fa))
|
48
|
+
- Add a binary `travis-conditions` for testing conditions
|
49
|
+
|
50
|
+
## v1.0.0-dev.2
|
51
|
+
|
52
|
+
### Added
|
53
|
+
|
54
|
+
- Allow evaluating individual values according to Ruby's truethiness (see [ebc500](https://github.com/travis-ci/travis-conditions/commit/ebc50084dacda358607e0f23a898c3ed30e1f4a7))
|
55
|
+
- Allow `||` and `&&` (aliases to `or` and `and`)
|
56
|
+
- Introduce a common base error class for both v0 and v1
|
57
|
+
|
58
|
+
### Changed
|
59
|
+
|
60
|
+
- Disallow strings and variables starting with a `$` (no shell code)
|
4
61
|
|
5
62
|
## v1.0.0-dev.1
|
6
63
|
|
@@ -78,6 +78,7 @@ module Travis
|
|
78
78
|
}
|
79
79
|
|
80
80
|
MSGS = {
|
81
|
+
invalid: 'Invalid condition: %p',
|
81
82
|
parse_error: 'Could not parse %s',
|
82
83
|
shell_var: 'Variable names cannot start with a dollar (shell code does not work). If you are trying to compare to an env var, please use env("name")',
|
83
84
|
shell_str: 'Strings cannot start with a dollar (shell code does not work). This can be bypassed by quoting the string.'
|
@@ -87,6 +88,7 @@ module Travis
|
|
87
88
|
attr_reader :str
|
88
89
|
|
89
90
|
def initialize(str)
|
91
|
+
raise ArgumentError, MSGS[:invalid] % [str] unless str.is_a?(String)
|
90
92
|
@str = StringScanner.new(filter(str))
|
91
93
|
end
|
92
94
|
|
data/spec/v1/parser_spec.rb
CHANGED
@@ -483,4 +483,9 @@ describe Travis::Conditions::V1::Parser do
|
|
483
483
|
it '$FOO = bar' do
|
484
484
|
expect { subject }.to raise_error(Travis::Conditions::ParseError)
|
485
485
|
end
|
486
|
+
|
487
|
+
describe 'given an array of strings' do
|
488
|
+
let(:str) { ['foo', 'bar'] }
|
489
|
+
it { expect { subject }.to raise_error(Travis::Conditions::ArgumentError, 'Invalid condition: ["foo", "bar"]') }
|
490
|
+
end
|
486
491
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: travis-conditions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis CI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|