Sha256: deaeb48302db0254994666fd9b3cddc1335703489ab41e6c2158d5036d393f16

Contents?: true

Size: 1.05 KB

Versions: 6

Compression:

Stored size: 1.05 KB

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'bundler/setup'
require 'eac_launcher'

class Runner < ::EacLauncher::Instances::RunnerHelper
  DOC = <<DOCOPT.freeze
Publica projetos ou instâncias.

Usage:
  __PROGRAM__ (check|dry-run|run) [options] [<instance_path>...]
  __PROGRAM__ -h | --help

Options:
  -h --help             Show this screen.
  --new                 Publish projects not published before.
  -s --stereotype=<st>  Publish only for stereotype <stereotype>.
  --all            Publish all instances.

DOCOPT

  OPTIONS = {
    new: '--new', confirm: 'run', stereotype: '--stereotype'
  }.freeze

  private

  def run
    build_publish_options
    instances.each do |i|
      next unless i.options.publishable?
      i.send(instance_method)
    end
  end

  def instance_method
    options['run'] || options['dry-run'] ? 'publish_run' : 'publish_check'
  end

  def build_publish_options
    ::EacLauncher::Context.current.publish_options = publish_options
  end

  def publish_options
    Hash[OPTIONS.map { |k, v| [k, options[v]] }]
  end
end

Runner.new

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
eac_launcher-0.3.2 exe/eac_launcher_publish
eac_launcher-0.3.1 exe/eac_launcher_publish
eac_launcher-0.3.0 exe/eac_launcher_publish
eac_launcher-0.2.2 exe/eac_launcher_publish
eac_launcher-0.2.1 exe/eac_launcher_publish
eac_launcher-0.2.0 exe/eac_launcher_publish