Sha256: 18608dd4e6e56d7ea60cad25822ad92b53641a7449b1eafa5f4b64b48294b9d2

Contents?: true

Size: 397 Bytes

Versions: 8

Compression:

Stored size: 397 Bytes

Contents

module GitCompound
  # Git repositories module, also repository factory
  #
  module Repository
    extend self

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
git_compound-0.2.2 lib/git_compound/repository.rb
git_compound-0.2.1 lib/git_compound/repository.rb
git_compound-0.2.0 lib/git_compound/repository.rb
git_compound-0.1.2 lib/git_compound/repository.rb
git_compound-0.1.1 lib/git_compound/repository.rb
git_compound-0.1.0 lib/git_compound/repository.rb
git_compound-0.0.10 lib/git_compound/repository.rb
git_compound-0.0.9 lib/git_compound/repository.rb