#!/usr/bin/env ruby

$:.push File.expand_path("../", __FILE__)
require 'twitter'
require 'yaml'
require 'optparse'
require 'oauth'

Dir.glob("twat/*").each do |filename|
  require filename
end

module Twat
  VERSION_MAJOR = 0
  VERSION_MINOR = 2
  VERSION_PATCH = 6

  VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
  class Twat
    def run
      begin
        action = Actions.new
        opts = ArgParse.new
        action.send(opts.options[:action], opts)
      rescue Usage
        opts.usage
      rescue NoSuchAccount
        puts "No such account"
        opts.usage
      rescue NoMethodError
        puts "No such command"
        opts.usage
      rescue NoConfigFile
        puts "No config file, create one with twat -a [user|nick]"
        opts.usage
      end
    end
  end
end

#!/usr/bin/env ruby

$:.push File.expand_path("../", __FILE__)
require 'twitter'
require 'yaml'
require 'optparse'
require 'oauth'

%w[config exceptions argparse actions].each do |filename|
  require "twat/#{filename}"
end

module Twat
  VERSION_MAJOR = 0
  VERSION_MINOR = 2
  VERSION_PATCH = 6

  VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
  class Twat
    def run
      begin
        action = Actions.new
        opts = ArgParse.new
        action.send(opts.options[:action], opts)
      rescue Usage
        opts.usage
      rescue NoSuchAccount
        puts "No such account"
        opts.usage
      rescue NoMethodError
        puts "No such command"
        opts.usage
      rescue NoConfigFile
        puts "No config file, create one with twat -a [user|nick]"
        opts.usage
      end
    end
  end
end

Revert "Require everything, instead of specific names"
Revert "Require everything, instead of specific names"

Yarr Cap'n, f583bd7 has broken globbin', but ye' didn' notice.

HANG 'IM FROM THE MAINS'L!

This reverts commit f583bd7f2d9f59b44ee845d854a360013f952ba9.
