class SimpleRotate::Error

Constants

ROTATION_FAILED

Public Class Methods

argv(param, argv) click to toggle source

argument error

# File lib/simple_rotate/internal/error.rb, line 15
def self.argv(param, argv)
    msg = "'#{param}'='#{argv}' is invalid argument value!"
    self.throw_error(msg)
end
exist(name, type) click to toggle source

exist error

# File lib/simple_rotate/internal/error.rb, line 39
def self.exist(name, type)
    msg = "Already exists this #{type} => '#{name}'"
    self.throw_error(msg)
end
load(name) click to toggle source

load error

# File lib/simple_rotate/internal/error.rb, line 33
def self.load(name)
    msg = "Couldn't load a '#{name}'"
    self.throw_error(msg)
end
missing(name) click to toggle source

method missing

# File lib/simple_rotate/internal/error.rb, line 21
def self.missing(name)
    msg = "undifined method 'SimpleRotate##{name}'"
    self.throw_error(msg)
end
open(name) click to toggle source

file open error

# File lib/simple_rotate/internal/error.rb, line 27
def self.open(name)
    msg = "Couldn't open a '#{name}'"
    self.throw_error(msg)
end
silence() click to toggle source

skip warning message

# File lib/simple_rotate/internal/error.rb, line 10
def self.silence
    @@silence = true
end
throw_error(msg) click to toggle source

@param msg string

# File lib/simple_rotate/internal/error.rb, line 50
def self.throw_error(msg)
    exeption = self.new(msg)
    warn exeption.message if !@@silence
    raise SimpleRotate::Error
end
warning(msg) click to toggle source

warning - don't throw error

# File lib/simple_rotate/internal/error.rb, line 45
def self.warning(msg)
    warn "[WARNING] #{msg} - (SimpleRotate::Error)" if !@@silence
end