Module: RubyBreaker::RDocSupport

Includes:
TypeDefs
Defined in:
lib/rubybreaker/doc/rdoc.rb

Overview

This module has functionalities that are necessary for supporting RDoc output

Constant Summary collapse

DOCUMENTED =

This array keeps track of modules/classes whose type information is documented.

{}

Class Method Summary collapse

Class Method Details

.export_to_yaml(yaml_file, breakable_modules, broken_modules) ⇒ Object

This method exports the RubyBreaker output into a yaml file.



17
18
19
20
21
22
23
24
25
# File 'lib/rubybreaker/doc/rdoc.rb', line 17

def self.export_to_yaml(yaml_file, breakable_modules, broken_modules)
  hash = {
    breakable: breakable_modules,
    broken: broken_modules
  }
  File.open(yaml_file, "w") do |f|
    f.puts YAML.dump(hash)
  end
end

.import_from_yaml(yaml_file) ⇒ Object

This method imports the RubyBreaker output from a yaml file.



28
29
30
31
32
33
# File 'lib/rubybreaker/doc/rdoc.rb', line 28

def self.import_from_yaml(yaml_file)
  File.open(yaml_file, "r") do |f|
    raw = f.read
    hash = YAML.to_hash(raw)
  end
end