Class: Wtf::CLI::Application

Inherits:
Thor
  • Object
show all
Defined in:
lib/wtf/cli/application.rb

Instance Method Summary collapse

Instance Method Details

#cleanObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/wtf/cli/application.rb', line 27

def clean
  if Wtf::Doc.has_documentation?
    if yes?("Are you sure to cleanup the documentation for this folder?")
      Wtf::Doc.clean
      say :cleaned, :green
    end
  else
    say "This directory doesn't have any .wtf file", :yellow
  end
end

#docObject



19
20
21
22
23
24
# File 'lib/wtf/cli/application.rb', line 19

def doc
  content = ask("What others should know about this folder? \n\n").to_s
  Wtf::Doc.write(content)
  say "\n\n Folder documentation added: \n\n"
  say Wtf::Doc.content.to_s + "\n\n", :green
end

#hereObject



8
9
10
11
12
13
14
# File 'lib/wtf/cli/application.rb', line 8

def here
  if Wtf::Doc.content
    say "DOC ==> " + Wtf::Doc.content.to_s, :green
  else
    doc if yes?("Do you want to add a documentation for this folder?")
  end
end