lib/origen/site_config.rb
# Searches a directory and returns an array of config objects (from lowest to highest priority) that were found
# @note This includes searching for <code>./config/</code> in <code>dir</code>. In other words, this searches both
#  <code>dir</code> and <code>dir/config</code>.
Searches a directory and returns an array of config objects (from lowest to highest priority) that were found
Searches a directory and returns an array of config objects ( from lowest to highest priority ) that were found
def load_directory(dir, prepend: false)
      [
        File.join(dir, 'config', 'origen_site_config.yml'),
        File.join(dir, 'config', 'origen_site_config.yml.erb'),
        File.join(dir, 'origen_site_config.yml'),
        File.join(dir, 'origen_site_config.yml.erb')
      ].each do |f|
        if File.exist?(f)
          if prepend
            configs.unshift(Config.new(path: f, parent: self))
          else
            configs << Config.new(path: f, parent: self)
          end
        end
      end
    end
def load_directory ( dir , prepend : false ) [ File . join ( dir , 'config' , 'origen_site_config.yml' ) , File . join ( dir , 'config' , 'origen_site_config.yml.erb' ) , File . join ( dir , 'origen_site_config.yml' ) , File . join ( dir , 'origen_site_config.yml.erb' ) ] . each do | f | if File . exist? ( f ) if prepend configs . unshift ( Config . new ( path : f , parent : self ) ) else configs << Config . new ( path : f , parent : self ) end end end end
Searches a directory and returns an array of config objects (from lowest to highest priority) that were found
Searches a directory and returns an array of config objects ( from lowest to highest priority ) that were found
dir
<not_specific>
prepend
<not_specific>
note
This includes searching for ./config/ in dir. In other words, this searches both dir and dir/config.
This includes searching for . / config / in dir . In other words this searches both dir and dir / config .