module Thor::Base::ClassMethods

def no_tasks


end
remove_task :this_is_not_a_task
end
def this_is_not_a_task
class MyScript < Thor

You can also add the method and remove it from the task list:

end
end
end
def this_is_not_a_task
no_tasks do
class MyScript < Thor

So you can do:

All methods defined inside the given block are not added as tasks.
def no_tasks
  @no_tasks = true
  yield
ensure
  @no_tasks = false
end