Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve method naming for "dispatch" methods

  • Loading branch information...
commit 42a79b2291b0ed42dbb3d4214a227ec779a977bc 1 parent 340c795
@x3ro authored
Showing with 6 additions and 4 deletions.
  1. +1 −1  bin/gemignore
  2. +5 −3 lib/gemignore/main.rb
View
2  bin/gemignore
@@ -5,4 +5,4 @@ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
require 'gemignore'
-GemIgnore::Main.new.dispatch
+GemIgnore::Main.new.dispatchWithErrorHandling
View
8 lib/gemignore/main.rb
@@ -21,11 +21,12 @@ def initialize
end
- def dispatch
+ # Default entry point when running from command line
+ def dispatchWithErrorHandling
debugMode = (not ARGV.delete("-d").nil?)
begin
- _dispatch
+ dispatch
rescue Exception => e
raise e if debugMode
error "An error occured (are you connected to the internet?)"
@@ -34,7 +35,8 @@ def dispatch
end
- def _dispatch
+ # Invokes the correct method according to the command line options that were given
+ def dispatch
(help; return) if ARGV.length === 0
cmd = ARGV.shift # get the sub-command

0 comments on commit 42a79b2

Please sign in to comment.
Something went wrong with that request. Please try again.