Class: ROM::Git::Gateway
- Inherits:
-
ROM::Gateway
- Object
- ROM::Gateway
- ROM::Git::Gateway
- Extended by:
- Initializer
- Defined in:
- lib/rom/git/gateway.rb
Constant Summary collapse
- DEFAULT_BRANCH =
'refs/heads/master'.freeze
Instance Attribute Summary collapse
- #branch ⇒ String readonly
- #path ⇒ String readonly
- #repo ⇒ Rugged::Repository readonly
Instance Method Summary collapse
Instance Attribute Details
#branch ⇒ String (readonly)
19 |
# File 'lib/rom/git/gateway.rb', line 19 option :branch, Types::Coercible::String, default: proc { DEFAULT_BRANCH } |
#path ⇒ String (readonly)
16 |
# File 'lib/rom/git/gateway.rb', line 16 param :path, Types::Coercible::String |
#repo ⇒ Rugged::Repository (readonly)
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
30 31 32 |
# File 'lib/rom/git/gateway.rb', line 30 def [](name) datasets[name] end |
#dataset(name) ⇒ Dataset
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
40 41 42 |
# File 'lib/rom/git/gateway.rb', line 40 def dataset?(name) datasets.key?(name) end |
#datasets ⇒ Hash
25 26 27 |
# File 'lib/rom/git/gateway.rb', line 25 def datasets @datasets ||= {} end |