Sha256: 86cde298fcc97207d69abb6bd0c93ffe5ce70c4220538dcf0019ffe4f288e1be

Contents?: true

Size: 1.54 KB

Versions: 9

Compression:

Stored size: 1.54 KB

Contents

#!/usr/bin/env ruby

begin
  require 'ruic'
rescue LoadError
  require 'rubygems'
  require 'ruic'
end

USAGE = <<ENDUSAGE
Usage:
   ruic [-h] [-v] [-i] [-m path/to/MetaData.xml] [-u path/to/my.uia] [myscript.ruic]
ENDUSAGE

HELP = <<ENDHELP
   -h, --help         Show this help.
   -v, --version      Show the version number (#{RUIC::VERSION}).
   -i, --interactive  Enter an interactive REPL after running the script (if any).
   -m, --metadata     The path to use for MetaData.xml
                      Default: #{RUIC::DEFAULTMETADATA}
                      Will be overridden by any `metadata` call in your script.
   -u, --uia          A UIC application file (.uia) to load.
ENDHELP

ARGS = {}
UNFLAGGED_ARGS = [ :script ]
next_arg = UNFLAGGED_ARGS.first
ARGV.each do |arg|
	case arg
		when '-h','--help'        then ARGS[:help]        = true
		when '-v','--version'     then ARGS[:version]     = true
		when '-i','--interactive' then ARGS[:interactive] = true
		when '-m','--metadata'    then next_arg = :meta
		when '-u','--uia'         then next_arg = :uia
		else
			if next_arg
				ARGS[next_arg] = arg
				UNFLAGGED_ARGS.delete( next_arg )
			end
			next_arg = UNFLAGGED_ARGS.first
	end
end

puts "RUIC v#{RUIC::VERSION}" if ARGS[:version]

if ARGS[:help]
	puts USAGE, HELP
	exit 0
end

if ARGS[:meta]
	RUIC::DEFAULTMETADATA.replace File.expand_path(ARGS[:meta])
end

if ARGS[:script] && File.extname(ARGS[:script])==".uia"
	ARGS[:uia] = ARGS[:script]
	ARGS[:script] = nil
end

RUIC script:ARGS[:script], uia:ARGS[:uia], repl:ARGS[:interactive] || !ARGS[:script]

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
RUIC-0.4.6 bin/ruic
RUIC-0.4.5 bin/ruic
RUIC-0.4.4 bin/ruic
RUIC-0.4.3 bin/ruic
RUIC-0.4.2 bin/ruic
RUIC-0.4.1 bin/ruic
RUIC-0.4.0 bin/ruic
RUIC-0.3.0 bin/ruic
RUIC-0.2.6 bin/ruic