Sha256: f62d116f52bb8848a23e131d3351cd0e857e1c17dd762b5a9b8b55616e2570f7

Contents?: true

Size: 810 Bytes

Versions: 8

Compression:

Stored size: 810 Bytes

Contents

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
earth-0.4.4 lib/earth/computation/data_center_company/data_miner.rb
earth-0.4.3 lib/earth/computation/data_center_company/data_miner.rb
earth-0.4.2 lib/earth/computation/data_center_company/data_miner.rb
earth-0.4.1 lib/earth/computation/data_center_company/data_miner.rb
earth-0.4.0 lib/earth/computation/data_center_company/data_miner.rb
earth-0.3.15 lib/earth/computation/data_center_company/data_miner.rb
earth-0.3.14 lib/earth/computation/data_center_company/data_miner.rb
earth-0.3.13 lib/earth/computation/data_center_company/data_miner.rb