Class: Omnibus::Publisher
- Inherits:
-
Object
- Object
- Omnibus::Publisher
- Includes:
- Logging
- Defined in:
- lib/omnibus/publisher.rb
Direct Known Subclasses
Class Method Summary collapse
-
.publish(pattern, options = {}, &block) ⇒ Object
Shortcut class method for creating a new instance of this class and executing the publishing sequence.
Instance Method Summary collapse
-
#initialize(pattern, options = {}) ⇒ Publisher
constructor
Create a new publisher from the given pattern.
-
#packages ⇒ Array<String>
The list of packages that match the pattern in the initializer.
-
#publish(&_block) ⇒ Array<String>
abstract
The list of uploaded packages.
Methods included from Logging
Constructor Details
#initialize(pattern, options = {}) ⇒ Publisher
Create a new publisher from the given pattern.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/omnibus/publisher.rb', line 41 def initialize(pattern, = {}) @pattern = pattern = .dup if [:platform] log.warn(log_key) do "Publishing platform has been overriden to '#{@options[:platform]}'" end end if [:platform_version] log.warn(log_key) do "Publishing platform version has been overriden to '#{@options[:platform_version]}'" end end end |
Class Method Details
.publish(pattern, options = {}, &block) ⇒ Object
Shortcut class method for creating a new instance of this class and executing the publishing sequence.
26 27 28 |
# File 'lib/omnibus/publisher.rb', line 26 def publish(pattern, = {}, &block) new(pattern, ).publish(&block) end |
Instance Method Details
#packages ⇒ Array<String>
The list of packages that match the pattern in the initializer.
63 64 65 |
# File 'lib/omnibus/publisher.rb', line 63 def packages @packages ||= FileSyncer.glob(@pattern).map { |path| Package.new(path) } end |
#publish(&_block) ⇒ Array<String>
This method is abstract.
Returns the list of uploaded packages
76 77 78 |
# File 'lib/omnibus/publisher.rb', line 76 def publish(&_block) raise NotImplementedError end |