Class: Robots
- Inherits:
-
Object
- Object
- Robots
- Defined in:
- lib/robots.rb
Instance Method Summary collapse
-
#initialize(url, file_name = "robots.txt") ⇒ Robots
constructor
A new instance of Robots.
Constructor Details
#initialize(url, file_name = "robots.txt") ⇒ Robots
Returns a new instance of Robots.
3 4 5 6 7 8 |
# File 'lib/robots.rb', line 3 def initialize(url, file_name="robots.txt") uri = URI.parse(url) [uri.scheme, "://", uri.host, ":", uri.port, "/", file_name].join Cobweb.new(:cache => 6000).get([uri.scheme, "://", uri.host, ":", uri.port, "/", file_name].join) end |