Sha256: c682104219aa8d3b5fa78324d85344710fd011db5e019577943a0d9f13298b49

Contents?: true

Size: 441 Bytes

Versions: 105

Compression:

Stored size: 441 Bytes

Contents

# frozen_string_literal: true

module Avm
  module Launcher
    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

105 entries across 105 versions & 2 rubygems

Version Path
avm-tools-0.138.0 lib/avm/launcher/vendor/github.rb
eac_tools-0.34.0 sub/avm-tools/lib/avm/launcher/vendor/github.rb
avm-tools-0.137.0 lib/avm/launcher/vendor/github.rb
eac_tools-0.33.0 sub/avm-tools/lib/avm/launcher/vendor/github.rb
eac_tools-0.32.0 sub/avm-tools/lib/avm/launcher/vendor/github.rb
avm-tools-0.136.2 lib/avm/launcher/vendor/github.rb
eac_tools-0.31.1 sub/avm-tools/lib/avm/launcher/vendor/github.rb
eac_tools-0.31.0 sub/avm-tools/lib/avm/launcher/vendor/github.rb
avm-tools-0.136.1 lib/avm/launcher/vendor/github.rb
eac_tools-0.30.0 sub/avm-tools/lib/avm/launcher/vendor/github.rb
eac_tools-0.29.0 sub/avm-tools/lib/avm/launcher/vendor/github.rb
avm-tools-0.136.0 lib/avm/launcher/vendor/github.rb
eac_tools-0.28.0 sub/avm-tools/lib/avm/launcher/vendor/github.rb
eac_tools-0.27.2 sub/avm-tools/lib/avm/launcher/vendor/github.rb
eac_tools-0.27.1 sub/avm-tools/lib/avm/launcher/vendor/github.rb
avm-tools-0.135.0 lib/avm/launcher/vendor/github.rb
eac_tools-0.27.0 sub/avm-tools/lib/avm/launcher/vendor/github.rb
avm-tools-0.134.0 lib/avm/launcher/vendor/github.rb
eac_tools-0.26.0 sub/avm-tools/lib/avm/launcher/vendor/github.rb
eac_tools-0.25.1 sub/avm-tools/lib/avm/launcher/vendor/github.rb