factbase 0.14.6 → 0.14.7

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
  SHA256:
3
- metadata.gz: a74a73e5bfec2f7ff39d41428d6c1cbacaaf374d7b2d4b987df0833a0864f0d3
4
- data.tar.gz: 684f79dcdae19e8fe5a2b3deb6b21d786e5f9b75e81624a08a5a28f9af3e8597
3
+ metadata.gz: 64a0e23c152de8f55a3ca0b94a90a123d6d7cea7d1288d41cbb34ac8e11deae4
4
+ data.tar.gz: 67ce5f29a5a4d1e2fbb7436bade89907ae33d6f80926d32be2d999248fc642bb
5
5
  SHA512:
6
- metadata.gz: 29ebcc501c156e5d84d216224918df28df4dfb114e438139b90276a297bdefa373bc848d0d93919035444a40f29c77e83aa22a2e29e5c04e10aa3d5db71068a0
7
- data.tar.gz: 8741e804d14332085756fe5c15edb1efa28d0db8357e445f42a097d96d6f63fe87bb48ca2f9b7239e7ed87ca87d7722001be6bf8564824384033b1bb86bb543f
6
+ metadata.gz: 3605722b88fd2ea98d242e16b6e9760bf24703b12c5169db318f68e80e5f0782b0434f1e8087d6ca751b361b24dc6f768c7b1b4ea6a71d07179d22460d54f325
7
+ data.tar.gz: 6f01d24ea249d7d951776c785439abba4dfb3ca81efe13c789d8222480b35033428dada4062ed2ffbf452257efb6a9cc1aaff45ce889d63002122fcbfa31a3fa
data/lib/factbase/inv.rb CHANGED
@@ -82,6 +82,10 @@ class Factbase::Inv
82
82
  @fb = fb
83
83
  end
84
84
 
85
+ def to_s
86
+ @query.to_s
87
+ end
88
+
85
89
  def each(fb = @fb, params = {})
86
90
  return to_enum(__method__, fb, params) unless block_given?
87
91
  @query.each(fb, params) do |f|
@@ -96,6 +96,10 @@ class Factbase::Rules
96
96
  @fb = fb
97
97
  end
98
98
 
99
+ def to_s
100
+ @query.to_s
101
+ end
102
+
99
103
  def each(fb = @fb, params = {})
100
104
  return to_enum(__method__, fb, params) unless block_given?
101
105
  @query.each(fb, params) do |f|
@@ -20,6 +20,11 @@ class Factbase::SyncQuery
20
20
  @fb = fb
21
21
  end
22
22
 
23
+ # Turn it to a string.
24
+ def to_s
25
+ @origin.to_s
26
+ end
27
+
23
28
  # Iterate facts one by one.
24
29
  # @param [Hash] params Optional params accessible in the query via the "$" symbol
25
30
  # @yield [Fact] Facts one-by-one
@@ -75,6 +75,10 @@ class Factbase::Tallied
75
75
  @fb = fb
76
76
  end
77
77
 
78
+ def to_s
79
+ @query.to_s
80
+ end
81
+
78
82
  def one(fb = @fb, params = {})
79
83
  @query.one(fb, params)
80
84
  end
@@ -9,5 +9,5 @@
9
9
  # License:: MIT
10
10
  class Factbase
11
11
  # Current version of the gem (changed by .rultor.yml on every release)
12
- VERSION = '0.14.6' unless const_defined?(:VERSION)
12
+ VERSION = '0.14.7' unless const_defined?(:VERSION)
13
13
  end
@@ -265,6 +265,12 @@ class TestQuery < Factbase::Test
265
265
  end
266
266
  end
267
267
 
268
+ def test_turns_query_to_string
269
+ with_factbases do |badge, fb|
270
+ assert_equal('(always)', fb.query('(always)').to_s, "Fails with #{badge}")
271
+ end
272
+ end
273
+
268
274
  def test_to_array
269
275
  maps = []
270
276
  maps << { 'foo' => [42] }
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.14.6
4
+ version: 0.14.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko