class ProjectMonitorStat::Util

Public Class Methods

get(url: raise, cookie: nil) click to toggle source
# File lib/project_monitor_stat/util.rb, line 18
def self.get(url: raise, cookie: nil)
  uri = URI(url)
  request = Net::HTTP::Get.new(uri)
  request.add_field('Cookie', cookie) if cookie

  response = Net::HTTP.start(uri.hostname, uri.port) do |http|
    http.request(request)
  end

  response.body
end
puts(*args) click to toggle source
# File lib/project_monitor_stat/util.rb, line 6
def self.puts(*args)
  Kernel.puts(*args)
end
system(*args) click to toggle source
# File lib/project_monitor_stat/util.rb, line 10
def self.system(*args)
  Kernel.system(*args)
end
x(command) click to toggle source
# File lib/project_monitor_stat/util.rb, line 14
def self.x(command)
  %x(#{command}).chomp
end