lib/origen/site_config.rb
# Forces a reparse of the site configs.
# This will set the configs along the current path first,
# then, using those values, will add a site config at the home directory.
Forces a reparse of the site configs.
This will set the configs along the current path first,
then, using those values, will add a site config at the home directory.
Forces a reparse of the site configs . This will set the configs along the current path first then using those values will add a site config at the home directory .
def configs!
      path = $_origen_invocation_pwd
      @configs = []
      until path.root?
        load_directory(path)
        path = path.parent
      end
      path = Pathname.new($LOAD_PATH.last)
      until path.root?
        load_directory(path)
        path = path.parent
      end
      load_directory(File.expand_path('../../../', __FILE__))
      load_directory(File.expand_path(user_install_dir), prepend: true)
      centralized_site_config = find_val('centralized_site_config')
      if centralized_site_config
        centralized_index = -(@configs.select { |c| c.path.start_with?(File.expand_path('../../../')) }.size + 1)
        @configs.insert(centralized_index, Config.new(path: centralized_site_config, parent: self))
      end
      @configs.each { |c| c.refresh if c.needs_refresh? }
      @configs
    end
def configs! path = $_origen_invocation_pwd @configs = [ ] until path . root? load_directory ( path ) path = path . parent end path = Pathname . new ( $LOAD_PATH . last ) until path . root? load_directory ( path ) path = path . parent end load_directory ( File . expand_path ( '../../../' , __FILE__ ) ) load_directory ( File . expand_path ( user_install_dir ) , prepend : true ) centralized_site_config = find_val ( 'centralized_site_config' ) if centralized_site_config centralized_index = - ( @configs . select { | c | c . path . start_with? ( File . expand_path ( '../../../' ) ) } . size + 1 ) @configs . insert ( centralized_index , Config . new ( path : centralized_site_config , parent : self ) ) end @configs . each { | c | c . refresh if c . needs_refresh? } @configs end
Forces a reparse of the site configs.
Forces a reparse of the site configs .
# This global is set when Origen is first required, it generally means that what is considered # to be the pwd for the purposes of looking for a site_config file is the place from where the # user invoked Origen. Otherwise if the running app switches the PWD it can lead to confusing # behavior - this was a particular problem when testing the new app generator which switches the # pwd to /tmp to build the new app # Add any site_configs from where we are currently running from, i.e. the application # directory area # Add and any site_configs from the directory hierarchy where Ruby is installed # Add the one from the Origen core as the lowest priority, this one defines # the default values # Add the site_config from the user's home directory as highest priority, if it exists # But, make sure we take the site installation's setup into account. # That is, if user's home directories are somewhere else, make sure we use that directory to the find # the user's overwrite file. The user can then override that if they want." # Load any centralized site configs now. # The first site configs found will exist in Origen core, and they contain the default values. # We want the centralized config to load right after those. # After all configs have been populated, see if the centralized needs refreshing