Class: GitTopic::Cli
- Inherits:
-
Thor
- Object
- Thor
- GitTopic::Cli
- Defined in:
- lib/git_topic/cli.rb
Overview
CLI command entry point
Instance Method Summary collapse
- #add(topic_name, summary) ⇒ Object
- #delete(topic_name) ⇒ Object
- #edit(branch_name = nil) ⇒ Object
- #list ⇒ Object
-
#publish(repo, base, branch_name) ⇒ Object
rubocop:enable Metrics/LineLength.
- #show(branch_name = nil) ⇒ Object
- #start(topic_name) ⇒ Object
- #version ⇒ Object
Instance Method Details
#add(topic_name, summary) ⇒ Object
53 54 55 56 |
# 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) ⇒ Object
59 60 61 62 |
# 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) ⇒ Object
35 36 37 38 |
# File 'lib/git_topic/cli.rb', line 35 def edit(branch_name = nil) command = GitTopic::Commands::Edit.new branch_name command.execute end |
#list ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/git_topic/cli.rb', line 24 def list # Show version if -v specified version && return if [:version] # Edit topic if -e specified edit && return if [:edit] command = GitTopic::Commands::List.new command.execute end |
#publish(repo, base, branch_name) ⇒ Object
rubocop:enable Metrics/LineLength
73 74 75 76 77 |
# 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) ⇒ Object
41 42 43 44 |
# File 'lib/git_topic/cli.rb', line 41 def show(branch_name = nil) command = GitTopic::Commands::Show.new branch_name command.execute end |