Sha256: d2a56ca9f793c821d4ccf89ebffcf817f638266c9f83639a50cd2dd4d8a85f6e

Contents?: true

Size: 713 Bytes

Versions: 13

Compression:

Stored size: 713 Bytes

Contents

module Retriever
  #
  class CLI
    def initialize(url, options)
      # kick off the fetch mode of choice
      @fetch = choose_fetch_mode(url, options)
      @fetch.dump
      @fetch.write if options['filename']
      @fetch.autodownload if options['autodown'] && options['fileharvest']
      @fetch.gen_xml if /XML/i =~ options['sitemap'].to_s
    end

    def choose_fetch_mode(url, options)
      if options['fileharvest']
        Retriever::FetchFiles.new(url, options)
      elsif options['sitemap']
        Retriever::FetchSitemap.new(url, options)
      elsif options['seo']
        Retriever::FetchSEO.new(url, options)
      else
        fail '### Error: No Mode Selected'
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rubyretriever-1.4.6 lib/retriever/cli.rb
rubyretriever-1.4.5 lib/retriever/cli.rb
rubyretriever-1.4.4 lib/retriever/cli.rb
rubyretriever-1.4.3 lib/retriever/cli.rb
rubyretriever-1.4.2 lib/retriever/cli.rb
rubyretriever-1.4.1 lib/retriever/cli.rb
rubyretriever-1.4.0 lib/retriever/cli.rb
rubyretriever-1.3.0 lib/retriever/cli.rb
rubyretriever-1.2.4 lib/retriever/cli.rb
rubyretriever-1.2.3 lib/retriever/cli.rb
rubyretriever-1.2.2 lib/retriever/cli.rb
rubyretriever-1.2.1 lib/retriever/cli.rb
rubyretriever-1.2.0 lib/retriever/cli.rb