Class: GitTopic::Commands::Show
- Inherits:
-
Object
- Object
- GitTopic::Commands::Show
- Defined in:
- lib/git_topic/commands/show.rb
Overview
show command shows branch description
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(topic_name) ⇒ Show
constructor
A new instance of Show.
Constructor Details
#initialize(topic_name) ⇒ Show
Returns a new instance of Show.
7 8 9 10 11 12 13 14 |
# File 'lib/git_topic/commands/show.rb', line 7 def initialize(topic_name) if topic_name.nil? command = 'git rev-parse --abbrev-ref HEAD' _stdin, stdout, _stderr, _wait_thr = *Open3.popen3(command) topic_name = stdout.readline.chop end @topic_name = topic_name end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 |
# File 'lib/git_topic/commands/show.rb', line 16 def execute config_key = "branch.#{@topic_name}.description" system("git config #{config_key}") end |