Sha256: 498f0ea2d81ff5e4937207c9531bfb39729e9c0923da17dd5a82ae7fcaef8152

Contents?: true

Size: 706 Bytes

Versions: 1

Compression:

Stored size: 706 Bytes

Contents

require 'optparse'

trap("INT"){exit}

OptionParser.new do |o|
  o.on("-d DIRECTORY", "--directory", "The directory to start in") {|dir| @dir = dir}
end.parse!

def dir
  @dir ||= "."
  File.absolute_path @dir
end

def os
  if (/Windows/ =~ ENV['OS']) != nil
    return :windows
  elsif (/darwin/ =~ RUBY_PLATFORM) != nil
    return :darwin
  else
    return :linux
  end
end

require "zip"

puts "HotPlate CLI Version #{HotPlate::VERSION}"
puts
puts "Error: No option selected!" unless ARGV.length > 0
first_arg = ARGV.shift

begin
  (puts "recursion is a bad idea idea idea idea"; exit;) if first_arg == 'main'
  require_relative "#{first_arg}"
rescue LoadError
  puts "Invalid Option: #{first_arg}"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hotplate-1.0.0 lib/hotplate/cli/main.rb