Module: GemsBond::Examination

Included in:
Gem
Defined in:
lib/gems_bond/examination.rb

Overview

Examines gem sanity

Constant Summary collapse

SCORES =
YAML.safe_load(File.read(File.join(File.dirname(__FILE__), "scores.yml")))
BOUNDARIES =
SCORES["boundaries"]
RESULTS =
SCORES["results"]

Instance Method Summary collapse

Instance Method Details

#activity_scoreInteger?

Returns activity score

Returns:

  • (Integer, nil)

    in [0, 1] (memoized)



# File 'lib/gems_bond/examination.rb', line 12

#average_scoreInteger?

Returns average score

Returns:

  • (Integer, nil)

    in [0, 1] (memoized)



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/gems_bond/examination.rb', line 23

RESULTS.each do |result, values|
  define_method("#{result}_score") do
    memoize("#{result}_score") do
      weighted_average(
        values.map do |key, weighting|
          [__send__("#{key}_score"), weighting]
        end
      )
    end
  end
end

#popularity_scoreInteger?

Returns popularity score

Returns:

  • (Integer, nil)

    in [0, 1] (memoized)



# File 'lib/gems_bond/examination.rb', line 16