Module: GitCompound::Repository

Extended by:
Repository
Included in:
Repository
Defined in:
lib/git_compound.rb,
lib/git_compound/repository.rb,
lib/git_compound/repository/git_command.rb,
lib/git_compound/repository/git_version.rb,
lib/git_compound/repository/remote_file.rb,
lib/git_compound/logger/debug/repository.rb,
lib/git_compound/repository/git_repository.rb,
lib/git_compound/repository/repository_local.rb,
lib/git_compound/repository/repository_remote.rb,
lib/git_compound/repository/remote_file/github_strategy.rb,
lib/git_compound/repository/remote_file/git_archive_strategy.rb,
lib/git_compound/repository/remote_file/remote_file_strategy.rb

Overview

Git repositories module, also repository factory

Defined Under Namespace

Classes: GitCommand, GitRepository, GitVersion, RemoteFile, RepositoryLocal, RepositoryRemote

Instance Method Summary collapse

Instance Method Details

#factory(source) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/git_compound/repository.rb', line 7

def factory(source)
  if local?(source)
    RepositoryLocal.new(source)
  else
    RepositoryRemote.new(remote = source) # rubocop:disable Lint/UselessAssignment
  end
end

#local?(source) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/git_compound/repository.rb', line 15

def local?(source)
  source.match(%r{(^\/|file:\/\/).*})
end