Class: Nanoc::DataSources::Filesystem Private
- Inherits:
-
Nanoc::DataSource
- Object
- Nanoc::DataSources::Filesystem
- Defined in:
- lib/nanoc/data_sources/filesystem.rb,
lib/nanoc/data_sources/filesystem/tools.rb,
lib/nanoc/data_sources/filesystem/errors.rb,
lib/nanoc/data_sources/filesystem/parser.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Modules: Errors, Tools Classes: AmbiguousMetadataAssociationError, Parser, ProtoDocument
Instance Method Summary collapse
- #changes_for_dir(dir) ⇒ Object private
- #content_dir_name ⇒ Object private
-
#down ⇒ Object
private
See Core::DataSource.down.
- #item_changes ⇒ Object private
-
#items ⇒ Object
private
See Core::DataSource.items.
- #layout_changes ⇒ Object private
-
#layouts ⇒ Object
private
See Core::DataSource.layouts.
- #layouts_dir_name ⇒ Object private
-
#up ⇒ Object
private
See Core::DataSource.up.
Instance Method Details
#changes_for_dir(dir) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 94 def changes_for_dir(dir) require 'listen' Nanoc::Core::ChangesStream.new do |cl| full_dir = dir ? File.(dir) : nil if full_dir && File.directory?(full_dir) listener = Listen.to(full_dir) do |_modifieds, _addeds, _deleteds| cl.unknown end listener.start cl.to_stop { listener.stop } end sleep end end |
#content_dir_name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
68 69 70 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 68 def content_dir_name config.fetch(:content_dir, 'content') end |
#down ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
See Core::DataSource.down.
66 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 66 def down; end |
#item_changes ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
86 87 88 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 86 def item_changes changes_for_dir(content_dir_name) end |
#items ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
See Core::DataSource.items.
77 78 79 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 77 def items load_objects(content_dir_name, Nanoc::Core::Item) end |
#layout_changes ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
90 91 92 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 90 def layout_changes changes_for_dir(layouts_dir_name) end |
#layouts ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
See Core::DataSource.layouts.
82 83 84 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 82 def layouts load_objects(layouts_dir_name, Nanoc::Core::Layout) end |
#layouts_dir_name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
72 73 74 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 72 def layouts_dir_name config.fetch(:layouts_dir, 'layouts') end |
#up ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
See Core::DataSource.up.
63 |
# File 'lib/nanoc/data_sources/filesystem.rb', line 63 def up; end |