Sha256: 63192696780781d8d3e948ca20dc0810556c675c822370950ada5e94dedda282

Contents?: true

Size: 497 Bytes

Versions: 31

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

require "open3"

module Milestoner
  module Git
    # A lightweight Git Config wrapper.
    class Config
      def initialize shell: Open3
        @shell = shell
      end

      def get key
        shell.capture3 "git config --get #{key}"
      end

      def set key, value
        shell.capture3 %(git config --add #{key} "#{value}")
      end

      def value key
        get(key).first.chomp
      end

      private

      attr_reader :shell
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
milestoner-7.0.0 lib/milestoner/git/config.rb
milestoner-6.3.1 lib/milestoner/git/config.rb
milestoner-6.3.0 lib/milestoner/git/config.rb
milestoner-6.2.0 lib/milestoner/git/config.rb
milestoner-6.1.0 lib/milestoner/git/config.rb
milestoner-6.0.0 lib/milestoner/git/config.rb
milestoner-5.1.0 lib/milestoner/git/config.rb
milestoner-5.0.0 lib/milestoner/git/config.rb
milestoner-4.2.0 lib/milestoner/git/config.rb
milestoner-4.1.1 lib/milestoner/git/config.rb
milestoner-4.1.0 lib/milestoner/git/config.rb