module Terradactyl::Common

Constants

BORDER_CHAR
COLUMN_WIDTH

Public Instance Methods

border() click to toggle source
# File lib/terradactyl/common.rb, line 30
def border
  BORDER_CHAR * COLUMN_WIDTH
end
centre() click to toggle source
# File lib/terradactyl/common.rb, line 34
def centre
  COLUMN_WIDTH / 2
end
config() click to toggle source
# File lib/terradactyl/common.rb, line 18
def config
  @config ||= ConfigProject.instance
end
cputs(msg, color) click to toggle source
# File lib/terradactyl/common.rb, line 89
def cputs(msg, color)
  puts config.misc.disable_color ? msg : msg.send(color.to_s)
end
dot_icon() click to toggle source
# File lib/terradactyl/common.rb, line 38
def dot_icon
  config.misc.utf8 ? '•' : '*'
end
print_content(content) click to toggle source
print_crit(msg) click to toggle source
print_dot(msg, color = :light_blue) click to toggle source
print_header(msg, color = :blue) click to toggle source
print_line(msg, color = :light_blue) click to toggle source
print_message(msg, color = :light_blue) click to toggle source
print_ok(msg) click to toggle source
print_warning(msg) click to toggle source
required_versions_re() click to toggle source
# File lib/terradactyl/common.rb, line 10
def required_versions_re
  /(?<assignment>(?:\n\s)*required_version\s+=\s+)(?<value>".*?")/m
end
stack_icon() click to toggle source
# File lib/terradactyl/common.rb, line 42
def stack_icon
  config.misc.utf8 ? '  𝓣  ' : '  |||  '
end
supported_revisions() click to toggle source
# File lib/terradactyl/common.rb, line 14
def supported_revisions
  Terradactyl::Commands.constants.select { |c| c =~ /Rev/ }.sort
end
tag() click to toggle source
# File lib/terradactyl/common.rb, line 26
def tag
  'Terradactyl'
end
terraform_binary() click to toggle source
# File lib/terradactyl/common.rb, line 22
def terraform_binary
  config.terraform.binary || %(terraform)
end