travis-conditions 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +22 -0
- data/lib/travis/conditions.rb +4 -0
- data/lib/travis/conditions/version.rb +1 -1
- data/spec/parser_spec.rb +5 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a86f16c9d6f3b178157b4244a5e6647777d9ac00
|
4
|
+
data.tar.gz: 50b3bf851a1946ad0a0f2dc51e768b5dfc8ea496
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c95e11b39596ad69528635ce1d761ac17ccc9104fbffd7fe3a1b2dc43f830e991275c67d65ea09e5584f24f8b0da61c4c9a455709cce16055d07ceaa8437fd9a
|
7
|
+
data.tar.gz: a74367ce97002a1ec80e5c1de63547ac2d5a21d12e6af07a0910fe3d4bbddc17b8ef0d510bb08749c9ce286ba234217ba732dc29cba22f45bdf220a2101fd8f0
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
MIT LICENSE
|
2
|
+
|
3
|
+
Copyright (c) 2017 Travis CI GmbH <contact@travis-ci.org>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
22
|
+
|
data/lib/travis/conditions.rb
CHANGED
@@ -4,6 +4,8 @@ require 'travis/conditions/parser'
|
|
4
4
|
|
5
5
|
module Travis
|
6
6
|
module Conditions
|
7
|
+
ParseError = Class.new(StandardError)
|
8
|
+
|
7
9
|
class << self
|
8
10
|
def eval(str, data)
|
9
11
|
Eval.new(parse(str, keys: data.keys), Data.new(data)).apply
|
@@ -12,6 +14,8 @@ module Travis
|
|
12
14
|
def parse(str, opts = {})
|
13
15
|
tree = parser(opts).parse(str)
|
14
16
|
Transform.new.apply(tree)
|
17
|
+
rescue Parslet::ParseFailed
|
18
|
+
raise ParseError
|
15
19
|
end
|
16
20
|
|
17
21
|
def parser(opts)
|
data/spec/parser_spec.rb
CHANGED
@@ -272,4 +272,9 @@ describe Travis::Conditions do
|
|
272
272
|
it { should eq [:not, [:or, [:eq, [:env, 'a'], '1'],[:eq, [:env, 'b'], '2']]] }
|
273
273
|
end
|
274
274
|
end
|
275
|
+
|
276
|
+
describe 'parse error' do
|
277
|
+
let(:str) { 'wat.kaputt' }
|
278
|
+
it { expect { subject }.to raise_error(Travis::Conditions::ParseError) }
|
279
|
+
end
|
275
280
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: travis-conditions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis CI
|
@@ -14,16 +14,16 @@ dependencies:
|
|
14
14
|
name: parslet
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.8'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.8'
|
27
27
|
description:
|
28
28
|
email: contact@travis-ci.org
|
29
29
|
executables: []
|
@@ -32,6 +32,7 @@ extra_rdoc_files: []
|
|
32
32
|
files:
|
33
33
|
- Gemfile
|
34
34
|
- Gemfile.lock
|
35
|
+
- LICENSE
|
35
36
|
- README.md
|
36
37
|
- lib/travis/conditions.rb
|
37
38
|
- lib/travis/conditions/data.rb
|
@@ -43,7 +44,8 @@ files:
|
|
43
44
|
- spec/parser_spec.rb
|
44
45
|
- spec/spec_helper.rb
|
45
46
|
homepage: https://github.com/travis-ci/travis-conditions
|
46
|
-
licenses:
|
47
|
+
licenses:
|
48
|
+
- MIT
|
47
49
|
metadata: {}
|
48
50
|
post_install_message:
|
49
51
|
rdoc_options: []
|