Class: Nanoc::Extra::Checking::Check Private
- Inherits:
-
Int::Context
- Object
- Int::Context
- Nanoc::Extra::Checking::Check
- Extended by:
- Int::PluginRegistry::PluginMethods
- Defined in:
- lib/nanoc/extra/checking/check.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.
Direct Known Subclasses
Nanoc::Extra::Checking::Checks::ExternalLinks, Nanoc::Extra::Checking::Checks::InternalLinks, Nanoc::Extra::Checking::Checks::MixedContent, Nanoc::Extra::Checking::Checks::Stale, Nanoc::Extra::Checking::Checks::W3CValidator
Instance Attribute Summary collapse
- #issues ⇒ Object readonly private
Class Method Summary collapse
- .create(site) ⇒ Object private
Instance Method Summary collapse
- #add_issue(desc, subject: nil) ⇒ Object private
-
#initialize(context) ⇒ Check
constructor
private
A new instance of Check.
- #run ⇒ Object private
Methods included from Int::PluginRegistry::PluginMethods
all, identifier, identifiers, named, register
Methods inherited from Int::Context
Constructor Details
#initialize(context) ⇒ Check
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.
Returns a new instance of Check.
35 36 37 38 39 |
# File 'lib/nanoc/extra/checking/check.rb', line 35 def initialize(context) super(context) @issues = Set.new end |
Instance Attribute Details
#issues ⇒ Object (readonly)
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.
13 14 15 |
# File 'lib/nanoc/extra/checking/check.rb', line 13 def issues @issues end |
Class Method Details
.create(site) ⇒ 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.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/nanoc/extra/checking/check.rb', line 15 def self.create(site) output_dir = site.config[:output_dir] unless File.exist?(output_dir) raise Nanoc::Extra::Checking::OutputDirNotFoundError.new(output_dir) end output_filenames = Dir[output_dir + '/**/*'].select { |f| File.file?(f) } # FIXME: ugly view_context = site.compiler.create_view_context(Nanoc::Int::DependencyTracker::Null.new) context = { items: Nanoc::ItemCollectionWithRepsView.new(site.items, view_context), layouts: Nanoc::LayoutCollectionView.new(site.layouts, view_context), config: Nanoc::ConfigView.new(site.config, view_context), output_filenames: output_filenames, } new(context) end |
Instance Method Details
#add_issue(desc, subject: nil) ⇒ 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.
45 46 47 |
# File 'lib/nanoc/extra/checking/check.rb', line 45 def add_issue(desc, subject: nil) @issues << Issue.new(desc, subject, self.class) end |
#run ⇒ 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.
41 42 43 |
# File 'lib/nanoc/extra/checking/check.rb', line 41 def run raise NotImplementedError.new('Nanoc::Extra::Checking::Check subclasses must implement #run') end |