Sha256: 04ccc312c13dc6f80892210167f65fa74b7f90c1cf5e74657fafda31e3039bb3

Contents?: true

Size: 1.05 KB

Versions: 30

Compression:

Stored size: 1.05 KB

Contents

require 'colorize'

module Ey
  module Core
    module Cli
      module Helpers
        module Deprecated
        # Class-level helpers pulled into an including class
          module ClassMethods

            # A helper for deprecating a Belafonte-based command
            #
            # @param deprecated_title [String] the title of the command
            #
            # @return [NilClass] this method is not expected to return a value
            def deprecate(deprecated_title)
              title deprecated_title
              summary 'This command has been deprecated'
              description <<-DESCRIPTION
The #{meta[:title]} command has been deprecated. We apologize for any inconvenience.
DESCRIPTION
            end
          end

          # Module magic
          # @api private
          def self.included(base)
            base.extend(ClassMethods)
          end

          # Terminate the deprecated command with a message
          def handle
            abort "This command is deprecated".red
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.6.4 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.6.3 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.6.1 lib/ey-core/cli/helpers/deprecated.rb
groove-ey-core-3.6.3 lib/ey-core/cli/helpers/deprecated.rb
groove-ey-core-3.6.2 lib/ey-core/cli/helpers/deprecated.rb
groove-ey-core-3.6.1 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.5.0 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.4.4 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.4.2 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.4.1 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.4.0 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.3.1 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.3.0 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.2.6 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.2.5 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.2.4 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.2.3 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.2.2 lib/ey-core/cli/helpers/deprecated.rb
ey-core-3.2.1 lib/ey-core/cli/helpers/deprecated.rb