Class: Dragnet::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/dragnet/repo.rb

Overview

Represents a repository, (for MTRs which reference multiple repositories in a multi-repo project, often managed with git-repo)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Repo

Returns a new instance of Repo.

Parameters:

  • args (Hash) —

    The data for the Repo

Options Hash (args):

  • :path (String) —

    The path where the repository is stored.

  • :sha1 (String) —

    The SHA1 the repository had when the MTR was created.

  • :files (String, Array<String>, nil) —

    The file or array of files covered by the MTR.



17
18
19
20
21
# File 'lib/dragnet/repo.rb', line 17

def initialize(args)
  @path = args[:path]
  @sha1 = args[:sha1]
  @files = args[:files]
end

Instance Attribute Details

#files ⇒ Object

Returns the value of attribute files.



9
10
11
# File 'lib/dragnet/repo.rb', line 9

def files
  @files
end

#path ⇒ Object

Returns the value of attribute path.



9
10
11
# File 'lib/dragnet/repo.rb', line 9

def path
  @path
end

#sha1 ⇒ Object

Returns the value of attribute sha1.



9
10
11
# File 'lib/dragnet/repo.rb', line 9

def sha1
  @sha1
end

Instance Method Details

#validate ⇒ Object

Validates the Repo instance (by checking each of its attributes).

Raises:

See Also:



27
28
29
# File 'lib/dragnet/repo.rb', line 27

def validate
  Dragnet::Validators::Entities::RepoValidator.new(self).validate
end