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) ⇒ Object



47
48
49
50
# File 'lib/git_topic/cli.rb', line 47

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

#edit(branch_name = nil) ⇒ Object



30
31
32
33
# File 'lib/git_topic/cli.rb', line 30

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

#listObject



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

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

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

#publish(branch_name) ⇒ Object



59
60
61
62
# File 'lib/git_topic/cli.rb', line 59

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

#show(branch_name = nil) ⇒ Object



36
37
38
39
# File 'lib/git_topic/cli.rb', line 36

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

#start(topic_name) ⇒ Object



53
54
55
56
# File 'lib/git_topic/cli.rb', line 53

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

#versionObject



42
43
44
# File 'lib/git_topic/cli.rb', line 42

def version
  puts GitTopic::VERSION
end