Class: Retriever::CLI
- Inherits:
-
Object
- Object
- Retriever::CLI
- Defined in:
- lib/retriever/cli.rb
Instance Method Summary collapse
- #choose_fetch_mode(url, options) ⇒ Object
-
#initialize(url, options) ⇒ CLI
constructor
A new instance of CLI.
Constructor Details
#initialize(url, options) ⇒ CLI
Returns a new instance of CLI.
4 5 6 7 8 9 10 11 |
# File 'lib/retriever/cli.rb', line 4 def initialize(url, ) # kick off the fetch mode of choice @fetch = choose_fetch_mode(url, ) @fetch.dump @fetch.write if ['filename'] @fetch.autodownload if ['autodown'] && ['fileharvest'] @fetch.gen_xml if /XML/i =~ ['sitemap'].to_s end |
Instance Method Details
#choose_fetch_mode(url, options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/retriever/cli.rb', line 13 def choose_fetch_mode(url, ) if ['fileharvest'] Retriever::FetchFiles.new(url, ) elsif ['sitemap'] Retriever::FetchSitemap.new(url, ) elsif ['seo'] Retriever::FetchSEO.new(url, ) else fail '### Error: No Mode Selected' end end |