Sha256: dd7e867f17f00aecb878323895321ea3d49d35687ac200d79bbcdb5d4099c3bb

Contents?: true

Size: 524 Bytes

Versions: 6

Compression:

Stored size: 524 Bytes

Contents

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

6 entries across 6 versions & 1 rubygems

Version Path
git_topic-0.2.4 lib/git_topic/commands/show.rb
git_topic-0.2.3 lib/git_topic/commands/show.rb
git_topic-0.2.2 lib/git_topic/commands/show.rb
git_topic-0.2.1 lib/git_topic/commands/show.rb
git_topic-0.2.0 lib/git_topic/commands/show.rb
git_topic-0.1.0 lib/git_topic/commands/show.rb