Sha256: b9113f965266fdcce09db9211880de96be4fb1965ec41c3d81b55de0221c8f68

Contents?: true

Size: 980 Bytes

Versions: 5

Compression:

Stored size: 980 Bytes

Contents

require 'capistrano/cli'

module CapUtil

  def self.color(*args)
    Capistrano::CLI.ui.color(*args)
  end

  def self.say(msg, *args)
    Capistrano::CLI.ui.say("    #{msg}", *args)
  end

  def self.say_bulleted(msg, *args)
    Capistrano::CLI.ui.say("  * #{msg}", *args)
  end

  def self.say_error(msg, *args)
    say("#{color "[ERROR]", :bold, :red} #{msg}", *args)
  end

  def self.say_warning(msg, *args)
    say("#{color "[WARN]", :bold, :yellow} #{msg}", *args)
  end

  module Say

    def self.included(receiver)
      receiver.send(:extend,  SayMethods)
      receiver.send(:include, SayMethods)
    end

    module SayMethods
      def color(*args);        CapUtil.color(*args);        end
      def say(*args);          CapUtil.say(*args);          end
      def say_bulleted(*args); CapUtil.say_bulleted(*args); end
      def say_error(*args);    CapUtil.say_error(*args);    end
      def say_warning(*args);  CapUtil.say_warning(*args);  end
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cap-util-1.0.1 lib/cap-util/say.rb
cap-util-1.0.0 lib/cap-util/say.rb
cap-util-1.0.0.rc1 lib/cap-util/say.rb
cap-util-0.4.0 lib/cap-util/say.rb
cap-util-0.3.0 lib/cap-util/say.rb