Sha256: e1b40cc078c29f20af633310e2124700d79190b787d6722f464765c06010734c

Contents?: true

Size: 614 Bytes

Versions: 4

Compression:

Stored size: 614 Bytes

Contents

module Repomen
  module Repo
    module Service
      class GitHub < Base
        SERVICE_REGEXP = /(https:\/\/|git\@)github.com[\:\/]([^\/]+)\/([^\.]+)\.git$/

        # @param url [String]
        def applicable?
          url =~ SERVICE_REGEXP
        end

        def handler_class
          Handler::Git
        end

        # overriding 'git_hub' here to make directories look prettier
        def name
          :github
        end

        def repo_name
          url =~ SERVICE_REGEXP && $3
        end

        def user_name
          url =~ SERVICE_REGEXP && $2
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
repomen-0.1.3 lib/repomen/repo/service/git_hub.rb
repomen-0.1.2 lib/repomen/repo/service/git_hub.rb
repomen-0.1.1 lib/repomen/repo/service/git_hub.rb
repomen-0.1.0 lib/repomen/repo/service/git_hub.rb