Module: SiteChecker
- Defined in:
- lib/site_checker.rb,
lib/site_checker/dsl.rb,
lib/site_checker/link.rb,
lib/site_checker/cli/cli.rb,
lib/site_checker/version.rb,
lib/site_checker/parse/page.rb,
lib/site_checker/link_collector.rb,
lib/site_checker/io/content_from_web.rb,
lib/site_checker/io/content_from_file_system.rb
Defined Under Namespace
Modules: DSL, IO, Parse Classes: Cli, Link, LinkCollector
Constant Summary collapse
- VERSION =
'0.4.0'
Class Attribute Summary collapse
-
.dsl_enabled ⇒ Object
Returns the value of attribute dsl_enabled.
-
.ignore_list ⇒ Object
Returns the value of attribute ignore_list.
-
.link_collector ⇒ Object
readonly
Returns the value of attribute link_collector.
-
.max_recursion_depth ⇒ Object
Returns the value of attribute max_recursion_depth.
-
.visit_references ⇒ Object
Returns the value of attribute visit_references.
Class Method Summary collapse
-
.check(url, root = nil) ⇒ Object
Recursively visits the provided url looking for reference problems.
-
.configure {|_self| ... } ⇒ Object
The following configuration options, which can be used together, are available:.
-
.local_images ⇒ Array
Returns the Array of the visited local images.
-
.local_pages ⇒ Array
Returns the Array of the visited local pages.
-
.problems ⇒ Hash
Returns the Hash (:parent_url => [Array of problematic links]) of the problems.
-
.remote_images ⇒ Array
Returns the Array of the visited remote (external) images.
-
.remote_pages ⇒ Array
Returns the Array of the visited remote (external) pages.
Class Attribute Details
.dsl_enabled ⇒ Object
Returns the value of attribute dsl_enabled.
18 19 20 |
# File 'lib/site_checker.rb', line 18 def dsl_enabled @dsl_enabled end |
.ignore_list ⇒ Object
Returns the value of attribute ignore_list.
15 16 17 |
# File 'lib/site_checker.rb', line 15 def ignore_list @ignore_list end |
.link_collector ⇒ Object (readonly)
Returns the value of attribute link_collector.
19 20 21 |
# File 'lib/site_checker.rb', line 19 def link_collector @link_collector end |
.max_recursion_depth ⇒ Object
Returns the value of attribute max_recursion_depth.
17 18 19 |
# File 'lib/site_checker.rb', line 17 def max_recursion_depth @max_recursion_depth end |
.visit_references ⇒ Object
Returns the value of attribute visit_references.
16 17 18 |
# File 'lib/site_checker.rb', line 16 def visit_references @visit_references end |
Class Method Details
.check(url, root = nil) ⇒ Object
Recursively visits the provided url looking for reference problems.
51 52 53 54 |
# File 'lib/site_checker.rb', line 51 def check(url, root=nil) create_instance @link_collector.check(url, root) end |
.configure {|_self| ... } ⇒ Object
The following configuration options, which can be used together, are available:
-
ignoring certain links:
SiteChecker.configure do |config| config.ignore_list = ["/", "/atom.xml"] end
-
visit the external references as well:
SiteChecker.configure do |config| config.visit_references = true end
-
set the depth of the recursion:
SiteChecker.configure do |config| config.max_recursion_depth = 3 end
41 42 43 |
# File 'lib/site_checker.rb', line 41 def configure yield self end |
.local_images ⇒ Array
Returns the Array of the visited local images.
79 80 81 |
# File 'lib/site_checker.rb', line 79 def local_images @link_collector.local_images end |
.local_pages ⇒ Array
Returns the Array of the visited local pages.
61 62 63 |
# File 'lib/site_checker.rb', line 61 def local_pages @link_collector.local_pages end |
.problems ⇒ Hash
Returns the Hash (:parent_url => [Array of problematic links]) of the problems.
97 98 99 |
# File 'lib/site_checker.rb', line 97 def problems @link_collector.problems end |
.remote_images ⇒ Array
Returns the Array of the visited remote (external) images.
88 89 90 |
# File 'lib/site_checker.rb', line 88 def remote_images @link_collector.remote_images end |
.remote_pages ⇒ Array
Returns the Array of the visited remote (external) pages.
70 71 72 |
# File 'lib/site_checker.rb', line 70 def remote_pages @link_collector.remote_pages end |