travis-conditions 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c260f529b4432a50705b9296e7f5bff49fdb199a
4
- data.tar.gz: 75623d8e139dcd3c7b34e152a72e80d7b49ffeb7
3
+ metadata.gz: a86f16c9d6f3b178157b4244a5e6647777d9ac00
4
+ data.tar.gz: 50b3bf851a1946ad0a0f2dc51e768b5dfc8ea496
5
5
  SHA512:
6
- metadata.gz: 14a0df58f59d5d04c76830f506c4f080e3b50c6fa0b95d21612786a25c499f7fc64526792983b544b85bb5e260adf3ecaac40bc6a8a772dbe23e718db3c287f6
7
- data.tar.gz: 1a4f2b466d2c85c858d018a88dd2bfdd02f973756d880ffa69d058a6724ddaf4606cd0fbed7e48846b31d48b7d437a97af040e7103bdc6718c64c88672940e60
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
+
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module Travis
2
2
  module Conditions
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
@@ -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.1
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: '0'
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: '0'
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: []