aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/vendor/thor/group.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/vendor/thor/group.rb')
-rw-r--r--lib/bundler/vendor/thor/group.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/bundler/vendor/thor/group.rb b/lib/bundler/vendor/thor/group.rb
index 3dbab98a..e948b9ae 100644
--- a/lib/bundler/vendor/thor/group.rb
+++ b/lib/bundler/vendor/thor/group.rb
@@ -187,9 +187,9 @@ class Thor::Group
human_name = value.respond_to?(:classify) ? value.classify : value
group_options[human_name] ||= []
- group_options[human_name] += klass.class_options.values.select do |option|
- base_options[option.name.to_sym].nil? && option.group.nil? &&
- !group_options.values.flatten.any? { |i| i.name == option.name }
+ group_options[human_name] += klass.class_options.values.select do |class_option|
+ base_options[class_option.name.to_sym].nil? && class_option.group.nil? &&
+ !group_options.values.flatten.any? { |i| i.name == class_option.name }
end
yield klass if block_given?
@@ -220,10 +220,14 @@ class Thor::Group
args, opts = Thor::Options.split(given_args)
opts = given_opts || opts
+ instance = new(args, opts, config)
+ yield instance if block_given?
+ args = instance.args
+
if task
- new(args, opts, config).invoke_task(all_tasks[task])
+ instance.invoke_task(all_tasks[task])
else
- new(args, opts, config).invoke_all
+ instance.invoke_all
end
end