Class: GitTopic::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/git_topic/cli.rb

Overview

CLI command entry point

Instance Method Summary collapse

Instance Method Details

#add(topic_name, summary) ⇒ Object



49
50
51
52
# File 'lib/git_topic/cli.rb', line 49

def add(topic_name, summary)
  command = GitTopic::Commands::Add.new topic_name, summary
  command.execute
end

#edit(branch_name = nil) ⇒ Object



32
33
34
35
# File 'lib/git_topic/cli.rb', line 32

def edit(branch_name = nil)
  command = GitTopic::Commands::Edit.new branch_name
  command.execute
end

#listObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/git_topic/cli.rb', line 20

def list
  # Show version if -v specified
  if options[:version]
    version if options[:version]
    return
  end

  command = GitTopic::Commands::List.new options
  command.execute
end

#publish(branch_name) ⇒ Object



61
62
63
64
# File 'lib/git_topic/cli.rb', line 61

def publish(branch_name)
  puts "publish #{branch_name}"
  raise 'not implemented'
end

#show(branch_name = nil) ⇒ Object



38
39
40
41
# File 'lib/git_topic/cli.rb', line 38

def show(branch_name = nil)
  command = GitTopic::Commands::Show.new branch_name
  command.execute
end

#start(topic_name) ⇒ Object



55
56
57
58
# File 'lib/git_topic/cli.rb', line 55

def start(topic_name)
  puts "start #{topic_name}"
  raise 'not implemented'
end

#versionObject



44
45
46
# File 'lib/git_topic/cli.rb', line 44

def version
  puts GitTopic::VERSION
end