Module: Aptly::Publishable

Included in:
Repository, Snapshot
Defined in:
lib/aptly/publishable.rb

Overview

Abstract “type” of all publishable entities. Publishable entities are everything that can act as Source for a PublishedRepository.

Instance Method Summary collapse

Instance Method Details

#published?Boolean

Returns:

  • (Boolean)

24
25
26
# File 'lib/aptly/publishable.rb', line 24

def published?
  !published_in.empty?
end

#published_in {|pub| ... } ⇒ Array<PublishedRepository>

Lists all PublishedRepositories self is published in. Namely self must be a source of the published repository in order for it to appear here. This method always returns an array of affected published repositories. If you use this method with a block it will additionally yield each published repository that would appear in the array, making it a shorthand for Array#each.

Yield Parameters:

Returns:


13
14
15
16
17
18
19
20
21
# File 'lib/aptly/publishable.rb', line 13

def published_in
  Aptly::PublishedRepository.list(connection).select do |pub|
    next false unless pub.Sources.any? do |src|
      src.Name == self.Name
    end
    yield pub if block_given?
    true
  end
end