Sha256: d6c34a59d2bc4b9757dce5e74c1ed7a287da45f74ff77f5548fd5c7c4c322a6c

Contents?: true

Size: 926 Bytes

Versions: 15

Compression:

Stored size: 926 Bytes

Contents

module MotherBrain
  module Cli
    module Shell
      module Ext
        class << self
          def included(base)
            base.send(:include, ClassMethods)
            base.extend(ClassMethods)
          end
        end

        module ClassMethods
          # Mute the output of this instance of UI until {#unmute!} is called
          def mute!
            @mute = true
          end

          # Unmute the output of this instance of UI until {#mute!} is called
          def unmute!
            @mute = false
          end

          def say(message = "", color = nil, force_new_line = nil)
            return if quiet?

            super(message, color)
          end
          alias_method :info, :say

          def warn(message)
            say(message, :yellow)
          end

          def deprecated(message)
            warn("[DEPRECATION] #{message}")
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
motherbrain-1.5.0 lib/mb/cli/shell/ext.rb
motherbrain-1.4.0 lib/mb/cli/shell/ext.rb
motherbrain-1.3.0 lib/mb/cli/shell/ext.rb
motherbrain-1.2.1 lib/mb/cli/shell/ext.rb
motherbrain-1.2.0 lib/mb/cli/shell/ext.rb
motherbrain-1.1.3 lib/mb/cli/shell/ext.rb
motherbrain-1.1.2 lib/mb/cli/shell/ext.rb
motherbrain-1.1.1 lib/mb/cli/shell/ext.rb
motherbrain-1.1.0 lib/mb/cli/shell/ext.rb
motherbrain-1.0.0 lib/mb/cli/shell/ext.rb
motherbrain-0.14.5 lib/mb/cli/shell/ext.rb
motherbrain-0.14.4 lib/mb/cli/shell/ext.rb
motherbrain-0.14.3 lib/mb/cli/shell/ext.rb
motherbrain-0.14.2 lib/mb/cli/shell/ext.rb
motherbrain-0.13.1 lib/mb/cli/shell/ext.rb