Class: Pumog::Commandline

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/pumog/commandline.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



9
10
11
# File 'lib/pumog/commandline.rb', line 9

def self.source_root
  'templates'
end

Instance Method Details

#startObject



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
40
41
# File 'lib/pumog/commandline.rb', line 15

def start
  @nodoc= options[:nodoc] ? false : true

  name = ''
  while name.empty?
    say "What is the name of the module?", :green
    name = STDIN.gets.chop
    say Pumog::Messages.module_name_error(name), :red
  end

  author = ''
  while author.empty?
    say "What is the name of the author?", :green
    author = STDIN.gets.chop
    say Pumog::Messages.author_name_error(author), :red
  end unless !@nodoc

  email = ''
  while email.empty?
    say "What is the email adress of the author?", :green
    email = STDIN.gets.chop
    say Pumog::Messages.email_adress_error(email), :red
  end unless !@nodoc

  module_information = Pumog::ModuleInformation.new(name, author, email)
  confirm(module_information)
end