Class: RightmoveWrangler::Processor
- Inherits:
-
Object
- Object
- RightmoveWrangler::Processor
- Defined in:
- lib/rightmove_wrangler.rb
Constant Summary collapse
- IMAGE_REGEX =
/\.(jpg|jpeg|png|gif)/i
Instance Attribute Summary collapse
-
#directory_list ⇒ Object
Returns the value of attribute directory_list.
Instance Method Summary collapse
-
#initialize(args) ⇒ Processor
constructor
A new instance of Processor.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Processor
Returns a new instance of Processor.
14 15 16 17 |
# File 'lib/rightmove_wrangler.rb', line 14 def initialize(args) @args = args @options = {} end |
Instance Attribute Details
#directory_list ⇒ Object
Returns the value of attribute directory_list.
11 12 13 |
# File 'lib/rightmove_wrangler.rb', line 11 def directory_list @directory_list end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rightmove_wrangler.rb', line 19 def run @opts = OptionParser.new(&method(:set_opts)) @opts.parse!(@args) $stdout.puts @options.inspect if @options.empty? || @options[:path].nil? || !File.directory?(@options[:path]) $stderr.puts 'Invalid path specified' exit 1 else loop do begin process! rescue Exception => ex raise ex if @options[:trace] || SystemExit === ex $stderr.print "#{ex.class}: " if ex.class != RuntimeError $stderr.puts ex. end sleep 5 end end end |