Sha256: 485f4d5d419adf775c31fc6a2f4b6c84dfff29bd3d74b34d161a2ffdf57a527c

Contents?: true

Size: 794 Bytes

Versions: 5

Compression:

Stored size: 794 Bytes

Contents

ComputationCarrier.class_eval do
  data_miner do
    schema Earth.database_options do
      string 'name'
      float  'power_usage_effectiveness'
    end
    
    import "a list of computation carriers and their power usage effectiveness",
           :url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdFlxZVZLai01WWJOOTFiaUd1blF6VkE&gid=0&output=csv' do
      key   'name'
      store 'power_usage_effectiveness'
    end
    
    verify "Power usage effectiveness should be one or more" do
      ComputationCarrier.all.each do |carrier|
        unless carrier.power_usage_effectiveness >= 1.0
          raise "Invalid power usage effectiveness for ComputationCarrier #{carrier.name}: #{carrier.power_usage_effectiveness} (should be >= 1.0)"
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
earth-0.5.0 lib/earth/computation/computation_carrier/data_miner.rb
earth-0.4.12 lib/earth/computation/computation_carrier/data_miner.rb
earth-0.4.11 lib/earth/computation/computation_carrier/data_miner.rb
earth-0.4.10 lib/earth/computation/computation_carrier/data_miner.rb
earth-0.4.9 lib/earth/computation/computation_carrier/data_miner.rb