Class: Ripli::CustomParser
- Inherits:
-
Object
- Object
- Ripli::CustomParser
- Defined in:
- lib/ripli/customparser.rb
Direct Known Subclasses
Constant Summary collapse
- LOG_DIR =
'log'- DEFAULT_MAX_TIMEOUT =
1000- DEFAULT_MECHANIZE_TIMEOUT =
10
Instance Method Summary collapse
-
#initialize ⇒ CustomParser
constructor
A new instance of CustomParser.
- #shell_exec!(types) ⇒ Object
Constructor Details
#initialize ⇒ CustomParser
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 |