Class: Thinner::CommandLine

Inherits:
Object
  • Object
show all
Defined in:
lib/thinner/command_line.rb

Constant Summary

"Thinner purges varnish caches as slowly as you need it to.\n\nDocumentation: http://propublica.github.com/thinner/\n\nUsage: thinner OPTIONS URL\n\nOptions:\n"

Instance Method Summary (collapse)

Constructor Details

- (CommandLine) initialize

Create a Thinner::CommandLine, parse any associated options, grab a list of urls and start the process



21
22
23
24
25
26
# File 'lib/thinner/command_line.rb', line 21

def initialize
  @urls = []
  options!
  @urls ||= ARGV
  run!
end

Instance Method Details

- (Object) run!

Build a Thinner::Configuration instance from the passed in options and go to the races.



30
31
32
33
34
35
36
37
# File 'lib/thinner/command_line.rb', line 30

def run!
  Thinner.configure do |config|
    @options.each_pair do |key, value|
      config.send("#{key}=".to_sym, value)
    end
  end
  Thinner.purge! @urls
end