factbase 0.0.59 → 0.0.60

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: c62bd0cae1b70119954f0f2c1eef5ef9ff92e7073dc5f86492cc1f048456580c
4
- data.tar.gz: 7cfd0410d94217f51b84e41707c1bfecd493f022a840507f18a2d92fd9bb3d9c
3
+ metadata.gz: ebfb3fe82bdf543291f6fd7630c2b69deb3949e6788b79d85c5d58ea733240b3
4
+ data.tar.gz: 38d05a0630a444f8a77e67b96a3f90aa213ec5f47b764c25401fd90320449ae7
5
5
  SHA512:
6
- metadata.gz: 46d98f86cc24e7ca8db4c543fe34080c2571009e0715699be377fdd4a4589d0a99165c9d45ae2e2fbc432d2592231be7122d0c1c45bc77c5d351c497d1fee703
7
- data.tar.gz: d8f0f6e49e6d5c7740f3d70f46860a425f1f9de3a91bdf927cec4579f87aac4357e5e0a6e148d7d9d58ed34a99ddc1ad57c40c0018e735110083f30a594d1ee4
6
+ metadata.gz: 29f84d7e12a5cd5b4260590cc40f0a74afa500bec5aaad9f8f3e2c0673fc7864ef9a7c7ac30d08bd5015c3fb87f23cf7123b2ae54306ba58d15c0d0d834f350c
7
+ data.tar.gz: 1aab5b40d3f47148377d302284af4bed085580bafb4de9acc7b3b9c602e502bdfd3814063095c33f80f63439fe213d190aa9067c55e93c00662f1c3556aa8287
@@ -29,12 +29,12 @@ require_relative '../../factbase'
29
29
  # License:: MIT
30
30
  module Factbase::Term::Strings
31
31
  def concat(fact, maps)
32
- (0..@operands.length - 1).map { |i| the_values(i, fact, maps)[0] }.join
32
+ (0..@operands.length - 1).map { |i| the_values(i, fact, maps)&.first }.join
33
33
  end
34
34
 
35
35
  def sprintf(fact, maps)
36
36
  fmt = the_values(0, fact, maps)[0]
37
- ops = (1..@operands.length - 1).map { |i| the_values(i, fact, maps)[0] }
37
+ ops = (1..@operands.length - 1).map { |i| the_values(i, fact, maps)&.first }
38
38
  format(*([fmt] + ops))
39
39
  end
40
40
 
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.0.59'
84
+ VERSION = '0.0.60'
85
85
 
86
86
  # An exception that may be thrown in a transaction, to roll it back.
87
87
  class Rollback < StandardError; end
@@ -29,8 +29,9 @@ require_relative '../../../lib/factbase/term'
29
29
  # License:: MIT
30
30
  class TestStrings < Minitest::Test
31
31
  def test_concat
32
- t = Factbase::Term.new(:concat, [42, 'hi', 3.14, Time.now])
33
- assert(t.evaluate(fact, []).start_with?('42hi3.14'))
32
+ t = Factbase::Term.new(:concat, [42, 'hi', 3.14, :hey, Time.now])
33
+ s = t.evaluate(fact, [])
34
+ assert(s.start_with?('42hi3.14'), s)
34
35
  end
35
36
 
36
37
  def test_concat_empty
@@ -39,7 +40,7 @@ class TestStrings < Minitest::Test
39
40
  end
40
41
 
41
42
  def test_sprintf
42
- t = Factbase::Term.new(:sprintf, ['hi, %s!', 'Jeff'])
43
+ t = Factbase::Term.new(:sprintf, ['hi, %s!', 'Jeff', :hey])
43
44
  assert_equal('hi, Jeff!', t.evaluate(fact, []))
44
45
  end
45
46
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.59
4
+ version: 0.0.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko