require "active_support" module RoCommands $LOAD_PATH.unshift File.expand_path("../..", __FILE__) require "config/rorc" arg = ARGV.shift if arg require 'ro_commands/base' require "ro_commands/#{arg}" RoCommands.const_get(arg.camelize).start elsif arg.nil? lib = File.expand_path("../../lib", __FILE__) args = Dir["#{lib}/ro_commands/*"].map do |file| if file[/\.rb$/] File.basename(file.gsub /\.rb$/, '') end end def self.is_helper?(str) str.match(%r{version}) end puts "Usage:" args.compact.each do |arg| unless is_helper?(arg) puts " ro #{arg}" end end end end