module Yawast

Constants

DESCRIPTION
HTTP_UA
VERSION

Public Class Methods

header() click to toggle source
# File lib/yawast.rb, line 32
def self.header
  # prevent multiple runs
  return if @header

  puts '__   _____  _    _  ___   _____ _____ '
  puts '\ \ / / _ \| |  | |/ _ \ /  ___|_   _|'
  puts ' \ V / /_\ \ |  | / /_\ \\\ `--.  | |  '
  puts '  \ /|  _  | |/\| |  _  | `--. \ | |  '
  puts '  | || | | \  /\  / | | |/\__/ / | |  '
  puts '  \_/\_| |_/\/  \/\_| |_/\____/  \_/  '
  puts ''
  puts "YAWAST v#{VERSION} - #{DESCRIPTION}"
  puts ' Copyright (c) 2013-2019 Adam Caudill <adam@adamcaudill.com>'
  puts ' Support & Documentation: https://github.com/adamcaudill/yawast'
  puts " Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}; #{OpenSSL::OPENSSL_VERSION} (#{RUBY_PLATFORM})"
  puts " Started at #{Time.now.strftime('%Y-%m-%d %H:%M:%S %Z')}"

  begin
    version = Yawast::Shared::Http.get_json(URI('https://rubygems.org/api/v1/versions/yawast/latest.json'))['version']

    if version != VERSION
      puts " Latest Version: YAWAST v#{version} is the officially supported version, please update.".blue
    end
  rescue
    # we don't care, this is a best effort check
  end

  puts ''
  @header = true
end
options() click to toggle source
# File lib/yawast.rb, line 63
def self.options
  @options
end
options=(opts) click to toggle source
# File lib/yawast.rb, line 67
def self.options=(opts)
  @options = opts
end