Class: Martha::Builder

Inherits:
Thor
  • Object
show all
Includes:
Martha, Thor::Actions
Defined in:
lib/martha/builder.rb

Constant Summary

Constants included from Martha

VERSION

Instance Method Summary collapse

Constructor Details

#initialize(args = [], local_options = {}, config = {}) ⇒ Builder



10
11
12
13
14
15
16
17
18
19
# File 'lib/martha/builder.rb', line 10

def initialize(args = [], local_options = {}, config = {})
  super
  @author = "Victor Elizalde"
  @file_info = []
  @description = ""
  @output_description = ""
  @input_description = ""
  @method_info = []
  @file_name = ""
end

Instance Method Details

#reveal(file_name) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/martha/builder.rb', line 22

def reveal(file_name)
  @file_name = file_name
  if File.file?(@file_name)
    greetings
    if file_name.split('.')[1] == "cpp"
      puts "I found #{method_quantity_cpp} undocumented method(s)/function(s)\n\n"
      document_methods_cpp
      puts "Finished documenting method(s)/function(s)"
    else
      puts "I found #{method_quantity_rb} undocumented method(s)/function(s)\n\n"
      document_methods_rb
      puts "Finished documenting method(s)/function(s)"
    end
  else
    error
  end
end