Sha256: c423dc0c335433b52f42474278dcf37a4e6598470e17ae262d9241ab7f1ba503
Contents?: true
Size: 950 Bytes
Versions: 2
Compression:
Stored size: 950 Bytes
Contents
module StatusCat module Checkers class Base extend ActiveSupport::DescendantsTracker FORMAT = "%s | %s | %s\n".freeze attr_reader :value, :status def self.class_to_name(klass) klass.to_s.split('::').last.underscore.to_sym end def name Base.class_to_name(self.class) # self.class.to_s.split('::').last.underscore.to_sym end def to_s(format = FORMAT) format(format, name, value, status || I18n.t(:ok, scope: :status_cat)) end protected # rubocop:disable Lint/RescueException def fail_on_exception begin return yield rescue Exception => e return e end return nil end # rubocop:enable Lint/RescueException def gem_missing?(gem, present) return false if present @status = "#{gem} gem is not installed" return true end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
status_cat-5.2.1 | lib/status_cat/checkers/base.rb |
status_cat-5.2.0 | lib/status_cat/checkers/base.rb |