Sha256: eca5c4ac4d4fbbd2c0de0e478e11537ee01356214343b204c4f89aa68c660ae7
Contents?: true
Size: 1.81 KB
Versions: 3
Compression:
Stored size: 1.81 KB
Contents
require "yaml" module Hexx module Suit module Metrics # Base class for metrics configurators # # @api private class Base # The utility class for sending commands to the system SYSTEM = Utils::System # Loads metric settings and configures the current metric # # @return [Hexx::Suit::Metrics] # the configured metric object def self.load send(:new).load end # Configures and runs the current metric # # @return (see #run) def self.run load.run end # Loads the configuration file and configures the metric # # @return [self] # # @api private def load self end # Runs the metric # # @abstract # # @return [undefined] # # @api private def run end # @note # The class has a private constructor. # Use methods {.load} or {.run}. private_class_method :new private # Extracts a hash of settings from the current file # # @return [Hash] # # @api private def settings @settings ||= file ? ::YAML.load_file(file) : {} end # Returns the name of the settings file # # @return [String] # when the file is present in the config/metrics folder # @return [nil] # when the file is absent in the config/metrics folder # # @api private def file @file ||= Dir["config/metrics/#{ name }.yml"].first end # The name of the current metric # # @abstract # # @return [Symbol] attr_reader :name 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/base.rb |
hexx-suit-0.2.1 | lib/hexx/suit/metrics/base.rb |
hexx-suit-0.2.0 | lib/hexx/suit/metrics/base.rb |