lib/magellan/rake/base_magellan_task.rb in magellan-0.1.2 vs lib/magellan/rake/base_magellan_task.rb in magellan-0.1.3

- old
+ new

@@ -1,25 +1,32 @@ - -#TODO: this is not a good place to use a template method - violates Liskov substitution principle module Magellan module Rake + # The base magellan rake task, defines most attributes associated with running a magellan task + #TODO: this is not a good place to use a template method - violates Liskov substitution principle class BaseMagellanTask < ::Rake::TaskLib + # The url to start the crawl at attr_accessor :origin_url + # How deep to explore attr_accessor :explore_depth + # An array of urls to not crawl attr_accessor :ignored_urls + # The kind of links you would like attr_accessor :links_to_explore + # The success message for the task, this is set by the broken link and expected links task. attr_accessor :success_message + # If this is set the logger will log out failures to a file that you specify here, you can tail this log + # while the crawl is running so you can see what is failing attr_accessor :failure_log - def initialize(name) + def initialize(name) # :nodoc: @ignored_urls = [] @name=name yield self if block_given? define end - def define + def define # :nodoc: desc description task @name do settings = {:origin_url => origin_url, :depth_to_explore => explore_depth, :domains => [origin_url], :ignored_urls =>ignored_urls, :links_to_explore => links_to_explore, :trace => ENV['TRACE']} cartographer = Magellan::Cartographer.new(settings) @@ -34,10 +41,9 @@ $stdout.puts "\n" + success_message end end end - end end end