Class: DocmeCLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/docme/DocmeCLI.rb

Instance Method Summary collapse

Instance Method Details

#clean(path = nil) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/docme/DocmeCLI.rb', line 30

def clean(path = nil)
    path = Dir.pwd if path.nil?

    fail 'Please provide a valid path to a directory that contains a `docme_site` folder.'.color(:red) unless Dir.exist?(path + '/docme_site')

    puts '+ docme will clean '.color(:cyan) + path if options[:v]
    puts '+ docme cleaning'.color(:cyan) if options[:v]

    clean_directory(path + '/docme_site', options[:v])
    Dir.rmdir(path + '/docme_site') if Dir.exist?(path + '/docme_site')

    puts '+ docme_site removed'.color(:cyan) if options[:v]
    puts '+ docme is now homeless'.color(:cyan) if options[:v]

end

#defaultObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/docme/DocmeCLI.rb', line 17

def default
    path = Dir.pwd
    puts "\n  ***Begining docme magix***".color(:green)

    docmeer = Docme.new(path, options[:v], options[:style], options[:index], options[:page])
    docmeer.engage

    puts "\n  ***Finished docme magic!***".color(:green)
    puts "\n  You can find your docs inside the `docme_site` folder. \n   Hint: look for site_index.html\n\n".color(:green)

end

#parse(path) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/docme/DocmeCLI.rb', line 63

def parse(path)

    puts "\n  ***Begining docme magix***".color(:green)

    docmeer = Docme.new(path, options[:v], options[:style], options[:index], options[:page])
    docmeer.engage

    puts "\n  ***Finished docme magic!***".color(:green)
    puts "\n  You can find your docs inside the `docme_site` folder. \n   Hint: look for index.html\n\n".color(:green)

end