Class: Thinner::CommandLine

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

Constant Summary collapse

<<-EOF
Thinner purges varnish caches as slowly as you need it to.

Documentation: http://propublica.github.com/thinner/

Usage: thinner OPTIONS URL

Options:
EOF

Instance Method Summary collapse

Constructor Details

#initializeCommandLine

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



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

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

Instance Method Details

#run!Object

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



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

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