Class: Samus::Publisher

Inherits:
Object
  • Object
show all
Defined in:
lib/samus/publisher.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Publisher

Returns a new instance of Publisher.



7
8
9
10
# File 'lib/samus/publisher.rb', line 7

def initialize(dir)
  @dir = dir
  @stage = 'publish'
end

Instance Method Details

#publish(dry_run = false) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/samus/publisher.rb', line 12

def publish(dry_run = false)
  Dir.chdir(@dir) do
    actions.map do |action|
      PublishAction.new(
        dry_run: dry_run,
        arguments: { 'VERSION' => manifest['version'] }
      ).load(action)
    end.each(&:run)
  end
end