class GitPlus::Commands::Trailers

A Git interpret-trailers command wrapper.

Public Class Methods

new(shell: Open3) click to toggle source
# File lib/git_plus/commands/trailers.rb, line 9
def initialize shell: Open3
  @shell = shell
end

Public Instance Methods

call(*arguments) click to toggle source
# File lib/git_plus/commands/trailers.rb, line 13
  def call(*arguments) = shell.capture3("git", "interpret-trailers", *arguments)

  def list *arguments
    call(*arguments.prepend("--only-trailers")).then do |stdout, _stderr, status|
      status.success? ? stdout.split("\n") : []
    end
  end

  private

  attr_reader :shell
end
list(*arguments) click to toggle source
# File lib/git_plus/commands/trailers.rb, line 15
def list *arguments
  call(*arguments.prepend("--only-trailers")).then do |stdout, _stderr, status|
    status.success? ? stdout.split("\n") : []
  end
end