Class: LazyRails::PromptGenerators::AskAppName

Inherits:
Base
  • Object
show all
Defined in:
lib/lazy_rails/prompt_generators.rb

Instance Attribute Summary

Attributes inherited from Base

#prompt

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from LazyRails::PromptGenerators::Base

Instance Method Details

#callObject



53
54
55
56
57
58
59
60
# File 'lib/lazy_rails/prompt_generators.rb', line 53

def call
  prompt.ask("What is the name of your project?") do |q|
    q.default "rails-app-#{Time.now.to_i}"
    q.required true
    q.validate(/\A[\w-]+\z/)
    q.messages[:valid?] = "Project name can only contain letters, numbers, underscores, and dashes"
  end
end