Sha256: fbb39765e406c3cddd9ceafc51161658e596b01119752e927d04a4ff077aab4b

Contents?: true

Size: 476 Bytes

Versions: 3

Compression:

Stored size: 476 Bytes

Contents

module DeployS3
  class Remote
    def self.comparison(from, to)
      origin_url = `git config --get remote.origin.url`.chomp

      github_url = self.github_from_url origin_url
      "#{github_url}/compare/#{from}...#{to}" if github_url
    end

    def self.github_from_url(url)
      if url =~ /git@github.com:(.*?).git/
        "https://github.com/#{$1}"
      elsif url =~ /(.*?):\/\/github.com\/(.*?).git/
        "https://github.com/#{$1}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
deploy_s3-0.0.3 lib/deploy_s3/remote.rb
deploy_s3-0.0.2 lib/deploy_s3/remote.rb
deploy_s3-0.0.1 lib/deploy_s3/remote.rb