Class: Ripli::CustomParser

Inherits:
Object
  • Object
show all
Defined in:
lib/ripli/customparser.rb

Constant Summary collapse

LOG_DIR =
'log'
DEFAULT_MAX_TIMEOUT =
1000
DEFAULT_MECHANIZE_TIMEOUT =
10

Instance Method Summary collapse

Constructor Details

#initializeCustomParser

Returns a new instance of CustomParser.



12
13
14
15
16
17
18
19
20
21
# File 'lib/ripli/customparser.rb', line 12

def initialize
  @dir = "#{LOG_DIR}/#{self.class.name.split('::').last.downcase}"
  @mechanize = Mechanize.new do |agent|
    agent.open_timeout = DEFAULT_MECHANIZE_TIMEOUT
    agent.read_timeout = DEFAULT_MECHANIZE_TIMEOUT
  end
  Dir.mkdir(LOG_DIR) unless Dir.exist?(LOG_DIR)
  Dir.mkdir(@dir) unless Dir.exist?(@dir)
  @logger = Logger.new(STDOUT)
end

Instance Method Details

#shell_exec!(types) ⇒ Object



23
24
25
# File 'lib/ripli/customparser.rb', line 23

def shell_exec!(types)
  types.each(&method(:save_proxy_chains))
end