Sha256: 24d9c5239fa6317f556f0f63d2a907549dcf84029dd4e040f44a4cbd98db52f9

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

Contents

require 'fileutils'

class AwesomeTemplate < MetricFu::Template

  def write
    # Getting rid of the crap before and after the project name from integrity
    @name = File.basename(Dir.pwd).gsub(/^\w+-|-\w+$/, "")

    # Copy Bluff javascripts to output directory
    Dir[File.join(this_directory, '..', 'javascripts', '*')].each do |f|
      FileUtils.copy(f, File.join(MetricFu.output_directory, File.basename(f)))
    end

    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

14 entries across 14 versions & 6 rubygems

Version Path
goldstar-metric_fu-1.5.1.2 lib/templates/awesome/awesome_template.rb
metric_fu-2.0.1 lib/templates/awesome/awesome_template.rb
metric_fu-2.0.0 lib/templates/awesome/awesome_template.rb
goldstar-metric_fu-1.5.1.1 lib/templates/awesome/awesome_template.rb
metric_fu-1.5.1 lib/templates/awesome/awesome_template.rb
metric_fu-1.5.0 lib/templates/awesome/awesome_template.rb
metric_fu-1.4.0 lib/templates/awesome/awesome_template.rb
cdd-metric_fu-1.3.1 lib/templates/awesome/awesome_template.rb
devver-metric_fu-1.3.3 lib/templates/awesome/awesome_template.rb
nielsm-metric_fu-1.3.1 lib/templates/awesome/awesome_template.rb
metric_fu-1.3.0 lib/templates/awesome/awesome_template.rb
edouard-metric_fu-1.2.1 lib/templates/awesome/awesome_template.rb
edouard-metric_fu-1.2.0 lib/templates/awesome/awesome_template.rb
metric_fu-1.2.0 lib/templates/awesome/awesome_template.rb