Class: AbideDevUtils::Sce::BenchmarkLoader::PupMod
- Inherits:
 - 
      Object
      
        
- Object
 - AbideDevUtils::Sce::BenchmarkLoader::PupMod
 
 
- Defined in:
 - lib/abide_dev_utils/sce/benchmark_loader.rb
 
Overview
Loads benchmark data for a Puppet module
Instance Attribute Summary collapse
- 
  
    
      #ignore_all_errors  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute ignore_all_errors.
 - 
  
    
      #ignore_framework_mismatch  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute ignore_framework_mismatch.
 - 
  
    
      #load_errors  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute load_errors.
 - 
  
    
      #load_warnings  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute load_warnings.
 - 
  
    
      #pupmod  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute pupmod.
 
Instance Method Summary collapse
- 
  
    
      #initialize(module_dir = Dir.pwd, **opts)  ⇒ PupMod 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of PupMod.
 - 
  
    
      #load  ⇒ Array<AbideDevUtils::Sce::Benchmark> 
    
    
  
  
  
  
  
  
  
  
  
    
Load the benchmark from the Puppet module.
 
Constructor Details
#initialize(module_dir = Dir.pwd, **opts) ⇒ PupMod
Returns a new instance of PupMod.
      24 25 26 27 28 29 30  | 
    
      # File 'lib/abide_dev_utils/sce/benchmark_loader.rb', line 24 def initialize(module_dir = Dir.pwd, **opts) @pupmod = AbideDevUtils::Ppt::PuppetModule.new(module_dir) @load_errors = [] @load_warnings = [] @ignore_all_errors = opts.fetch(:ignore_all_errors, false) @ignore_framework_mismatch = opts.fetch(:ignore_framework_mismatch, false) end  | 
  
Instance Attribute Details
#ignore_all_errors ⇒ Object (readonly)
Returns the value of attribute ignore_all_errors.
      22 23 24  | 
    
      # File 'lib/abide_dev_utils/sce/benchmark_loader.rb', line 22 def ignore_all_errors @ignore_all_errors end  | 
  
#ignore_framework_mismatch ⇒ Object (readonly)
Returns the value of attribute ignore_framework_mismatch.
      22 23 24  | 
    
      # File 'lib/abide_dev_utils/sce/benchmark_loader.rb', line 22 def ignore_framework_mismatch @ignore_framework_mismatch end  | 
  
#load_errors ⇒ Object (readonly)
Returns the value of attribute load_errors.
      22 23 24  | 
    
      # File 'lib/abide_dev_utils/sce/benchmark_loader.rb', line 22 def load_errors @load_errors end  | 
  
#load_warnings ⇒ Object (readonly)
Returns the value of attribute load_warnings.
      22 23 24  | 
    
      # File 'lib/abide_dev_utils/sce/benchmark_loader.rb', line 22 def load_warnings @load_warnings end  | 
  
#pupmod ⇒ Object (readonly)
Returns the value of attribute pupmod.
      22 23 24  | 
    
      # File 'lib/abide_dev_utils/sce/benchmark_loader.rb', line 22 def pupmod @pupmod end  | 
  
Instance Method Details
#load ⇒ Array<AbideDevUtils::Sce::Benchmark>
Load the benchmark from the Puppet module
      35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56  | 
    
      # File 'lib/abide_dev_utils/sce/benchmark_loader.rb', line 35 def load clear_load_errors clear_load_warnings pupmod.supported_os.each_with_object([]) do |supp_os, ary| osname, majver = supp_os.split('::') if majver.is_a?(Array) majver.sort.each do |v| frameworks.each do |fw| ary << new_benchmark(osname, v, fw) rescue StandardError => e handle_load_error(e, fw, osname, v, pupmod.name(strip_namespace: true)) end end else frameworks.each do |fw| ary << new_benchmark(osname, majver, fw) rescue StandardError => e handle_load_error(e, fw, osname, majver, pupmod.name(strip_namespace: true)) end end end end  |