Sha256: 57761407ffe55dbb275f066ca604ba78a67ecf2a01f344b2aa1b12247928d0b8
Contents?: true
Size: 499 Bytes
Versions: 13
Compression:
Stored size: 499 Bytes
Contents
require 'forwardable' require 'cl/config' require 'cl/ui' class Cl class Ctx extend Forwardable def_delegators :ui, :puts, :stdout, :announce, :info, :notice, :warn, :error, :success, :cmd attr_accessor :config, :ui def initialize(name, opts = {}) @config = Config.new(name).to_h @ui = Ui.new(self, opts) end def abort(str) fail(str) if test? ui.error(str) exit 1 end def test? ENV['ENV'] == 'test' end end end
Version data entries
13 entries across 13 versions & 1 rubygems