Skip to content

Commit

Permalink
commands -> defined_commands to fix pry conflict
Browse files Browse the repository at this point in the history
Rename `commands` method, which I'm guessing is very infrequently used,
to avoid a conflict with pry. According to
pry/pry#1344 this will also be fixed in pry
soon; but this seems like a fine interim measure.
  • Loading branch information
ggilder committed Jan 13, 2015
1 parent bce2527 commit 1ca97ea
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions lib/commander/delegates.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@

module Commander
module Delegates
%w( add_command command program run! global_option
commands alias_command default_command
always_trace! never_trace! ).each do |meth|
%w(
add_command
command
program
run!
global_option
alias_command
default_command
always_trace!
never_trace!
).each do |meth|
eval <<-END, binding, __FILE__, __LINE__
def #{meth} *args, &block
::Commander::Runner.instance.#{meth} *args, &block
end
END
end

def defined_commands(*args, &block)
::Commander::Runner.instance.commands(*args, &block)
end
end
end

0 comments on commit 1ca97ea

Please sign in to comment.