Sha256: a1f7d87422f69a4789911015cdc73cb3dff99e6ae026db0047805bb362a9df1c

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

require 'thor/util'
require 'thor/actions'


module StacksOnDeck

  # Mixins for StacksOnDeck's Thor subclasses.
  module Helpers

    # Save the canonical implementation of "puts"
    alias_method :old_puts, :puts

    # Monkeypatch puts to support Thor::Shell::Color.
    def puts *args
      return old_puts if args.empty?
      old_puts shell.set_color(*args)
    end


    # Shortcut for Thor::Util.
    def util ; Thor::Util end


    # Shortcut for Thor::Actions.
    def actions ; Thor::Actions end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stacksondeck-0.0.1 lib/stacksondeck/helpers.rb