From 9cd8293785297f1ac5ce2b4fa5217b4648d4f649 Mon Sep 17 00:00:00 2001 From: Mitsuru Hashimoto Date: Wed, 3 Feb 2021 21:05:20 +0900 Subject: [PATCH 1/2] Loaded the directory under tasks. --- lib/thor/util.rb | 2 +- spec/util_spec.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/thor/util.rb b/lib/thor/util.rb index 6e3a545a4..9649b7865 100644 --- a/lib/thor/util.rb +++ b/lib/thor/util.rb @@ -211,7 +211,7 @@ def thor_root_glob # def globs_for(path) path = escape_globs(path) - ["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/*.thor"] + ["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/*.thor", "#{path}/lib/tasks/**/*.thor"] end # Return the path to the ruby interpreter taking into account multiple diff --git a/spec/util_spec.rb b/spec/util_spec.rb index 2182bed89..a35ad0289 100644 --- a/spec/util_spec.rb +++ b/spec/util_spec.rb @@ -180,7 +180,8 @@ def self.clear_user_home! '/home/apps\\{1\\}/Thorfile', '/home/apps\\{1\\}/*.thor', '/home/apps\\{1\\}/tasks/*.thor', - '/home/apps\\{1\\}/lib/tasks/*.thor' + '/home/apps\\{1\\}/lib/tasks/*.thor', + '/home/apps\\{1\\}/lib/tasks/**/*.thor' ]) end end From 6e86ff9c118ef8e656458565822d5dad4edab787 Mon Sep 17 00:00:00 2001 From: Mitsuru Hashimoto Date: Tue, 1 Jun 2021 14:57:26 +0900 Subject: [PATCH 2/2] remove "#{path}/lib/tasks/*.thor" --- lib/thor/util.rb | 2 +- spec/util_spec.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/thor/util.rb b/lib/thor/util.rb index 9649b7865..628c60485 100644 --- a/lib/thor/util.rb +++ b/lib/thor/util.rb @@ -211,7 +211,7 @@ def thor_root_glob # def globs_for(path) path = escape_globs(path) - ["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/*.thor", "#{path}/lib/tasks/**/*.thor"] + ["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/**/*.thor"] end # Return the path to the ruby interpreter taking into account multiple diff --git a/spec/util_spec.rb b/spec/util_spec.rb index a35ad0289..9914706ca 100644 --- a/spec/util_spec.rb +++ b/spec/util_spec.rb @@ -180,7 +180,6 @@ def self.clear_user_home! '/home/apps\\{1\\}/Thorfile', '/home/apps\\{1\\}/*.thor', '/home/apps\\{1\\}/tasks/*.thor', - '/home/apps\\{1\\}/lib/tasks/*.thor', '/home/apps\\{1\\}/lib/tasks/**/*.thor' ]) end