jumpstart 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/config/jumpstart_version.yml +1 -1
- data/lib/jumpstart/base.rb +14 -22
- data/test/jumpstart/test_base.rb +1 -1
- metadata +2 -2
data/lib/jumpstart/base.rb
CHANGED
@@ -33,7 +33,7 @@ module JumpStart
|
|
33
33
|
# set instance variable @template_path as the directory to read templates from.
|
34
34
|
@template_path = FileUtils.join_paths(JumpStart.templates_path, @template_name)
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
# Sets up instance variables from YAML file
|
38
38
|
def set_config_file_options
|
39
39
|
if @template_name.nil? || @template_path.nil?
|
@@ -195,18 +195,22 @@ module JumpStart
|
|
195
195
|
end
|
196
196
|
end
|
197
197
|
|
198
|
-
|
199
|
-
def new_project_from_template_menu
|
200
|
-
puts "\n\n******************************************************************************************************************************************\n\n"
|
201
|
-
puts " CREATE A NEW JUMPSTART PROJECT FROM AN EXISTING TEMPLATE\n\n".purple
|
202
|
-
puts " Type a number for the template that you want.\n\n"
|
198
|
+
def display_existing_templates
|
203
199
|
unless JumpStart.existing_templates.empty?
|
204
200
|
count = 0
|
205
|
-
JumpStart.existing_templates.each do |
|
201
|
+
JumpStart.existing_templates.each do |x|
|
206
202
|
count += 1
|
207
|
-
puts " #{count.to_s.yellow} #{
|
203
|
+
puts " #{count.to_s.yellow} #{x.green}\n"
|
208
204
|
end
|
209
205
|
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# Displays options for the "create a new jumpstart project from an existing template" menu
|
209
|
+
def new_project_from_template_menu
|
210
|
+
puts "\n\n******************************************************************************************************************************************\n\n"
|
211
|
+
puts " CREATE A NEW JUMPSTART PROJECT FROM AN EXISTING TEMPLATE\n\n".purple
|
212
|
+
puts " Type a number for the template that you want.\n\n"
|
213
|
+
display_existing_templates
|
210
214
|
puts "\n b".yellow + " Back to main menu."
|
211
215
|
puts "\n x".yellow + " Exit jumpstart\n\n"
|
212
216
|
puts "******************************************************************************************************************************************\n\n"
|
@@ -239,13 +243,7 @@ module JumpStart
|
|
239
243
|
puts "\n\n******************************************************************************************************************************************\n\n"
|
240
244
|
puts " CREATE A NEW JUMPSTART TEMPLATE\n".purple
|
241
245
|
puts " Existing templates:\n"
|
242
|
-
|
243
|
-
count = 0
|
244
|
-
JumpStart.existing_templates.each do |x|
|
245
|
-
count += 1
|
246
|
-
puts " #{count.to_s.yellow} #{x.green}\n"
|
247
|
-
end
|
248
|
-
end
|
246
|
+
display_existing_templates
|
249
247
|
puts "\n b".yellow + " Back to main menu."
|
250
248
|
puts "\n x".yellow + " Exit jumpstart\n"
|
251
249
|
new_template_options
|
@@ -334,13 +332,7 @@ module JumpStart
|
|
334
332
|
def set_default_template_menu
|
335
333
|
puts "\n\n******************************************************************************************************************************************\n\n"
|
336
334
|
puts " SELECT A DEFAULT JUMPSTART TEMPLATE\n\n".purple
|
337
|
-
|
338
|
-
unless JumpStart.existing_templates.nil?
|
339
|
-
JumpStart.existing_templates.each do |t|
|
340
|
-
count += 1
|
341
|
-
puts " #{count.to_s.yellow} #{t.green}"
|
342
|
-
end
|
343
|
-
end
|
335
|
+
display_existing_templates
|
344
336
|
puts "\n b".yellow + " Back to main menu.\n\n"
|
345
337
|
puts " x".yellow + " Exit jumpstart\n\n"
|
346
338
|
puts "******************************************************************************************************************************************\n\n"
|
data/test/jumpstart/test_base.rb
CHANGED
@@ -490,7 +490,7 @@ class TestJumpstartBase < Test::Unit::TestCase
|
|
490
490
|
|
491
491
|
should "display output and call new_template_options" do
|
492
492
|
@test_project.stubs(:new_template_options)
|
493
|
-
|
493
|
+
@test_project.expects(:display_existing_templates).once
|
494
494
|
@test_project.expects(:new_template_options).once
|
495
495
|
@test_project.instance_eval {new_template_menu}
|
496
496
|
assert_equal "\n\n******************************************************************************************************************************************\n\n\e[1m\e[35m CREATE A NEW JUMPSTART TEMPLATE\n\e[0m\n Existing templates:\n\e[1m\e[33m\n b\e[0m Back to main menu.\n\e[1m\e[33m\n x\e[0m Exit jumpstart\n", @test_project.output.string
|