class ProxyTester::RemoteRepository
Attributes
repository[R]
Public Class Methods
new(repository)
click to toggle source
Create Remote Repository
# File lib/proxy_tester/remote_repository.rb, line 12 def initialize(repository) @repository = parse(repository) end
Public Instance Methods
base()
click to toggle source
source path of repository
@return [String]
base path to repository
@example
http://githost/repo.git => repo user@host:/githost/repo.git => repo
# File lib/proxy_tester/remote_repository.rb, line 24 def base ::File.basename(repository.path, '.*') end
source()
click to toggle source
source path of repository
@return [String]
path to repository
# File lib/proxy_tester/remote_repository.rb, line 32 def source repository.to_s end
Private Instance Methods
parse(repo_string)
click to toggle source
# File lib/proxy_tester/remote_repository.rb, line 38 def parse(repo_string) repo_string = ::File.expand_path(repo_string) if repo_string =~ %r{^(?:[^/@]+/)*[^/]+$} repo = Addressable::URI.heuristic_parse(repo_string) if repo.scheme.blank? repo.scheme = 'file' repo.authority = '' repo.path = repo_string elsif repo.scheme == 'ssh' repo.host = repo.host + ':' end repo end