File: flay.rb

package info (click to toggle)
ruby-hoe 3.12.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 380 kB
  • ctags: 222
  • sloc: ruby: 1,929; makefile: 10
file content (32 lines) | stat: -rw-r--r-- 576 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
##
# Flay plugin for hoe.
#
# === Tasks Provided:
#
# flay::               Analyze for code duplication.

module Hoe::Flay
  ##
  # Optional: flay threshold to determine threshold failure. [default: 1200-100]

  attr_accessor :flay_threshold

  ##
  # Initialize variables for plugin.

  def initialize_flay
    self.flay_threshold ||= timebomb 1200, 100  # 80% of average :(
  end

  ##
  # Define tasks for plugin.

  def define_flay_tasks
    begin
      require 'flay_task'
      FlayTask.new :flay, self.flay_threshold
    rescue Exception
      # skip
    end
  end
end