@@ -7,7 +7,9 @@ class Command < Thor
7
7
desc "new APP_NAME" , "create a new Rails app"
8
8
method_option :recipes , :type => :array , :aliases => "-r"
9
9
method_option :defaults , :type => :string , :aliases => "-d"
10
+ method_option :recipe_dirs , :type => :array , :aliases => "-l"
10
11
def new ( name )
12
+ add_recipes
11
13
args = ask_for_args
12
14
recipes , defaults = load_defaults
13
15
recipes = ask_for_recipes ( recipes )
@@ -18,7 +20,9 @@ def new(name)
18
20
desc "template TEMPLATE_FILE" , "create a new Rails template"
19
21
method_option :recipes , :type => :array , :aliases => "-r"
20
22
method_option :defaults , :type => :string , :aliases => "-d"
23
+ method_option :recipe_dirs , :type => :array , :aliases => "-l"
21
24
def template ( template_name )
25
+ add_recipes
22
26
recipes , defaults = load_defaults
23
27
recipes = ask_for_recipes ( recipes )
24
28
gems = ask_for_gems
@@ -46,6 +50,12 @@ def red; "\033[31m" end
46
50
def green ; "\033 [32m" end
47
51
def yellow ; "\033 [33m" end
48
52
53
+ def add_recipes
54
+ if dirs = options [ :recipe_dirs ]
55
+ dirs . each { |d | Recipes . add_from_directory ( d ) }
56
+ end
57
+ end
58
+
49
59
def load_defaults
50
60
# Load defaults from a file; if a file specifies recipes, they'll be run *before*
51
61
# any on the command line (or prompted for)..
0 commit comments