Class: ROM::Git::Gateway

Inherits:
ROM::Gateway
  • Object
show all
Extended by:
Initializer
Defined in:
lib/rom/git/gateway.rb

Constant Summary collapse

DEFAULT_BRANCH =
'refs/heads/master'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#branchString (readonly)

Returns:

  • (String)


19
# File 'lib/rom/git/gateway.rb', line 19

option :branch, Types::Coercible::String, default: proc { DEFAULT_BRANCH }

#pathString (readonly)

Returns:

  • (String)


16
# File 'lib/rom/git/gateway.rb', line 16

param :path, Types::Coercible::String

#repoRugged::Repository (readonly)

Returns:

  • (Rugged::Repository)


22
# File 'lib/rom/git/gateway.rb', line 22

option :repo, Types.Instance(Rugged::Repository), default: proc { Rugged::Repository.new(path) }

Instance Method Details

#[](name) ⇒ Dataset

Returns:



30
31
32
# File 'lib/rom/git/gateway.rb', line 30

def [](name)
  datasets[name]
end

#dataset(name) ⇒ Dataset

Returns:



35
36
37
# File 'lib/rom/git/gateway.rb', line 35

def dataset(name)
  datasets[name] = Dataset.new(repo.references[branch].log)
end

#dataset?(name) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/rom/git/gateway.rb', line 40

def dataset?(name)
  datasets.key?(name)
end

#datasetsHash

Returns:

  • (Hash)


25
26
27
# File 'lib/rom/git/gateway.rb', line 25

def datasets
  @datasets ||= {}
end