bin/genit in genit-0.5 vs bin/genit in genit-0.9
- old
+ new
@@ -35,18 +35,26 @@
option ['-v', '--version'], :flag, "print version" do
puts "genit #{File.read(File.join($GENIT_PATH, 'VERSION')).strip}"
exit 0
end
-
+
end
class CreateCommand < AbstractCommand
parameter "NAME", "the name of the project", :attribute_name => :project_name
+ option ["-d", "--doctype"], "DOCTYPE", "The Document Type Definition", :default => "html_5"
+ option ["-e", "--empty"], :flag, "Do not produce smoke test", :default => false
+
def execute
- project = ProjectCreator.new project_name
+ valid_doctypes = ['xhtml_1.0_strict', 'xhtml_1.0_transitional', 'html_5']
+ unless valid_doctypes.include? doctype
+ puts 'Valid doctypes are ' + valid_doctypes.inspect
+ exit 1
+ end
+ project = ProjectCreator.new project_name, doctype, empty?
project.create
end
end