Sha256: 6e02dd692eb33e4422844c1bba3515cebe8688d98c91b6cfbf5e760b3548b853

Contents?: true

Size: 966 Bytes

Versions: 3

Compression:

Stored size: 966 Bytes

Contents

class AwesomeTemplate < MetricFu::Template

  def write
    # Getting rid of the crap before and after the project name from integrity
    dir = MetricFu.configuration.is_cruise_control_rb? ? File.join(Dir.pwd, '..') : Dir.pwd
    @name =  File.basename(File.expand_path(dir)).gsub(/^\w+-|-\w+$/, "")

    report.each_pair do |section, contents|
      if template_exists?(section)
        create_instance_var(section, contents)
        @html = erbify(section)
        html = erbify('layout')
        fn = output_filename(section)
        MetricFu.report.save_output(html, MetricFu.output_directory, fn)
      end
    end

    # Instance variables we need should already be created from above
    if template_exists?('index')
      @html = erbify('index')
      html = erbify('layout')
      fn = output_filename('index')
      MetricFu.report.save_output(html, MetricFu.output_directory, fn)
    end
  end

  def this_directory
    File.dirname(__FILE__)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kjeldahl-metric_fu-1.1.5.2 lib/templates/awesome/awesome_template.rb
kjeldahl-metric_fu-1.1.5.3 lib/templates/awesome/awesome_template.rb
kjeldahl-metric_fu-1.1.5.4 lib/templates/awesome/awesome_template.rb