Class: Instadoc::Analyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/instadoc/analyzer.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = Instadoc.config) ⇒ Analyzer

Returns a new instance of Analyzer.



7
8
9
# File 'lib/instadoc/analyzer.rb', line 7

def initialize(config = Instadoc.config)
  @config = config
end

Instance Method Details

#create_documentationObject



11
12
13
14
15
# File 'lib/instadoc/analyzer.rb', line 11

def create_documentation()
  java_files = java()
  html_builder = Instadoc::HtmlBuilder.new(@config)
  html_builder.create(java_files)
end

#create_file(path) ⇒ Object



23
24
25
# File 'lib/instadoc/analyzer.rb', line 23

def create_file(path)
  Pathname.new(File.new(path, 'w').path)
end

#javaObject



17
18
19
20
21
# File 'lib/instadoc/analyzer.rb', line 17

def java()
  java_code = Instadoc::Java::JavaCode.new(@config)
  java_code.search(@config.input_path)
  java_code.files
end

#validate_directory(base_dir) ⇒ Object



27
28
29
30
31
32
# File 'lib/instadoc/analyzer.rb', line 27

def validate_directory(base_dir)
  unless FileTest.exists?(base_dir)
    STDERR.puts "Requires a existing path! Given was => #{base_dir}"
    exit false
  end
end