class GitTopic::Cli

CLI command entry point

Public Instance Methods

add(topic_name, summary) click to toggle source
# File lib/git_topic/cli.rb, line 53
def add(topic_name, summary)
  command = GitTopic::Commands::Add.new topic_name, summary
  command.execute
end
delete(topic_name) click to toggle source
# File lib/git_topic/cli.rb, line 59
def delete(topic_name)
  command = GitTopic::Commands::Delete.new topic_name
  command.execute
end
edit(branch_name = nil) click to toggle source
# File lib/git_topic/cli.rb, line 35
def edit(branch_name = nil)
  command = GitTopic::Commands::Edit.new branch_name
  command.execute
end
list() click to toggle source
# File lib/git_topic/cli.rb, line 24
def list
  # Show version if -v specified
  version && return if options[:version]
  # Edit topic if -e specified
  edit && return if options[:edit]

  command = GitTopic::Commands::List.new options
  command.execute
end
publish(repo, base, branch_name) click to toggle source

rubocop:enable Metrics/LineLength

# File lib/git_topic/cli.rb, line 73
def publish(repo, base, branch_name)
  client = Octokit::Client.new(netrc: true)
  command = GitTopic::Commands::Publish.new client, repo, branch_name, base
  command.execute
end
show(branch_name = nil) click to toggle source
# File lib/git_topic/cli.rb, line 41
def show(branch_name = nil)
  command = GitTopic::Commands::Show.new branch_name
  command.execute
end
start(topic_name) click to toggle source
# File lib/git_topic/cli.rb, line 65
def start(topic_name)
  command = GitTopic::Commands::Start.new topic_name
  command.execute
end
version() click to toggle source
# File lib/git_topic/cli.rb, line 47
def version
  puts GitTopic::VERSION
  true
end