Class: Yarrow::Content::Graph

Inherits:
Object
  • Object
show all
Defined in:
lib/yarrow/content/graph.rb

Overview

A directed graph of every element of content in the project.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_source(config) ⇒ Object

Construct a graph collected from source content files.



18
19
20
# File 'lib/yarrow/content/graph.rb', line 18

def self.from_source(config)
  new(SourceCollector.collect(config.input_dir))
end

Instance Method Details

#directoriesObject

List of source directories.



28
29
30
# File 'lib/yarrow/content/graph.rb', line 28

def directories
  graph.nodes(:directory)
end

#filesObject

List of source files.



23
24
25
# File 'lib/yarrow/content/graph.rb', line 23

def files
  graph.nodes(:file)
end