forked from ramyakailas/chefdk-fundamentals
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
64 lines (45 loc) · 2.02 KB
/
Rakefile
File metadata and controls
64 lines (45 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# Rake tasks for building, managing, and packaging the ChefDK-Fundamentals
#
# This is provides quick-and-dirty support for the metadata file within this project
def name(value) ; value ? @name = value : @name ; end
def maintainer(value) ; value ? @maintainer = value : @maintainer ; end
def maintainer_email(value) ; value ? @maintainer_email = value : @maintainer_email ; end
def license(value) ; value ? @license = value : @license ; end
def description(value) ; value ? @description = value : @description ; end
def version(value = nil) ; value ? @version = value : @version ; end
instance_eval(File.read("metadata.rb"))
namespace :package do
desc "Create a packge for ChefDK Fundamentals - Day 1"
task :day1 do
complete_presentation_filename = 'chefdk-introduction_to_chefdk.pptx'
scene_numbers = (1..9).map {|num| "%02d" % num }
guide_files = scene_numbers.map {|num| "scene_#{num}-GUIDE.md" }
archive_filename = "ChefDK-Introduction_to_Chef-#{version}.zip"
archive_command = "zip #{archive_filename} #{complete_presentation_filename} #{guide_files.join(' ')}"
puts """
********************************************************************************
YOU need to create the day 1 presentation from the following chapters:
* Open 'day_one.pptx'
* Insert 'scene_#{scene_numbers.first}-SLIDES.pptx' into through 'scene_#{scene_numbers.last}-SLIDES.pptx'
into the appropriate sections in the template
* Save the file as '#{complete_presentation_filename}'
PRESS <ENTER> when READY
PRESS <ESC> to QUIT
********************************************************************************
"""
wait = STDIN.gets
puts """
********************************************************************************
Zipping up Day 1
* Archiving '#{complete_presentation_filename}'
"""
scene_numbers.each do |num|
puts """ * Archiving 'scene-#{num}-GUIDE.md'"""
end
puts """
********************************************************************************
"""
`#{archive_command}`
end
end