Method: Externals::Ext.run
- Defined in:
- lib/externals/ext.rb
.run(*arguments) ⇒ Object
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/externals/ext.rb', line 180 def self.run *arguments = {} = {} opts = new_opts , args = opts.parse(arguments) unless args.nil? || args.empty? command = args[0] args = args[1..(args.size - 1)] || [] end command &&= command.to_sym command = :help if [:help] command = :version if [:version] if !command || command.to_s == '' puts "hey... you didn't tell me what you want to do." puts "Try 'ext help' for a list of commands" exit end unless COMMANDS.index command puts "unknown command: #{command}" puts "for a list of commands try 'ext help'" exit end Dir.chdir([:workdir] || ".") do self.new().send(command, args, ) end end |