Class: Xing::CLI::Generators::NewProject::UserInput

Inherits:
Object
  • Object
show all
Defined in:
lib/xing/cli/generators/new_project/user_input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#coc_contact_emailObject

Returns the value of attribute coc_contact_email.



6
7
8
# File 'lib/xing/cli/generators/new_project/user_input.rb', line 6

def coc_contact_email
  @coc_contact_email
end

#code_of_conductObject

Returns the value of attribute code_of_conduct.



6
7
8
# File 'lib/xing/cli/generators/new_project/user_input.rb', line 6

def code_of_conduct
  @code_of_conduct
end

Instance Method Details

#gatherObject



8
9
10
11
12
13
# File 'lib/xing/cli/generators/new_project/user_input.rb', line 8

def gather
  self.code_of_conduct = yesno("Add a Code of Conduct? (Contributor Covenant)")
  if code_of_conduct
    self.coc_contact_email = highline.ask("Enter a contact email for your Code of Conduct:") { |q| q.validate = /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/ }
  end
end