fbe 0.33.0 → 0.34.0
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 +4 -4
- data/Gemfile.lock +2 -2
- data/assets/bylaws/{code-contribution-was-rewarded.liquid → code-contribution-was-rewarded.fe.liquid} +3 -7
- data/lib/fbe/bylaws.rb +2 -2
- data/lib/fbe/consider.rb +28 -0
- data/lib/fbe.rb +1 -1
- metadata +12 -11
- /data/assets/bylaws/{bad-branch-name-was-punished.liquid → bad-branch-name-was-punished.fe.liquid} +0 -0
- /data/assets/bylaws/{bug-report-was-rewarded.liquid → bug-report-was-rewarded.fe.liquid} +0 -0
- /data/assets/bylaws/{code-review-was-rewarded.liquid → code-review-was-rewarded.fe.liquid} +0 -0
- /data/assets/bylaws/{dud-was-punished.liquid → dud-was-punished.fe.liquid} +0 -0
- /data/assets/bylaws/{enhancement-suggestion-was-rewarded.liquid → enhancement-suggestion-was-rewarded.fe.liquid} +0 -0
- /data/assets/bylaws/{long-pull-was-punished.liquid → long-pull-was-punished.fe.liquid} +0 -0
- /data/assets/bylaws/{published-release-was-rewarded.liquid → published-release-was-rewarded.fe.liquid} +0 -0
- /data/assets/bylaws/{push-to-master-was-punished.liquid → push-to-master-was-punished.fe.liquid} +0 -0
- /data/assets/bylaws/{resolved-bug-was-rewarded.liquid → resolved-bug-was-rewarded.fe.liquid} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d40e7887e9c6e73b462571ba9ce5d55e53803f49ffd8f75f2599910e66907c14
|
4
|
+
data.tar.gz: fedeb150bf39faff3b67f160ecca956670da69b5d367951d2835297ef5aa6bd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23507c63c45d42a3c1b742f2f3a73a5a57b84a783a23765886a334b2c74dfdbe49818a1023f54c95d0dc368acbc403532646e32275a84544f70f4ac2c27bf257
|
7
|
+
data.tar.gz: bb4f0ca37ef989a0c52d06608d13b6561ffefe99a5f8e3e3ee4c461936cec91591c063cf9c0c4d88596694fe237ef9aab7e4849bbaa340214db34ee2b7230a97
|
data/Gemfile.lock
CHANGED
@@ -76,7 +76,7 @@ GEM
|
|
76
76
|
ellipsized (0.3.0)
|
77
77
|
ethon (0.15.0)
|
78
78
|
ffi (>= 1.15.0)
|
79
|
-
factbase (0.16.
|
79
|
+
factbase (0.16.2)
|
80
80
|
backtrace (~> 0.4)
|
81
81
|
decoor (~> 0.1)
|
82
82
|
ellipsized (~> 0.3)
|
@@ -188,7 +188,7 @@ GEM
|
|
188
188
|
rake (13.3.0)
|
189
189
|
regexp_parser (2.11.2)
|
190
190
|
retries (0.0.5)
|
191
|
-
rexml (3.4.
|
191
|
+
rexml (3.4.3)
|
192
192
|
rubocop (1.80.2)
|
193
193
|
json (~> 2.3)
|
194
194
|
language_server-protocol (~> 3.17.0.2)
|
@@ -17,24 +17,20 @@
|
|
17
17
|
(set bonus_for_hoc (if (lt hoc hoc_threshold) (times hoc hoc_k) 0))
|
18
18
|
(set bonus_for_hoc (between bonus_for_hoc hoc_min hoc_max))
|
19
19
|
(give bonus_for_hoc "for the ${hoc} hits-of-code that you wrote")
|
20
|
-
"add ${hoc_k} points for each
|
21
|
-
[hit-of-code](https://www.yegor256.com/2014/11/14/hits-of-code.html),
|
22
|
-
but not more than ${hoc_max} points")
|
20
|
+
"add ${hoc_k} points for each [hit-of-code](https://www.yegor256.com/2014/11/14/hits-of-code.html), but not more than ${hoc_max} points")
|
23
21
|
|
24
22
|
(aka
|
25
23
|
(let many_hoc_fee {{ 4 | times: anger }})
|
26
24
|
(set penalty_for_hoc (if (gte hoc hoc_threshold) (times -1 many_hoc_fee) 0))
|
27
25
|
(give penalty_for_hoc "for too many hits-of-code (${hoc} >= ${hoc_threshold})")
|
28
|
-
"deduct ${many_hoc_fee} points if more than ${hoc_threshold}
|
29
|
-
[hits-of-code](https://www.yegor256.com/2014/11/14/hits-of-code.html)")
|
26
|
+
"deduct ${many_hoc_fee} points if more than ${hoc_threshold} [hits-of-code](https://www.yegor256.com/2014/11/14/hits-of-code.html)")
|
30
27
|
|
31
28
|
(aka
|
32
29
|
(let many_hoc_fee2 {{ 8 | times: anger }})
|
33
30
|
(let hoc_threshold2 {{ 1600 | divided_by: paranoia }})
|
34
31
|
(set penalty_for_hoc2 (if (gte hoc hoc_threshold2) (times -1 many_hoc_fee2) 0))
|
35
32
|
(give penalty_for_hoc2 "for way too many hits-of-code (${hoc} >= ${hoc_threshold2})")
|
36
|
-
"deduct ${many_hoc_fee2} points if more than ${hoc_threshold2}
|
37
|
-
[hits-of-code](https://www.yegor256.com/2014/11/14/hits-of-code.html)")
|
33
|
+
"deduct ${many_hoc_fee2} points if more than ${hoc_threshold2} [hits-of-code](https://www.yegor256.com/2014/11/14/hits-of-code.html)")
|
38
34
|
|
39
35
|
(aka
|
40
36
|
(let no_review_fee {{ 8 | times: anger }})
|
data/lib/fbe/bylaws.rb
CHANGED
@@ -41,10 +41,10 @@ def Fbe.bylaws(anger: 2, love: 2, paranoia: 2)
|
|
41
41
|
raise "The 'paranoia' must be in the [1..4] interval: #{paranoia.inspect}" unless paranoia.positive? && paranoia < 5
|
42
42
|
home = File.join(__dir__, '../../assets/bylaws')
|
43
43
|
raise "The directory with templates is absent #{home.inspect}" unless File.exist?(home)
|
44
|
-
Dir[File.join(home, '*.liquid')].to_h do |f|
|
44
|
+
Dir[File.join(home, '*.fe.liquid')].to_h do |f|
|
45
45
|
formula = Liquid::Template.parse(File.read(f)).render(
|
46
46
|
'anger' => anger, 'love' => love, 'paranoia' => paranoia
|
47
47
|
)
|
48
|
-
[File.basename(f).gsub(/\.liquid$/, ''), formula]
|
48
|
+
[File.basename(f).gsub(/\.fe.liquid$/, ''), formula]
|
49
49
|
end
|
50
50
|
end
|
data/lib/fbe/consider.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
4
|
+
# SPDX-License-Identifier: MIT
|
5
|
+
|
6
|
+
require_relative '../fbe'
|
7
|
+
require_relative 'conclude'
|
8
|
+
require_relative 'fb'
|
9
|
+
|
10
|
+
# Creates an instance of {Fbe::Conclude} and then runs "consider" in it.
|
11
|
+
#
|
12
|
+
# @param [String] query The query
|
13
|
+
# @param [Factbase] fb The factbase
|
14
|
+
# @param [String] judge The name of the judge, from the +judges+ tool
|
15
|
+
# @param [Hash] global The hash for global caching
|
16
|
+
# @param [Judges::Options] options The options coming from the +judges+ tool
|
17
|
+
# @param [Loog] loog The logging facility
|
18
|
+
# @yield [Factbase::Fact] The fact
|
19
|
+
def Fbe.consider(
|
20
|
+
query,
|
21
|
+
fb: Fbe.fb, judge: $judge, loog: $loog, options: $options, global: $global,
|
22
|
+
start: $start, &
|
23
|
+
)
|
24
|
+
Fbe.conclude(fb:, judge:, loog:, options:, global:, start:) do
|
25
|
+
on query
|
26
|
+
consider(&)
|
27
|
+
end
|
28
|
+
end
|
data/lib/fbe.rb
CHANGED
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.
|
4
|
+
version: 0.34.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
@@ -351,21 +351,22 @@ files:
|
|
351
351
|
- README.md
|
352
352
|
- REUSE.toml
|
353
353
|
- Rakefile
|
354
|
-
- assets/bylaws/bad-branch-name-was-punished.liquid
|
355
|
-
- assets/bylaws/bug-report-was-rewarded.liquid
|
356
|
-
- assets/bylaws/code-contribution-was-rewarded.liquid
|
357
|
-
- assets/bylaws/code-review-was-rewarded.liquid
|
358
|
-
- assets/bylaws/dud-was-punished.liquid
|
359
|
-
- assets/bylaws/enhancement-suggestion-was-rewarded.liquid
|
360
|
-
- assets/bylaws/long-pull-was-punished.liquid
|
361
|
-
- assets/bylaws/published-release-was-rewarded.liquid
|
362
|
-
- assets/bylaws/push-to-master-was-punished.liquid
|
363
|
-
- assets/bylaws/resolved-bug-was-rewarded.liquid
|
354
|
+
- assets/bylaws/bad-branch-name-was-punished.fe.liquid
|
355
|
+
- assets/bylaws/bug-report-was-rewarded.fe.liquid
|
356
|
+
- assets/bylaws/code-contribution-was-rewarded.fe.liquid
|
357
|
+
- assets/bylaws/code-review-was-rewarded.fe.liquid
|
358
|
+
- assets/bylaws/dud-was-punished.fe.liquid
|
359
|
+
- assets/bylaws/enhancement-suggestion-was-rewarded.fe.liquid
|
360
|
+
- assets/bylaws/long-pull-was-punished.fe.liquid
|
361
|
+
- assets/bylaws/published-release-was-rewarded.fe.liquid
|
362
|
+
- assets/bylaws/push-to-master-was-punished.fe.liquid
|
363
|
+
- assets/bylaws/resolved-bug-was-rewarded.fe.liquid
|
364
364
|
- fbe.gemspec
|
365
365
|
- lib/fbe.rb
|
366
366
|
- lib/fbe/award.rb
|
367
367
|
- lib/fbe/bylaws.rb
|
368
368
|
- lib/fbe/conclude.rb
|
369
|
+
- lib/fbe/consider.rb
|
369
370
|
- lib/fbe/copy.rb
|
370
371
|
- lib/fbe/delete.rb
|
371
372
|
- lib/fbe/delete_one.rb
|
/data/assets/bylaws/{bad-branch-name-was-punished.liquid → bad-branch-name-was-punished.fe.liquid}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/data/assets/bylaws/{push-to-master-was-punished.liquid → push-to-master-was-punished.fe.liquid}
RENAMED
File without changes
|
/data/assets/bylaws/{resolved-bug-was-rewarded.liquid → resolved-bug-was-rewarded.fe.liquid}
RENAMED
File without changes
|