module

Create::Crystal::App

Constants

ProjectNameValidator = Proc(Term::Prompt::Question, String | ::Nil, Bool).new do |question, value| if value.nil? || value.blank? question.errors << "Project Name must not be empty." next false end if value.size > 50 question.errors << "Project Name must not be longer than 50 characters." end if !value[0].ascii_letter? question.errors << "Project Name must start with a letter." end if !value.each_char.all? do |c| ((c.alphanumeric? || (c == '-')) || (c == '_')) || (c == ' ') end question.errors << "Project Name must only contain alphanumerical characters, spaces, _ or -" end if question.errors.size > 0 next false end true end

Match the crystal init validation requirements

Instance methods

clean_project_name(unclean_name : String) : String

Makes string module-and-others-name-compatible

Source
create_file(content : String, path : String, project_dir : Path, type : String | Nil = "")

Creates the template

Source
run_cmd(cmd, args)

Runs a command in shell Used for fetching the git aurhor and email from git

Source

Nested types