lib/hem/errors.rb in hem-1.0.1.beta6 vs lib/hem/errors.rb in hem-1.1.0

- old
+ new

@@ -1,9 +1,22 @@ module Hem class Error < StandardError attr_reader :exit_code end + + class HemVersionError < Error + def initialize requirements + super(" +This Hem project has specified that it requires the Hem +version to satisfy the following version requirements: + #{requirements.join("\n")} +You are running Hem #{VERSION}, which does not satisfy +these requirements. Please upgrade Hem to the latest +version, or relax the Hemfile's version constraints if +you're already using the latest Hem version.") + end + end class RubyVersionError < Error def initialize super("Ruby 1.9+ is required to run hem") end @@ -15,28 +28,32 @@ super("Hem requires the following commands to be available on your path:\n\n" + deps.join("\n")) end end class InvalidCommandOrOpt < Error - attr_accessor :command, :cli - def initialize command, cli = nil + attr_accessor :command + def initialize command @command = command - @cli = cli super("Invalid command or option specified: '#{command}'") end end class MissingArgumentsError < Error - attr_accessor :command, :cli - def initialize command, args, cli = nil + attr_accessor :command + def initialize command, args @command = command @args = args - @cli = cli super("Not enough arguments for #{command}") end end + class PluginsAlreadySetupError < Error + def initialize + super("Hem's plugins have already been set up. Additional plugins can't be defined after.") + end + end + class ExternalCommandError < Error attr_accessor :command, :exit_code, :output def initialize command, exit_code, output @command = command @@ -77,13 +94,7 @@ class UndefinedEditorError < Error def initialize super('You need to define a preferred editor, either in your hem config or with the EDITOR environment variable') end - end - - class GithubAuthenticationError < Error - end - - class GithubApiError < Error end end