Sha256: 1d32141ad33530511a6475623261996a26d904464d6b87095c9ca8701060720d

Contents?: true

Size: 729 Bytes

Versions: 11

Compression:

Stored size: 729 Bytes

Contents

# frozen_string_literal: true

require 'eac_git/remote_like'
require 'eac_ruby_utils/core_ext'

module EacGit
  class Local
    class Remote
      NO_SUCH_REMOTE_CODE = 128

      enable_simple_cache
      include ::EacGit::RemoteLike

      common_constructor :local, :name

      def exist?
        url
      end

      # @return [EacRubyUtils::Envs::Command
      def git_command(*args)
        local.command(*args)
      end

      # @return [String]
      def remote_reference
        name
      end

      # @return [String, nil]
      def url
        local.command('remote', 'get-url', name)
          .execute!(exit_outputs: { NO_SUCH_REMOTE_CODE => nil })
          .if_present(nil, &:strip)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
eac_tools-0.45.0 sub/eac_git/lib/eac_git/local/remote.rb
eac_tools-0.44.0 sub/eac_git/lib/eac_git/local/remote.rb
eac_tools-0.43.0 sub/eac_git/lib/eac_git/local/remote.rb
eac_tools-0.42.0 sub/eac_git/lib/eac_git/local/remote.rb
eac_tools-0.41.0 sub/eac_git/lib/eac_git/local/remote.rb
eac_tools-0.40.0 sub/eac_git/lib/eac_git/local/remote.rb
eac_tools-0.39.0 sub/eac_git/lib/eac_git/local/remote.rb
eac_tools-0.38.0 sub/eac_git/lib/eac_git/local/remote.rb
eac_tools-0.37.2 sub/eac_git/lib/eac_git/local/remote.rb
eac_git-0.13.0 lib/eac_git/local/remote.rb
eac_tools-0.37.1 sub/eac_git/lib/eac_git/local/remote.rb