fbe 0.0.46 → 0.0.47

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: 2431cb14f0a8b96e3c7c1478004756c89c736c41e30a83908955883f677f223f
4
- data.tar.gz: a60cfd3c3083d2e9b89de82992981737ab6d375c920fa10de7413ba584ec36f0
3
+ metadata.gz: 57aa8d066542b79b5a92f0821de21ed2e3252f04ee7e19bd81b80843d5836afb
4
+ data.tar.gz: de5b70d35d2bbabd444a2f4ffcfcbd5fa93dc84d14396dcc5c2ee755abbc013e
5
5
  SHA512:
6
- metadata.gz: ae5a89b06a88acfbde4e41601faad9df89d3155f09f545e8564d2944a18da7c1dfb27a928edfb79beaee51b357cc433bd4fb404542d3e3592305441c2e01a676
7
- data.tar.gz: ffc6494268796dbe1edb4da92163bf107e84e422944000e233f419adc59842ddf0842012da4b43cd2a7ad6080fa1f0150bcde81c894c78e6fc0188bba80458e7
6
+ metadata.gz: bd7ff87c9a4184059d567f50571ba377db46a9c125d5235e1b4d984c09fa631e2d5a976b7ca51ab9f2bd7e87f40d8cfdc502177d17d8b6101d12fb79deb981ea
7
+ data.tar.gz: eb9fa611678efe4291716afbde519fd7b6be8ff4cd63d1c41bcf4edee78ad9f5b803104a531c2810a21f68438dda7fa41dda0d30227da48e52effc5d9e998efd
@@ -24,6 +24,7 @@
24
24
 
25
25
  require_relative '../fbe'
26
26
  require_relative 'fb'
27
+ require_relative 'overwrite'
27
28
 
28
29
  # Run the block provided every X hours.
29
30
  #
@@ -46,5 +47,5 @@ def Fbe.repeatedly(area, p_every_hours, fb: Fbe.fb, judge: $judge, loog: $loog,
46
47
  f.what = judge
47
48
  end
48
49
  Fbe.overwrite(f, 'when', Time.now)
49
- yield f
50
+ yield fb.query("(and (eq what '#{judge}'))").each.to_a.first
50
51
  end
data/lib/fbe.rb CHANGED
@@ -27,5 +27,5 @@
27
27
  # License:: MIT
28
28
  module Fbe
29
29
  # Current version of the gem (changed by .rultor.yml on every release)
30
- VERSION = '0.0.46'
30
+ VERSION = '0.0.47'
31
31
  end
@@ -25,6 +25,7 @@
25
25
  require 'minitest/autorun'
26
26
  require 'loog'
27
27
  require 'factbase'
28
+ require 'judges/options'
28
29
  require_relative '../test__helper'
29
30
  require_relative '../../lib/fbe/repeatedly'
30
31
 
@@ -35,14 +36,16 @@ require_relative '../../lib/fbe/repeatedly'
35
36
  class TestRepeatedly < Minitest::Test
36
37
  def test_simple
37
38
  $fb = Factbase.new
38
- loog = Loog::NULL
39
+ $loog = Loog::NULL
40
+ $options = Judges::Options.new
39
41
  judge = 'test'
40
42
  $global = {}
41
43
  3.times do
42
- Fbe.repeatedly('pmp', 'every_x_hours', loog:, judge:) do |f|
44
+ Fbe.repeatedly('pmp', 'every_x_hours', judge:) do |f|
43
45
  f.foo = 42
44
46
  end
45
47
  end
46
48
  assert_equal(1, $fb.size)
49
+ assert_equal(42, $fb.query('(always)').each.to_a.first.foo)
47
50
  end
48
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.46
4
+ version: 0.0.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko