Module: IsReviewable

Extended by:
IsReviewable
Included in:
IsReviewable
Defined in:
lib/is_reviewable.rb,
lib/is_reviewable/review.rb,
lib/is_reviewable/support.rb,
lib/is_reviewable/reviewer.rb,
lib/is_reviewable/reviewable.rb

Defined Under Namespace

Modules: Reviewable, Reviewer, Support Classes: IsReviewableError, Review

Constant Summary collapse

InvalidConfigValueError =
::Class.new(IsReviewableError)
InvalidReviewerError =
::Class.new(IsReviewableError)
InvalidReviewValueError =
::Class.new(IsReviewableError)
RecordError =
::Class.new(IsReviewableError)
@@verbose =
::Object.const_defined?(:RAILS_ENV) ? (::RAILS_ENV.to_sym == :development) : true

Instance Method Summary collapse

Instance Method Details

#log(message, level = :info) ⇒ Object


27
28
29
30
31
32
# File 'lib/is_reviewable.rb', line 27

def log(message, level = :info)
  return unless @@verbose
  level = :info if level.blank?
  @@logger ||= ::Logger.new(::STDOUT)
  @@logger.send(level.to_sym, message)
end

#rootObject


34
35
36
# File 'lib/is_reviewable.rb', line 34

def root
  @@root ||= File.expand_path(File.join(File.dirname(__FILE__), *%w[..]))
end