Commit 1715bf35 authored by Lucas Nussbaum's avatar Lucas Nussbaum
Browse files

Reorganize code to avoid duplicate requires

parent e0823063
require_relative '../lib/input_loader'
require_relative './wiki_generator'
require_relative './mw_utils'
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'wiki_generator'
class CPUParametersGenerator < WikiGenerator
......
# coding: utf-8
require_relative '../lib/input_loader'
require_relative './wiki_generator'
require_relative './mw_utils'
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'wiki_generator'
class DiskReservationGenerator < WikiGenerator
......
# coding: utf-8
require 'pp'
require_relative '../lib/input_loader'
require_relative './wiki_generator'
require_relative './mw_utils'
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'wiki_generator'
require_relative './site_hardware.rb'
class G5KHardwareGenerator < WikiGenerator
......
......@@ -5,7 +5,10 @@ require 'net/http'
require 'net/https'
require 'mediawiki_api'
require_relative "../lib/input_loader"
# also add generators/lib to load path
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '../../lib')))
require 'input_loader'
#Adding method to mediawiki_api client
module MediawikiApi
......@@ -109,7 +112,7 @@ module G5K
@@global_hash = nil
def self.get_global_hash
if @@global_hash.nil?
@@global_hash = load_yaml_file_hierarchy(File.expand_path("../../input/grid5000/", File.dirname(__FILE__)))
@@global_hash = load_yaml_file_hierarchy(File.expand_path("../../../input/grid5000/", File.dirname(__FILE__)))
end
# return a deep copy of global_hash
return Marshal.load(Marshal.dump(@@global_hash))
......
# also add generators/lib to load path
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '../../lib')))
require 'input_loader'
require "optparse"
require "mediawiki_api"
require "diffy"
require_relative "./mw_utils"
require "mw_utils"
class WikiGenerator
......
# coding: utf-8
require 'pp'
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'wiki_generator'
require_relative '../lib/input_loader'
require_relative '../oar-properties/lib/lib-oar-properties'
require_relative './wiki_generator'
require_relative './mw_utils'
class OarPropertiesGenerator < WikiGenerator
......
# coding: utf-8
require 'optparse'
require 'date'
require 'pp'
require_relative '../lib/input_loader'
require_relative './wiki_generator'
require_relative './mw_utils'
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'wiki_generator'
class SiteHardwareGenerator < WikiGenerator
......
# coding: utf-8
require 'pp'
require_relative './site_hardware.rb'
require_relative './mw_utils.rb'
pp get_hardware(G5K::SITES)
# coding: utf-8
require 'optparse'
require 'date'
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'wiki_generator'
require_relative '../lib/input_loader'
require_relative './wiki_generator'
require_relative './mw_utils'
require_relative '../input-validators/check-network-description'
# This class generates the network description of each site, in .dot
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment