Sha256: 22a974a83f6446089b24930e4e209ad47f78e83173b5cb0301ceb6192920c7b5

Contents?: true

Size: 750 Bytes

Versions: 4

Compression:

Stored size: 750 Bytes

Contents

module Hanami
  class CLI
    # @since 0.2.0
    class Error < StandardError
    end

    # @since 0.2.0
    class UnkwnownCommandError < Error
      # @since 0.2.0
      # @api private
      def initialize(command_name)
        super("unknown command: `#{command_name}'")
      end
    end

    # @since 0.2.0
    class InvalidCallbackError < Error
      # @since 0.2.0
      # @api private
      def initialize(callback)
        message = case callback
                  when Class
                    "expected `#{callback.inspect}' to respond to `#initialize' with arity 0"
                  else
                    "expected `#{callback.inspect}' to respond to `#call'"
                  end

        super(message)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hanami-cli-0.2.0 lib/hanami/cli/errors.rb
hanami-cli-0.2.0.rc2 lib/hanami/cli/errors.rb
hanami-cli-0.2.0.rc1 lib/hanami/cli/errors.rb
hanami-cli-0.2.0.beta2 lib/hanami/cli/errors.rb