Sha256: ce2d08d6387d379c8702b47a1a0de0872b380354f43f52276c39484c948a0d11

Contents?: true

Size: 554 Bytes

Versions: 4

Compression:

Stored size: 554 Bytes

Contents

# frozen_string_literal: true

module GitTopic
  module Commands
    # show command shows branch description
    class Show
      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

      def execute
        config_key = "branch.#{@topic_name}.description"
        system("git config #{config_key}")
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
git_topic-0.4.0 lib/git_topic/commands/show.rb
git_topic-0.3.3 lib/git_topic/commands/show.rb
git_topic-0.3.0 lib/git_topic/commands/show.rb
git_topic-0.2.5 lib/git_topic/commands/show.rb