Module: Rider
- Defined in:
- lib/rider.rb,
lib/rider/queue.rb,
lib/rider/crawler.rb,
lib/rider/part_queue.rb
Defined Under Namespace
Classes: Crawler, HostPartitionedQueue, Queue
Constant Summary
collapse
- VERSION =
'0.1'
- LOGGER =
Logger.new(STDOUT)
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.log ⇒ Object
21
22
23
|
# File 'lib/rider.rb', line 21
def log
LOGGER
end
|
Instance Method Details
#to_absolute(uri, link) ⇒ Object
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/rider.rb', line 26
def to_absolute(uri, link)
link = URI.encode(link.to_s.gsub(/#[a-zA-Z0-9_-]*$/,''))
return nil if link.nil? or link.empty?
relative = URI(link)
absolute = uri.merge(relative)
absolute.path = '/' if absolute.path.nil? or absolute.path.empty?
return absolute
end
|