Sha256: afd611d1e063ae51e66cc97f8d72276dffebd2c371a8e47733fad7eb419a7c58
Contents?: true
Size: 1.83 KB
Versions: 3
Compression:
Stored size: 1.83 KB
Contents
module Hexx module Suit module Metrics # Prepares and runs yardstick environment from '.hexx-suit.yml' class Yardstick < Base # Loads yardstick verifier # # @return [Hexx::Suit::Metrics::Yardstick] # # @api private def self.new require "yardstick/rake/measurement" super end # @!scope class # Prepares output for the yardstick and sets the YARDSTICK_OUTPUT env # # @return [self] def load prepare_output set_environment super end # @!scope class # Runs yardstick with options from '.hexx-suit.yml' # # @return [undefined] def run measurement.yardstick_measure end private # yardstic metric definitions def name "yardstick" end def default_options { "output" => "tmp/yardstick/output.log", "path" => "lib/**/*.rb" } end def metric ::Yardstick::Rake::Measurement end # operations def prepare_output SYSTEM.call %( mkdir #{ ::File.dirname(output) } -p touch #{ output } ) end def set_environment ENV["YARDSTICK_OUTPUT"] = output end # helpers def measurement metric.new(:yardstick_measure, options) do |config| config.output = output end end def options @options ||= begin list = default_options.merge settings.to_hash list["path"] = Array(list["path"]).join(" ") list end end def output @output ||= options["output"] end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
hexx-suit-0.2.2 | lib/hexx/suit/metrics/yardstick.rb |
hexx-suit-0.2.1 | lib/hexx/suit/metrics/yardstick.rb |
hexx-suit-0.2.0 | lib/hexx/suit/metrics/yardstick.rb |