Sha256: db1c77655093d499920f250f8f4fbd19ce4882f3eafbb2c1c5df9c87ac31c083

Contents?: true

Size: 674 Bytes

Versions: 27

Compression:

Stored size: 674 Bytes

Contents

require "thor"

module Berkshelf
  # Subclass the current shell (which is different based on the OS)
  Shell = Class.new(Thor::Base.shell) do
    # 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(*args)
      return if quiet?
      super(*args)
    end
    alias_method :info, :say

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

    def error(message, color = :red)
      message = set_color(message, *color) if color
      super(message)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
berkshelf-7.0.8 lib/berkshelf/shell.rb
berkshelf-7.0.7 lib/berkshelf/shell.rb
berkshelf-6.3.4 lib/berkshelf/shell.rb
berkshelf-7.0.6 lib/berkshelf/shell.rb
berkshelf-7.0.5 lib/berkshelf/shell.rb
berkshelf-6.3.3 lib/berkshelf/shell.rb
berkshelf-7.0.4 lib/berkshelf/shell.rb
berkshelf-7.0.3 lib/berkshelf/shell.rb
berkshelf-7.0.2 lib/berkshelf/shell.rb
berkshelf-7.0.1 lib/berkshelf/shell.rb
berkshelf-7.0.0 lib/berkshelf/shell.rb
berkshelf-6.3.2 lib/berkshelf/shell.rb
berkshelf-6.3.1 lib/berkshelf/shell.rb
berkshelf-6.3.0 lib/berkshelf/shell.rb
berkshelf-6.2.2 lib/berkshelf/shell.rb
berkshelf-6.2.1 lib/berkshelf/shell.rb
berkshelf-6.2.0 lib/berkshelf/shell.rb
berkshelf-6.1.1 lib/berkshelf/shell.rb
berkshelf-6.1.0 lib/berkshelf/shell.rb
berkshelf-6.0.1 lib/berkshelf/shell.rb