Class: Statique::Discover

Inherits:
Object
  • Object
show all
Defined in:
lib/statique/discover.rb

Constant Summary collapse

SUPPORTED_EXTENSIONS =
%w[
  slim
  md
  builder
].freeze
GLOB =
"**/*.{#{SUPPORTED_EXTENSIONS.join(",")}}"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root, statique) ⇒ Discover

Returns a new instance of Discover.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/statique/discover.rb', line 17

def initialize(root, statique)
  @root = root
  @documents = []
  @collections = Hashie::Mash.new { |hash, key| hash[key] = Set.new }
  @statique = statique

  discover_files!
  discover!

  @statique.mode.build do
    @files.freeze
    @documents.freeze
    @collections.freeze
  end

  watch_for_changes if @statique.mode.server?
end

Instance Attribute Details

#collectionsObject (readonly)

Returns the value of attribute collections.



7
8
9
# File 'lib/statique/discover.rb', line 7

def collections
  @collections
end

#documentsObject (readonly)

Returns the value of attribute documents.



7
8
9
# File 'lib/statique/discover.rb', line 7

def documents
  @documents
end

#filesObject (readonly)

Returns the value of attribute files.



7
8
9
# File 'lib/statique/discover.rb', line 7

def files
  @files
end