fbe 0.41.6 → 0.42.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b5d47bbe77b20ccc3ef6a6999868a14ece4179820fcfa6399d95b5f337847c4
4
- data.tar.gz: ed8adf2adf7788b6e9a1b5db1f0c72fb79f1c819ccfadd783254ea6f7d7423b9
3
+ metadata.gz: e20ce6012a663c91fa76f4e332db9fcca0df0a00b5fae7ef53bb559653b8657d
4
+ data.tar.gz: 76daff2e00b453611de5591b622b36e1ca16aaea86fd80966df27eec9738a187
5
5
  SHA512:
6
- metadata.gz: c39aede26820313b2c38717d7580a59e3596155ba4a469896cb5639c226b339231af20851c5497c3a3d5b15dd298db20af5b97d29058ab2d2b5250253b0f1aee
7
- data.tar.gz: 5ba8916e613ce8036b712c42c1edca912ac61c4265e8680bd3358bcfa9ccab74b9f1d89cce356e20699cb8a8881f812868ebdfaad94695963059c79a40131672
6
+ metadata.gz: 535591e915b299f2ccd78d85e2a4f3876b539e9d6c39ac45e2da0e326cfc3309c13b84706567f94d2714b103da66abba634a90f155d42c8f68a4fe64b8417b3f
7
+ data.tar.gz: a36a7ee9b7349deb85d05245cc2ade4366d429ea450e3180926a9d092e6a5087898038d4b37866c8d80c4ca1939186fac67b1f1fc26a996d18946f60eabdfe74
@@ -15,7 +15,7 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - name: Download actionlint
20
20
  id: get_actionlint
21
21
  run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
@@ -12,7 +12,7 @@ jobs:
12
12
  timeout-minutes: 15
13
13
  runs-on: ubuntu-24.04
14
14
  steps:
15
- - uses: actions/checkout@v5
15
+ - uses: actions/checkout@v6
16
16
  - uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  ruby-version: 3.4.7
@@ -11,5 +11,5 @@ jobs:
11
11
  timeout-minutes: 15
12
12
  runs-on: ubuntu-24.04
13
13
  steps:
14
- - uses: actions/checkout@v5
14
+ - uses: actions/checkout@v6
15
15
  - uses: yegor256/copyrights-action@0.0.12
@@ -19,5 +19,5 @@ jobs:
19
19
  timeout-minutes: 15
20
20
  runs-on: ubuntu-24.04
21
21
  steps:
22
- - uses: actions/checkout@v5
22
+ - uses: actions/checkout@v6
23
23
  - uses: DavidAnson/markdownlint-cli2-action@v20.0.0
@@ -15,5 +15,5 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - uses: volodya-lombrozo/pdd-action@master
@@ -18,7 +18,7 @@ jobs:
18
18
  ruby: [3.3]
19
19
  runs-on: ${{ matrix.os }}
20
20
  steps:
21
- - uses: actions/checkout@v5
21
+ - uses: actions/checkout@v6
22
22
  - uses: ruby/setup-ruby@v1
23
23
  with:
24
24
  ruby-version: ${{ matrix.ruby }}
@@ -15,5 +15,5 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - uses: fsfe/reuse-action@v6
@@ -15,7 +15,7 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - uses: crate-ci/typos@v1.39.0
20
20
  with:
21
21
  config: .github/.typos.toml
@@ -11,5 +11,5 @@ jobs:
11
11
  timeout-minutes: 15
12
12
  runs-on: ubuntu-24.04
13
13
  steps:
14
- - uses: actions/checkout@v5
14
+ - uses: actions/checkout@v6
15
15
  - uses: g4s8/xcop-action@master
@@ -15,7 +15,7 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - uses: ibiqlik/action-yamllint@v3
20
20
  with:
21
21
  config_file: .yamllint.yml
data/lib/fbe/tombstone.rb CHANGED
@@ -22,11 +22,32 @@ class Fbe::Tombstone
22
22
  @fid = fid
23
23
  end
24
24
 
25
+ # See all issues in the tombstone, as array of numbers.
26
+ # @param [String] where The place, e.g. "github"
27
+ # @param [Integer] repo ID of repository
28
+ # @return [Array<Integer>] IDs of issue
29
+ def issues(where, repo)
30
+ raise 'The type of "where" is not String' unless where.is_a?(String)
31
+ raise 'The type of "repo" is not Integer' unless repo.is_a?(Integer)
32
+ f = @fb.query(
33
+ "(and (eq where '#{where}') (eq what 'tombstone') (eq repository #{repo}) (exists issues))"
34
+ ).each.first
35
+ return [] if f.nil?
36
+ f['issues'].map do |ii|
37
+ a, b = ii.split('-').map(&:to_i)
38
+ b = a if b.nil?
39
+ (a..b).map { |i| i }
40
+ end.flatten
41
+ end
42
+
25
43
  # Put it there.
26
44
  # @param [String] where The place, e.g. "github"
27
45
  # @param [Integer] repo ID of repository
28
- # @param [Integer] issue ID of issue (or array of them)
46
+ # @param [Integer, Array<Integer>] issue ID of issue (or array of them)
29
47
  def bury!(where, repo, issue)
48
+ raise 'The type of "where" is not String' unless where.is_a?(String)
49
+ raise 'The type of "repo" is not Integer' unless repo.is_a?(Integer)
50
+ raise 'The type of "issue" is neither Integer nor Array' unless issue.is_a?(Integer) || issue.is_a?(Array)
30
51
  f =
31
52
  Fbe.if_absent(fb: @fb, always: true) do |n|
32
53
  n.what = 'tombstone'
@@ -48,16 +69,20 @@ class Fbe::Tombstone
48
69
  end
49
70
  end
50
71
  Fbe.overwrite(
51
- f, 'issues', merged.map { |ii| ii[0] == ii[1] ? ii[0].to_s : "#{ii[0]}-#{ii[1]}" }, fb: @fb, fid: @fid
72
+ f, 'issues', merged.map { |ii| ii[0] == ii[1] ? ii[0].to_s : "#{ii[0]}-#{ii[1]}" },
73
+ fb: @fb, fid: @fid
52
74
  )
53
75
  end
54
76
 
55
77
  # Is it there?
56
78
  # @param [String] where The place, e.g. "github"
57
79
  # @param [Integer] repo ID of repository
58
- # @param [Integer] issue ID of issue (or array of them)
80
+ # @param [Integer, Array<Integer>] issue ID of issue (or array of them)
59
81
  # @return [Boolean] True if it's there
60
82
  def has?(where, repo, issue)
83
+ raise 'The type of "where" is not String' unless where.is_a?(String)
84
+ raise 'The type of "repo" is not Integer' unless repo.is_a?(Integer)
85
+ raise 'The type of "issue" is neither Integer nor Array' unless issue.is_a?(Integer) || issue.is_a?(Array)
61
86
  f = @fb.query(
62
87
  "(and (eq where '#{where}') (eq what 'tombstone') (eq repository #{repo}) (exists issues))"
63
88
  ).each.first
data/lib/fbe.rb CHANGED
@@ -10,5 +10,5 @@
10
10
  # License:: MIT
11
11
  module Fbe
12
12
  # Current version of the gem (changed by +.rultor.yml+ on every release)
13
- VERSION = '0.41.6' unless const_defined?(:VERSION)
13
+ VERSION = '0.42.0' unless const_defined?(:VERSION)
14
14
  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.41.6
4
+ version: 0.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko