mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 06:06:40 +00:00
24 lines
410 B
Ruby
24 lines
410 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'net/http'
|
|
|
|
module Common
|
|
private
|
|
|
|
def self.included(base)
|
|
base.extend(self)
|
|
end
|
|
|
|
def run_cmd(*args)
|
|
info "executing: #{args.join(' ')}"
|
|
system(*args) || err("Exit code: #{$CHILD_STATUS.exitstatus}")
|
|
end
|
|
|
|
def http_get(url)
|
|
response = Net::HTTP.get_response(URI.parse(url))
|
|
return unless response.code == '200'
|
|
|
|
response.body
|
|
end
|
|
end
|