Sha256: fdd454ffdd908486b443cfc1a290e5e18b0dd311e24ce4e8a169c54530d478fb

Contents?: true

Size: 436 Bytes

Versions: 103

Compression:

Stored size: 436 Bytes

Contents

# frozen_string_literal: true

module Avm
  module Git
    module Vendor
      module Github
        class << self
          def to_ssh_url(url)
            return nil if url.blank?

            url_no_dot_git = url.gsub(/\.git\z/, '')

            m = %r{\Ahttps://github.com/([^/]+)/([^/]+)\z}.match(url_no_dot_git.to_s)
            m ? "git@github.com:#{m[1]}/#{m[2]}.git" : url
          end
        end
      end
    end
  end
end

Version data entries

103 entries across 103 versions & 2 rubygems

Version Path
avm-git-0.18.0 lib/avm/git/vendor/github.rb
eac_tools-0.94.0 sub/avm-git/lib/avm/git/vendor/github.rb
avm-git-0.17.0 lib/avm/git/vendor/github.rb
eac_tools-0.86.5 sub/avm-git/lib/avm/git/vendor/github.rb
avm-git-0.16.0 lib/avm/git/vendor/github.rb
eac_tools-0.86.4 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.86.3 sub/avm-git/lib/avm/git/vendor/github.rb
avm-git-0.15.0 lib/avm/git/vendor/github.rb
eac_tools-0.86.2 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.84.0 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.83.0 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.82.0 sub/avm-git/lib/avm/git/vendor/github.rb
avm-git-0.14.0 lib/avm/git/vendor/github.rb
eac_tools-0.81.0 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.80.0 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.79.0 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.78.0 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.77.1 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.77.0 sub/avm-git/lib/avm/git/vendor/github.rb
eac_tools-0.76.1 sub/avm-git/lib/avm/git/vendor/github.rb