Method: Ufo::Config#layer_levels

Defined in:
lib/ufo/config.rb

#layer_levels(prefix = nil) ⇒ Object

Works similiar to Layering::Layer. Consider combining the logic and usin Layering::Layer

Examples:

prefix: .ufo/config/#{Ufo.app}/env

Returns

.ufo/config/#{Ufo.app}/env.rb
.ufo/config/#{Ufo.app}/env/base.rb
.ufo/config/#{Ufo.app}/env/#{Ufo.env}.rb


227
228
229
230
231
232
233
234
235
# File 'lib/ufo/config.rb', line 227

def layer_levels(prefix=nil)
  levels = ["", "base", Ufo.env]
  levels << "#{Ufo.env}-#{Ufo.extra}" if Ufo.extra
  paths = levels.map do |i|
    # base layer has prefix of '', reject with blank so it doesnt produce '//'
    [prefix, i].join('/')
  end
  add_ext!(paths)
end