Class: Magellan::Rake::BrokenLinkTask

Inherits:
BaseMagellanTask show all
Defined in:
lib/magellan/rake/broken_link_task.rb

Overview

Example: require ‘magellan/rake/broken_link_task’ Magellan::Rake::BrokenLinkTask.new(“digg”) do |t|

t.origin_url = "http://digg.com/"
t.explore_depth = 3

end

Instance Attribute Summary

Attributes inherited from BaseMagellanTask

#explore_depth, #failure_log, #ignored_urls, #links_to_explore, #origin_url, #success_message

Instance Method Summary collapse

Methods inherited from BaseMagellanTask

#define

Constructor Details

#initialize(name = "magellan:explore") ⇒ BrokenLinkTask

Defines a new task, using the name name.



17
18
19
20
21
# File 'lib/magellan/rake/broken_link_task.rb', line 17

def initialize(name="magellan:explore")
  @links_to_explore = [["a","href"],["script","src"],["img","src"]]
  @success_message = "No broken links were found!"
  super(name)
end

Instance Method Details

#create_observerObject

:nodoc:



23
24
25
# File 'lib/magellan/rake/broken_link_task.rb', line 23

def create_observer # :nodoc:
  Magellan::BrokenLinkTracker.new
end

#descriptionObject

:nodoc:



27
28
29
# File 'lib/magellan/rake/broken_link_task.rb', line 27

def description # :nodoc:
  "explore #{@origin_url} for broken links"
end