class Samus::Publisher

Public Class Methods

new(dir) click to toggle source
# File lib/samus/publisher.rb, line 7
def initialize(dir)
  @dir = dir
  @stage = 'publish'
end

Public Instance Methods

publish(dry_run = false) click to toggle source
# 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

Private Instance Methods

actions() click to toggle source
# File lib/samus/publisher.rb, line 25
def actions
  manifest['actions']
end
manifest() click to toggle source
# File lib/samus/publisher.rb, line 29
def manifest
  @manifest ||= JSON.parse(File.read(manifest_file))
end
manifest_file() click to toggle source
# File lib/samus/publisher.rb, line 33
def manifest_file
  @manifest_file ||= File.join(@dir, 'manifest.json')
end