Class: Space::Model::Repo::Bundle

Inherits:
Object
  • Object
show all
Includes:
Source
Defined in:
lib/space/model/repo/bundle.rb

Instance Attribute Summary collapse

Attributes included from Source

#path, #results

Instance Method Summary collapse

Methods included from Source

#commands, included, #refresh, #update

Methods included from Events

events, notify, #notify, sources, subscribe, subscriptions

Constructor Details

#initialize(repo, repos) ⇒ Bundle

Returns a new instance of Bundle.



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

def initialize(repo, repos)
  @repo = repo
  @repos = repos
  super(repo.path)
end

Instance Attribute Details

#reposObject (readonly)

Returns the value of attribute repos.



13
14
15
# File 'lib/space/model/repo/bundle.rb', line 13

def repos
  @repos
end

Instance Method Details

#clean?Boolean

Returns:

  • (Boolean)


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

def clean?
  info =~ /dependencies are satisfied/
end

#depsObject



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

def deps
  result(:list).scan(/\* ([\w-]+) \(.* ([\d|\w]+)\)/).map do |name, ref|
    Dependency.new(repos.find_by_name(name), ref) if repos.names.include?(name)
  end.compact
end

#infoObject



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

def info
  result(:check).split("\n").first || ''
end