travis-conditions 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cb3e113cdc4a371a2fe5de849be3570fe8b606a
4
- data.tar.gz: 3cb1e7b0112ac22b8b15462caa7df1bd6eb5876f
3
+ metadata.gz: ea032c74717ced7cdcdbf1f9fed09af0eafb65e0
4
+ data.tar.gz: 81e2e8d949278dda1bee0673293fa349cc344f9b
5
5
  SHA512:
6
- metadata.gz: 4d7015a0e92d371d100731a2dbee62d207bbcd641d3752e14cafd88e518948558c6980d41402d14a689291a3b4ce1089bdf4291bc72f2dd7db0763ba7464eb03
7
- data.tar.gz: a65d7844b120833b8ff4387481bc8bfa141a30dff599bcd21fe83a819d1621c9c17157ffb7e2645533bd6f28428b6ef8dbdbb09680003d1b509af6e35f7c4fbe
6
+ metadata.gz: ea8155f5a42a6e5c6783d7c5b62c8833d4ccecd06e3457c1545ae36f4c89e54bf0df324dac264b61b763dc5516e361f49c18b59e7a28d7e56943f1aba7f9c899
7
+ data.tar.gz: 89cf722d13984d39c98c56b322346b2dfb62fc03514d39b77712699a24527a648a6406bdbd2e8ec42389e450467dff358168a64ce96c9001050bd916ffc7cfe7
data/CHANGELOG.md CHANGED
@@ -1,6 +1,63 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased]
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
 
@@ -1,5 +1,5 @@
1
1
  module Travis
2
2
  module Conditions
3
- VERSION = '1.0.6'
3
+ VERSION = '1.0.7'
4
4
  end
5
5
  end
@@ -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.6
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-14 00:00:00.000000000 Z
11
+ date: 2018-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet