Class: D2::Utils::Formatter::SimpleFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/d2/utils/formatter.rb

Class Method Summary collapse

Class Method Details

.info(msg) ⇒ Object



19
20
21
22
# File 'lib/d2/utils/formatter.rb', line 19

def self.info(msg)
  return if ENV['ENVIRONMENT'] == 'test'
  puts CLI::UI.fmt(msg)
end

.with_frame(*kwargs) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/d2/utils/formatter.rb', line 24

def self.with_frame(*kwargs)
  if ENV['ENVIRONMENT'] == 'test'
    yield
    return
  end

  CLI::UI::Frame.open(*kwargs) do
    yield
  end
end