Module: Lifer

Defined in:
lib/lifer.rb

Defined Under Namespace

Modules: Builder, Utilities Classes: Brain, Collection, Config, Entry, Layout, URIStrategy

Constant Summary collapse

IGNORE_DIRECTORIES =
[
  "assets",
  "bin",
  "vendor"
]
IGNORE_PATTERNS =
[
  "^(\\.)",     # Starts with a dot.
  "^(_)",       # Starts with an underscore.
  "(\\/\\.)+"   # Contains a dot directory.
] | IGNORE_DIRECTORIES.map { |d| "^(#{d})" }

Class Method Summary collapse

Class Method Details

.brainObject



27
28
29
# File 'lib/lifer.rb', line 27

def brain
  @@brain ||= Lifer::Brain.init(root: Dir.pwd)
end

.build!Object



31
32
33
# File 'lib/lifer.rb', line 31

def build!
  brain.build!
end

.collectionsObject



35
36
37
# File 'lib/lifer.rb', line 35

def collections
  brain.collections
end

.ignoreable?(directory_or_file) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/lifer.rb', line 39

def ignoreable?(directory_or_file)
  directory_or_file.match?(/#{IGNORE_PATTERNS.join("|")}/)
end

.manifestObject



43
44
45
# File 'lib/lifer.rb', line 43

def manifest
  brain.manifest
end

.rootObject



47
48
49
# File 'lib/lifer.rb', line 47

def root
  brain.root
end

.settingsObject



51
52
53
# File 'lib/lifer.rb', line 51

def settings
  brain.config.settings
end