factbase 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 4659be0304d67fcd6639ae27a0ca2ebc065a9dc7499d45454447ca18812e0698
4
- data.tar.gz: 40df86a0bd3a24b11f4124cb234683a7fc8e58fa05835bbfb7e761323c2746a7
3
+ metadata.gz: 776ba2273b1a5e1c8891d67796ddf15559c537e2ba7138129e1b750e64ffe649
4
+ data.tar.gz: a217e8041bc9558ee64c23bc6000e06b78b0e7a310bb052b88d2370fbad66a3f
5
5
  SHA512:
6
- metadata.gz: 03deff34f5739536073ec7c6fc0869a1d2a213528ebef2b7832a794ca3a086fb19642dcb497e2a8cc37305e2ed818e84765c37a7ea9b5390f6dc30b8271479bf
7
- data.tar.gz: 48e1693cdea380fd71408521f6e7ec4783427f2316445361ce549c597bb9b836a75e3227b9c370e0afe4b780cd8f1ded9f38d28d17622b3cb993923ee62bdaea
6
+ metadata.gz: f60eae4b86b001ae6fa116a3970ed77cdbdbb24d97d038adc6f6ef9e80583718cbdd8e075964ed87caa7dd3ffc42f0f29a059f731a6baa4ab38b7124513c3ef8
7
+ data.tar.gz: d873fdcb2cad4c0f730020c2d903d5b051251c20541bb9979c8c24f674b1e92cef676ca213dcc95128f58b64e2769ee2ba2e4fa8bb53ac5b7060ae93a03f71bb
@@ -21,7 +21,11 @@
21
21
  name: copyrights
22
22
  'on':
23
23
  push:
24
+ branches:
25
+ - master
24
26
  pull_request:
27
+ branches:
28
+ - master
25
29
  jobs:
26
30
  copyrights:
27
31
  runs-on: ubuntu-22.04
@@ -21,7 +21,11 @@
21
21
  name: xcop
22
22
  'on':
23
23
  push:
24
+ branches:
25
+ - master
24
26
  pull_request:
27
+ branches:
28
+ - master
25
29
  jobs:
26
30
  xcop:
27
31
  runs-on: ubuntu-22.04
@@ -31,6 +31,6 @@ module Factbase::Term::System
31
31
  def env(fact, maps)
32
32
  assert_args(2)
33
33
  n = the_values(0, fact, maps)[0]
34
- ENV.fetch(n.upcase) { the_values(1, fact, maps)[1] }
34
+ ENV.fetch(n.upcase) { the_values(1, fact, maps)[0] }
35
35
  end
36
36
  end
data/lib/factbase.rb CHANGED
@@ -81,7 +81,7 @@ require 'yaml'
81
81
  # License:: MIT
82
82
  class Factbase
83
83
  # Current version of the gem (changed by .rultor.yml on every release)
84
- VERSION = '0.2.0'
84
+ VERSION = '0.2.1'
85
85
 
86
86
  # An exception that may be thrown in a transaction, to roll it back.
87
87
  class Rollback < StandardError; end
@@ -34,4 +34,16 @@ class TestSystem < Minitest::Test
34
34
  t = Factbase::Term.new(:env, ['FOO', ''])
35
35
  assert_equal('bar', t.evaluate(fact, []))
36
36
  end
37
+
38
+ def test_default
39
+ ENV.delete('FOO')
40
+ t = Factbase::Term.new(:env, ['FOO', 'мой друг'])
41
+ assert_equal('мой друг', t.evaluate(fact, []))
42
+ end
43
+
44
+ def test_when_default_is_absent
45
+ ENV.delete('FOO')
46
+ t = Factbase::Term.new(:env, ['FOO'])
47
+ assert_raises { t.evaluate(fact, []) }
48
+ end
37
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-22 00:00:00.000000000 Z
11
+ date: 2024-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace