Class: Space::Model::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/space/model/repo.rb,
lib/space/model/repo/git.rb,
lib/space/model/repo/bundle.rb,
lib/space/model/repo/dependency.rb

Defined Under Namespace

Classes: Bundle, Dependency, Git

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, path) ⇒ Repo

Returns a new instance of Repo.



10
11
12
13
14
15
# File 'lib/space/model/repo.rb', line 10

def initialize(project, path)
  @project = project
  @path    = File.expand_path(path)
  @git     = Git.new(self)
  @bundle  = Bundle.new(self, project.repos)
end

Instance Attribute Details

#bundleObject (readonly)

Returns the value of attribute bundle.



8
9
10
# File 'lib/space/model/repo.rb', line 8

def bundle
  @bundle
end

#gitObject (readonly)

Returns the value of attribute git.



8
9
10
# File 'lib/space/model/repo.rb', line 8

def git
  @git
end

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/space/model/repo.rb', line 8

def path
  @path
end

#projectObject (readonly)

Returns the value of attribute project.



8
9
10
# File 'lib/space/model/repo.rb', line 8

def project
  @project
end

Instance Method Details

#depsObject



29
30
31
# File 'lib/space/model/repo.rb', line 29

def deps
  bundle.deps
end

#nameObject



17
18
19
# File 'lib/space/model/repo.rb', line 17

def name
  @name ||= File.basename(path)
end

#numberObject



21
22
23
# File 'lib/space/model/repo.rb', line 21

def number
  @number ||= project.number(name)
end

#refObject



25
26
27
# File 'lib/space/model/repo.rb', line 25

def ref
  git.commit
end

#refreshObject



33
34
35
# File 'lib/space/model/repo.rb', line 33

def refresh
  [git, bundle].each(&:refresh)
end