1. Richo Healey
  2. twat

Commits

Richo Healey  committed d74dc52

Handle broken actions calls more sanely..

BUT I'm not convinced this ever made sense, looking at it?

  • Participants
  • Parent commits f9a0178
  • Branches master

Comments (0)

Files changed (3)

File lib/twat.rb

View file
       rescue NoSuchAccount
         puts "No such account"
         opts.usage
-      rescue NoMethodError
+      rescue NoSuchCommand
         puts "No such command"
         opts.usage
       rescue NoConfigFile

File lib/twat/actions.rb

View file
       puts "twat: #{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
     end
 
+    def method_missing
+      raise NoSuchCommand
+    end
+
     private
 
     def twitter_auth

File lib/twat/exceptions.rb

View file
 module Twat
   class NoSuchAccount < Exception; end
+  class NoSuchCommand < Exception; end
   class NoConfigFile < Exception; end
   class Usage < Exception; end
   class InvalidCredentials < Exception; end