Sha256: b01cd2f420a9042795ad81f235d7272aa3083f37d6e262526e8030d7476037cf

Contents?: true

Size: 1.79 KB

Versions: 21

Compression:

Stored size: 1.79 KB

Contents

# frozen_string_literal: true

# MIT License
#
# Copyright (c) 2024 Zerocracy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

require_relative '../fbe'

# Converts an ID of GitHub issue into a nicely formatting string.
#
# @param [Factbase::Fact] fact The fact, where to get the ID of GitHub issue
# @param [Judges::Options] options The options coming from the +judges+ tool
# @param [Hash] global The hash for global caching
# @param [Loog] loog The logging facility
def Fbe.issue(fact, options: $options, global: $global, loog: $loog)
  rid = fact['repository']
  raise "There is no 'repository' property" if rid.nil?
  rid = rid.first.to_i
  issue = fact['issue']
  raise "There is no 'issue' property" if issue.nil?
  issue = issue.first.to_i
  "#{Fbe.octo(global:, options:, loog:).repo_name_by_id(rid)}##{issue}"
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
fbe-0.0.76 lib/fbe/issue.rb
fbe-0.0.75 lib/fbe/issue.rb
fbe-0.0.74 lib/fbe/issue.rb
fbe-0.0.73 lib/fbe/issue.rb
fbe-0.0.72 lib/fbe/issue.rb
fbe-0.0.71 lib/fbe/issue.rb
fbe-0.0.70 lib/fbe/issue.rb
fbe-0.0.69 lib/fbe/issue.rb
fbe-0.0.68 lib/fbe/issue.rb
fbe-0.0.67 lib/fbe/issue.rb
fbe-0.0.66 lib/fbe/issue.rb
fbe-0.0.65 lib/fbe/issue.rb
fbe-0.0.64 lib/fbe/issue.rb
fbe-0.0.63 lib/fbe/issue.rb
fbe-0.0.62 lib/fbe/issue.rb
fbe-0.0.61 lib/fbe/issue.rb
fbe-0.0.60 lib/fbe/issue.rb
fbe-0.0.59 lib/fbe/issue.rb
fbe-0.0.58 lib/fbe/issue.rb
fbe-0.0.57 lib/fbe/issue.rb