jumpstart 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :jumpstart_version_major: 0
3
3
  :jumpstart_version_minor: 3
4
- :jumpstart_version_patch: 0
4
+ :jumpstart_version_patch: 1
@@ -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
- # Displays options for the "create a new jumpstart project from an existing template" menu
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 |t|
201
+ JumpStart.existing_templates.each do |x|
206
202
  count += 1
207
- puts " #{count.to_s.yellow} #{t.green}"
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
- unless JumpStart.existing_templates.nil?
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
- count = 0
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"
@@ -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
- JumpStart.expects(:existing_templates).once
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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ian Alexander Wood (i0n)