Sha256: bcd992060e11c60393a5c5a1c95860d789a6ada374254dc3bb3c0f162716b0fd

Contents?: true

Size: 1.79 KB

Versions: 32

Compression:

Stored size: 1.79 KB

Contents

module Inch
  module Language
    module Ruby
      module Evaluation
        # Base class for all Ruby related evaluations
        #
        # @abstract
        class Base < Inch::Evaluation::Proxy
          protected

          def relevant_base_roles
            {
              Role::Object::InRoot => nil,
              Role::Object::Public => nil,
              Role::Object::Protected => nil,
              Role::Object::Private => nil,
              Role::Object::TaggedAsNodoc => nil,
              Role::Object::WithDoc => score_for(:docstring),
              Role::Object::WithoutDoc => score_for(:docstring),
              Role::Object::WithCodeExample => score_for(:code_example_single),
              Role::Object::WithMultipleCodeExamples =>
                score_for(:code_example_multi),
              Role::Object::WithoutCodeExample =>
                score_for(:code_example_single),
              Role::Object::Tagged => score_for_unconsidered_tags,
              Role::Object::TaggedAsAPI => nil,
              Role::Object::TaggedAsInternalAPI => nil,
              Role::Object::TaggedAsPrivate => nil,
              Role::Object::Alias =>
                if object.alias?
                  aliased_object = object.aliased_object
                  if aliased_object.alias? && aliased_object.aliased_object.alias?
                    # warn "Possible alias cycle: #{object.fullname} -> #{aliased_object.fullname}"
                    nil
                  else
                    aliased_object.score
                  end
                else
                  nil
                end
            }
          end

          def score_for_unconsidered_tags
            count = object.unconsidered_tag_count
            score_for(:unconsidered_tag) * count
          end
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
inch-0.9.0.rc1 lib/inch/language/ruby/evaluation/base.rb
inch-0.8.0 lib/inch/language/ruby/evaluation/base.rb
inch-0.8.0.rc2 lib/inch/language/ruby/evaluation/base.rb
inch-0.8.0.rc1 lib/inch/language/ruby/evaluation/base.rb
inch-0.7.1 lib/inch/language/ruby/evaluation/base.rb
inch-0.7.0 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.4 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.3 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.2 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.1 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.0 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.0.rc6 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.0.rc5 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.0.rc4 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.0.rc3 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.0.rc2 lib/inch/language/ruby/evaluation/base.rb
inch-0.6.0.rc1 lib/inch/language/ruby/evaluation/base.rb
inch-0.5.10 lib/inch/language/ruby/evaluation/base.rb
inch-0.5.9 lib/inch/language/ruby/evaluation/base.rb
inch-0.5.8 lib/inch/language/ruby/evaluation/base.rb