class DailyRep::IBrowser
Attributes
entity[R]
Public Class Methods
new(*inputs)
click to toggle source
# File lib/dailyrep/IBrowser.rb, line 21 def initialize *inputs @entity = self.class.to_s.downcase.split('::').last end
write_html()
click to toggle source
# File lib/dailyrep/IBrowser.rb, line 40 def self.write_html @@index_writer.write_html end
Public Instance Methods
get_source_http(source, val_scope)
click to toggle source
# File lib/dailyrep/IBrowser.rb, line 45 def get_source_http source, val_scope page = Nokogiri::HTML(open(source.to_s)) page.css(val_scope) end
get_source_json(source)
click to toggle source
# File lib/dailyrep/IBrowser.rb, line 50 def get_source_json source uri = URI(source) out_json = Net::HTTP.get(uri) JSON.parse(out_json) end
method_missing(meth, *args, &block)
click to toggle source
Calls superclass method
# File lib/dailyrep/IBrowser.rb, line 56 def method_missing(meth, *args, &block) if @@app_cycle_methods.include?(meth.to_s) begin self.log_msg meth.to_s block.call rescue Exception => e log_error e end else super end end
push_note(note)
click to toggle source
# File lib/dailyrep/IBrowser.rb, line 25 def push_note note @@notificators.each { |client| client.push_note(note) } # @@client.push_note(nil, @@note_title, note) end
run()
click to toggle source
# File lib/dailyrep/IBrowser.rb, line 69 def run self.process self.write_to_db if Configer.is_phase_enabled?('write_to_db') self.notify if Configer.is_phase_enabled?('notify') self.web_reload if Configer.is_phase_enabled?('web_reload') end
set_html(entity, values, push=0)
click to toggle source
# File lib/dailyrep/IBrowser.rb, line 32 def set_html entity, values, push=0 @@index_writer.set_html entity, values, push end
set_html_with_diff(entity, scope, diff, reset=false)
click to toggle source
# File lib/dailyrep/IBrowser.rb, line 36 def set_html_with_diff entity, scope, diff, reset=false @@index_writer.set_html_with_diff entity, scope, diff, reset end