class Devpad::CLI::Commands::Repository::Commit::List

Public Class Methods

new(shell:) click to toggle source
# File lib/devpad/cli/commands/repository/commit/list.rb, line 7
def initialize(shell:)
  @shell = shell
end

Public Instance Methods

execute(params = {}) click to toggle source
# File lib/devpad/cli/commands/repository/commit/list.rb, line 11
def execute(params = {})
  rows = Devpad::API::Repository::Commit.all(params).each_with_index.map do |commit, index|
    [index + 1, commit.sha, "#{commit.author_name} <#{commit.author_email}>", commit.message]
  end
  @shell.print_table rows
  @shell.say "(Page #{params['page']})"
end