Sha256: fdd7a714b3bb5e96be94e5c167e173839ec3be2ae7129c70e876a8188513a671

Contents?: true

Size: 440 Bytes

Versions: 3

Compression:

Stored size: 440 Bytes

Contents

module Ghit
  class SshRemoteUrlBuilder
    def initialize remote, page = nil
      @remote = remote
      @page   = page
    end

    def build
      "https://github.com/#{author}/#{name}/#{@page}"
    end

    private

    def name
      repo_data.split('/').last.gsub(/\.git/, '').strip
    end

    def author
      repo_data.split('/').first.strip
    end

    def repo_data
      @remote.split(':').last.split.first
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ghit-0.1.0 lib/ghit/ssh_remote_url_builder.rb
ghit-0.0.2 lib/ghit/ssh_remote_url_builder.rb
ghit-0.0.1 lib/ghit/ssh_remote_url_builder.rb