-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkprj.thor
39 lines (31 loc) · 878 Bytes
/
mkprj.thor
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
#!/usr/loca/bin/env ruby
require 'thor'
class Mkprj < Thor
include Thor::Actions
def self.source_root
File.dirname(__FILE__)
end
desc "create MY_PROJECT", "create a blank web project"
method_options :prjtype => "basic"
def create(filename)
if options[:prjtype] == "basic"
holla(filename)
directory "templates/basic", "#{filename}", :recursive => true
elsif options[:prjtype] == "html5"
holla(filename)
directory "templates/html5", "#{filename}", :recursive => true
elsif options[:prjtype] == "boilerplate"
holla(filename)
directory "templates/html5_boilerplate", "#{filename}", :recursive => true
else
puts "WTF?"
end
end
no_tasks do
def holla(filename)
puts "You supplied the name: #{filename}"
puts "About to create: #{filename}"
end
end
end
#Mkprj.start