module Defcli

Public Class Methods

format_results(results, color = true) click to toggle source

Format results for output @param results [Array] array of results @param color [Boolean] colored output @return [String]

# File lib/defcli.rb, line 18
def format_results(results, color = true)
  Defcli::Formatting.format_results(results, color)
end
open_in_browser(url) click to toggle source
# File lib/defcli.rb, line 26
def open_in_browser(url)
  system open_cmd, url
end
read_url(url) click to toggle source
# File lib/defcli.rb, line 22
def read_url(url)
  OpenURI.open_uri(url).read
end
version() click to toggle source
# File lib/defcli.rb, line 10
def version
  "0.0.1"
end

Private Class Methods

open_cmd() click to toggle source
# File lib/defcli.rb, line 32
def open_cmd
  case RbConfig::CONFIG["host_os"]
  when /darwin/
    "open"
  when /bsd|linux/
    "xdg-open"
  when /cygwin|mingw|mswin/
    "start"
  end
end