Sha256: 7c95facd891e8be923625f47c54e17e803608adb9966d70daa111e57f58362b9

Contents?: true

Size: 679 Bytes

Versions: 13

Compression:

Stored size: 679 Bytes

Contents

class Mothership
  class Error < RuntimeError
  end

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

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

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

    def to_s
      "#{@command}: 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}: expected #{@type} value for #{@input}"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mothership-0.1.5 lib/mothership/errors.rb
mothership-0.1.4 lib/mothership/errors.rb
mothership-0.1.3 lib/mothership/errors.rb
mothership-0.1.2 lib/mothership/errors.rb
mothership-0.1.1 lib/mothership/errors.rb
mothership-0.1.0 lib/mothership/errors.rb
mothership-0.0.15 lib/mothership/errors.rb
mothership-0.0.14 lib/mothership/errors.rb
mothership-0.0.13 lib/mothership/errors.rb
mothership-0.0.12 lib/mothership/errors.rb
mothership-0.0.11 lib/mothership/errors.rb
mothership-0.0.10 lib/mothership/errors.rb
mothership-0.0.9 lib/mothership/errors.rb