Sha256: 9ec44f2761c465701ebad819ca2632f43d3b2371e9ac92cfec66eae5a747811a

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 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|
      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

8 entries across 8 versions & 1 rubygems

Version Path
eac_launcher-0.1.7 exe/eac_launcher_publish
eac_launcher-0.1.6 exe/eac_launcher_publish
eac_launcher-0.1.5 exe/eac_launcher_publish
eac_launcher-0.1.3 exe/eac_launcher_publish
eac_launcher-0.1.4 exe/eac_launcher_publish
eac_launcher-0.1.2 exe/eac_launcher_publish
eac_launcher-0.1.1 exe/eac_launcher_publish
eac_launcher-0.1.0 exe/eac_launcher_publish