Sha256: 2f70f79140997667b88f2dfcb2ad2c7c60f4e314b9b51317b86f9445cc649636

Contents?: true

Size: 401 Bytes

Versions: 82

Compression:

Stored size: 401 Bytes

Contents

# frozen_string_literal: true

module EacLauncher
  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

Version data entries

82 entries across 82 versions & 2 rubygems

Version Path
avm-tools-0.99.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.98.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.97.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.96.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.95.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.94.3 lib/eac_launcher/vendor/github.rb
avm-tools-0.94.2 lib/eac_launcher/vendor/github.rb
avm-tools-0.94.1 lib/eac_launcher/vendor/github.rb
avm-tools-0.94.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.93.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.92.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.91.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.90.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.89.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.88.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.87.1 lib/eac_launcher/vendor/github.rb
avm-tools-0.87.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.86.0 lib/eac_launcher/vendor/github.rb
avm-tools-0.85.1 lib/eac_launcher/vendor/github.rb
avm-tools-0.85.0 lib/eac_launcher/vendor/github.rb