Class: Thinner::CommandLine
- Inherits:
-
Object
- Object
- Thinner::CommandLine
- Defined in:
- lib/thinner/command_line.rb
Constant Summary collapse
- BANNER =
Usage and summary
<<-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
-
#initialize ⇒ CommandLine
constructor
Create a Thinner::CommandLine, parse any associated options, grab a list of urls and start the process.
-
#run! ⇒ Object
Build a Thinner::Configuration instance from the passed in options and go to the races.
Constructor Details
#initialize ⇒ CommandLine
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 @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 |