Class: Rumld::Graph
- Inherits:
-
Object
- Object
- Rumld::Graph
- Extended by:
- Forwardable
- Defined in:
- lib/rumld/graph.rb
Instance Attribute Summary collapse
-
#doc_dir ⇒ Object
Returns the value of attribute doc_dir.
-
#files ⇒ Object
Returns the value of attribute files.
-
#source_dirs ⇒ Object
Returns the value of attribute source_dirs.
Instance Method Summary collapse
- #files_to_process ⇒ Object
-
#initialize(doc_dir, source_dirs = [], files = []) ⇒ Graph
constructor
A new instance of Graph.
- #tree ⇒ Object
Constructor Details
#initialize(doc_dir, source_dirs = [], files = []) ⇒ Graph
Returns a new instance of Graph.
5 6 7 8 9 |
# File 'lib/rumld/graph.rb', line 5 def initialize(doc_dir, source_dirs = [], files = []) self.doc_dir = doc_dir self.source_dirs = source_dirs self.files = files end |
Instance Attribute Details
#doc_dir ⇒ Object
Returns the value of attribute doc_dir.
3 4 5 |
# File 'lib/rumld/graph.rb', line 3 def doc_dir @doc_dir end |
#files ⇒ Object
Returns the value of attribute files.
3 4 5 |
# File 'lib/rumld/graph.rb', line 3 def files @files end |
#source_dirs ⇒ Object
Returns the value of attribute source_dirs.
3 4 5 |
# File 'lib/rumld/graph.rb', line 3 def source_dirs @source_dirs end |
Instance Method Details
#files_to_process ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rumld/graph.rb', line 12 def files_to_process unless @files_to_process @files_to_process = [] source_dirs.each do |dir| files.each { |file| @files_to_process += Dir.glob(File.join(dir, '**', file)) } if files end @files_to_process.uniq! @files_to_process.each{|f| require f} end @files_to_process end |