Sha256: 80829a6289eed5dffc2060431861903b1fbb5213995fecb11853b474090f2868

Contents?: true

Size: 674 Bytes

Versions: 29

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

29 entries across 29 versions & 1 rubygems

Version Path
berkshelf-5.5.0 lib/berkshelf/shell.rb
berkshelf-5.4.0 lib/berkshelf/shell.rb
berkshelf-5.3.0 lib/berkshelf/shell.rb
berkshelf-5.2.0 lib/berkshelf/shell.rb
berkshelf-5.1.0 lib/berkshelf/shell.rb
berkshelf-5.0.0 lib/berkshelf/shell.rb
berkshelf-4.3.5 lib/berkshelf/shell.rb
berkshelf-4.3.3 lib/berkshelf/shell.rb
berkshelf-4.3.2 lib/berkshelf/shell.rb
berkshelf-4.3.1 lib/berkshelf/shell.rb
berkshelf-4.3.0 lib/berkshelf/shell.rb
berkshelf-4.2.3 lib/berkshelf/shell.rb
berkshelf-4.2.2 lib/berkshelf/shell.rb
berkshelf-4.2.1 lib/berkshelf/shell.rb
berkshelf-4.2.0 lib/berkshelf/shell.rb
berkshelf-4.1.1 lib/berkshelf/shell.rb
berkshelf-4.1.0 lib/berkshelf/shell.rb
berkshelf-4.0.1 lib/berkshelf/shell.rb
berkshelf-4.0.0 lib/berkshelf/shell.rb
berkshelf-3.3.0 lib/berkshelf/shell.rb