lib/volt/server/rack/component_paths.rb
# Yield for every folder where we might find components
Yield for every folder where we might find components
Yield for every folder where we might find components
def app_folders
    @app_folders ||= begin
      volt_app = File.expand_path(File.join(File.dirname(__FILE__), "../../../../app"))
      app_folders = [volt_app, "#{@root}/app", "#{@root}/vendor/app"].map {|f| File.expand_path(f) }
      app_folders += Gem.loaded_specs.values.map { |g| g.full_gem_path }.reject {|g| g !~ /volt/ }.map {|f| f + '/app' }
      app_folders
    end
    files = []
    @app_folders.each do |app_folder|
      files << yield(app_folder)
    end
    return files.flatten
  end
def app_folders @app_folders ||= begin volt_app = File . expand_path ( File . join ( File . dirname ( __FILE__ ) , "../../../../app" ) ) app_folders = [ volt_app , "#{@root}/app" , "#{@root}/vendor/app" ] . map { | f | File . expand_path ( f ) } app_folders += Gem . loaded_specs . values . map { | g | g . full_gem_path } . reject { | g | g !~ / volt / } . map { | f | f + '/app' } app_folders end files = [ ] @app_folders . each do | app_folder | files << yield ( app_folder ) end return files . flatten end
Yield for every folder where we might find components
Yield for every folder where we might find components
# Find all app folders # Gem folders with volt in them # TODO: we should probably qualify this a bit more # Yield each app folder and return a flattened array with # the results