Class: Toolshed::Commands::DeleteBranch
- Inherits:
-
Object
- Object
- Toolshed::Commands::DeleteBranch
- Defined in:
- lib/toolshed/commands/delete_branch.rb
Instance Method Summary collapse
Instance Method Details
#execute(args, options = {}) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/toolshed/commands/delete_branch.rb', line 4 def execute(args, = {}) branch_name = read_user_input("Ticket ID or branch name:", ) branch_name = Toolshed::Git::Base.delete(branch_name) puts "#{branch_name} has been deleted" return end |
#read_user_input(message, options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/toolshed/commands/delete_branch.rb', line 11 def read_user_input(, ) return [:branch_name] if (.has_key?(:branch_name)) puts value = $stdin.gets.chomp until (!value.empty?) puts "Branch name cannot be empty" puts value = $stdin.gets.chomp end value end |