Sha256: 39177024655acfa04c414776571cf65ec9fb7f346516798c72faf47f5d27914e

Contents?: true

Size: 475 Bytes

Versions: 3

Compression:

Stored size: 475 Bytes

Contents

require 'trollop'
require_relative 'help'
require_relative 'tail'

class BinnacleCommand
  def run(args)
    ARGV.push(*args) if ENV["TEST_MODE"] == 'true' # testing cheat

    subcommand = args[0].downcase.to_sym if args[0]
    begin
      if subcommand
        Binnacle::Commands.send(subcommand)
      else
        Binnacle::Commands.send('help')
      end
    rescue NoMethodError => nme
      puts "I don't know the subcommand command '#{subcommand}'"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
binnacle-0.5.0 lib/binnacle/commands/commands.rb
binnacle-0.4.9 lib/binnacle/commands/commands.rb
binnacle-0.4.8 lib/binnacle/commands/commands.rb