fbe 0.0.38 → 0.0.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fbe/regularly.rb +8 -6
- data/lib/fbe.rb +1 -1
- data/test/fbe/test_award.rb +3 -1
- data/test/fbe/test_regularly.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32f31aad59acf471e8f0075c5ed1d0449a2039fb7d13cd3e0b4c3804b6ef1271
|
4
|
+
data.tar.gz: 65356a4c23c7a6630a0c0387a511cd0d367c72eb2609cb3ded007f9efacbf6e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b50e3e2aaf0a16e640c8dc8068574fdb2dac380b767b00b2ae348c58a7ce0940b4db5dd85719aa263ee19ef5c2d402afef9a41cd31637f9a0e4418415a18ebc5
|
7
|
+
data.tar.gz: 732aedff1ade21b5db01cf591ad343889e234fd7e646d4012c399c9f053651fb220b5c9a746de63bff129efa37614d99c5ef9842fa688b4a7abda687d7c49d06
|
data/lib/fbe/regularly.rb
CHANGED
@@ -25,11 +25,9 @@
|
|
25
25
|
require_relative '../fbe'
|
26
26
|
require_relative 'fb'
|
27
27
|
|
28
|
-
def Fbe.regularly(area,
|
29
|
-
pmp = fb.query("(and (eq what 'pmp') (eq area '#{area}') (exists #{
|
30
|
-
|
31
|
-
since = Time.now - (days * 24 * 60 * 60)
|
32
|
-
interval = pmp.nil? ? 7 : pmp[interval].first
|
28
|
+
def Fbe.regularly(area, p_every_days, p_since_days = nil, fb: Fbe.fb, judge: $judge, loog: $loog, &)
|
29
|
+
pmp = fb.query("(and (eq what 'pmp') (eq area '#{area}') (exists #{p_every_days}))").each.to_a.first
|
30
|
+
interval = pmp.nil? ? 7 : pmp[p_every_days].first
|
33
31
|
unless fb.query(
|
34
32
|
"(and
|
35
33
|
(eq what '#{judge}')
|
@@ -41,6 +39,10 @@ def Fbe.regularly(area, days, interval, fb: Fbe.fb, judge: $judge, loog: $loog,
|
|
41
39
|
f = fb.insert
|
42
40
|
f.what = judge
|
43
41
|
f.when = Time.now
|
44
|
-
|
42
|
+
unless p_since_days.nil?
|
43
|
+
days = pmp.nil? ? 28 : pmp[p_since_days].first
|
44
|
+
since = Time.now - (days * 24 * 60 * 60)
|
45
|
+
f.since = since
|
46
|
+
end
|
45
47
|
yield f
|
46
48
|
end
|
data/lib/fbe.rb
CHANGED
data/test/fbe/test_award.rb
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
# SOFTWARE.
|
24
24
|
|
25
25
|
require 'minitest/autorun'
|
26
|
+
require 'loog'
|
26
27
|
require_relative '../test__helper'
|
27
28
|
require_relative '../../lib/fbe/award'
|
28
29
|
|
@@ -58,7 +59,8 @@ class TestAward < Minitest::Test
|
|
58
59
|
(set b2 (if (lt b2 at_least) b2 0))
|
59
60
|
(set b2 (between b2 3 120))
|
60
61
|
(give b2 "for holding the bug open for too long (${days} days)"))
|
61
|
-
'
|
62
|
+
',
|
63
|
+
judge: '', global: {}, loog: Loog::NULL, options: nil
|
62
64
|
)
|
63
65
|
b = a.bill(hours: 10)
|
64
66
|
assert(b.points <= 100)
|
data/test/fbe/test_regularly.rb
CHANGED