Class: Space::Models::Repo::Bundle
- Inherits:
-
Object
- Object
- Space::Models::Repo::Bundle
- Defined in:
- lib/space/models/repo/bundle.rb
Instance Attribute Summary collapse
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#repos ⇒ Object
readonly
Returns the value of attribute repos.
Attributes included from Events
Attributes included from Shell
Instance Method Summary collapse
- #clean? ⇒ Boolean
- #deps ⇒ Object
- #info ⇒ Object
-
#initialize(repo, repos) ⇒ Bundle
constructor
A new instance of Bundle.
Methods included from Events
#buffering, #buffering?, #notify, #observers, #subscribe
Methods included from Shell
all, #commands, included, refresh, #refresh, #result
Methods included from Shell::Watcher
Constructor Details
#initialize(repo, repos) ⇒ Bundle
Returns a new instance of Bundle.
17 18 19 20 21 |
# File 'lib/space/models/repo/bundle.rb', line 17 def initialize(repo, repos) @repo = repo @repos = repos super(repo.path) end |
Instance Attribute Details
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
15 16 17 |
# File 'lib/space/models/repo/bundle.rb', line 15 def repo @repo end |
#repos ⇒ Object (readonly)
Returns the value of attribute repos.
15 16 17 |
# File 'lib/space/models/repo/bundle.rb', line 15 def repos @repos end |
Instance Method Details
#clean? ⇒ Boolean
23 24 25 |
# File 'lib/space/models/repo/bundle.rb', line 23 def clean? info =~ /dependencies are satisfied/ end |
#deps ⇒ Object
31 32 33 34 35 |
# File 'lib/space/models/repo/bundle.rb', line 31 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 |
#info ⇒ Object
27 28 29 |
# File 'lib/space/models/repo/bundle.rb', line 27 def info result(:check).split("\n").first end |