Sha256: f358643767a78c61b3985df5bdd1851e1495f23d472dddbe18abc1fa8a5b71ce

Contents?: true

Size: 718 Bytes

Versions: 34

Compression:

Stored size: 718 Bytes

Contents

class Mothership
  class Error < RuntimeError
  end

  class MissingArgument < Error
    def initialize(cmd, arg)
      @command = cmd
      @argument = arg
    end

    def to_s
      "#{@command.display_name}: missing input '#{@argument}'"
    end
  end

  class ExtraArguments < Error
    def initialize(cmd, extra)
      @command = cmd
      @extra = extra
    end

    def to_s
      "#{@command.display_name}: too many arguments; extra: #{@extra.join(" ")}"
    end
  end

  class TypeMismatch < Error
    def initialize(cmd, input, type)
      @command = cmd
      @input = input
      @type = type
    end

    def to_s
      "#{@command.display_name}: expected #{@type} value for #{@input}"
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
cloulu-1.0.0 lib/mothership/errors.rb
cloulu-0.7.0 lib/mothership/errors.rb
cloulu-0.6.6 lib/mothership/errors.rb
cloulu-0.6.5 lib/mothership/errors.rb
cloulu-0.6.1 lib/mothership/errors.rb
cloulu-0.6.0 lib/mothership/errors.rb
cloulu-0.5.1 lib/mothership/errors.rb
cloulu-0.5.0 lib/mothership/errors.rb
cloulu-0.3.0 lib/mothership/errors.rb
cloulu-0.2.6 lib/mothership/errors.rb
cloulu-0.2.5 lib/mothership/errors.rb
cloulu-0.2.4 lib/mothership/errors.rb
cloulu-0.2.3 lib/mothership/errors.rb
cloulu-0.2.1 lib/mothership/errors.rb
cloulu-0.2.0 lib/mothership/errors.rb
cloulu-0.1.6 lib/mothership/errors.rb
cloulu-0.1.5 lib/mothership/errors.rb
cloulu-0.1.2 lib/mothership/errors.rb
cloulu-0.1.1 lib/mothership/errors.rb
mothership-0.5.1 lib/mothership/errors.rb