Sha256: 1718f5cd0ca7c8f94c036905f7fa027ba0556a89260635680af46f8cde9b2ce7

Contents?: true

Size: 852 Bytes

Versions: 1

Compression:

Stored size: 852 Bytes

Contents

require "shellwords"

class RawQ
  class Generator
    class Application
      class << self
        include Shellwords

        def run!(*arguments)
          options = RawQ::Generator::Options.new(arguments)

          if options[:invalid_option]
            $stderr.puts options[:invalid_option]
            options[:show_help] = true
          end

          if options[:show_help]
            $stderr.puts options.opts
            return 1
          end

          if options[:application_name].nil? || options[:application_name].squeeze.strip == ""
            $stderr.puts "missing application name"
            $stderr.puts options.opts
            return 1
          end

          begin
            generator = RawQ::Generator.new(options)
            generator.run
            return 0
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rawq-0.1.0 lib/rawq/generator/application.rb