lib/volt/server/rack/component_paths.rb
def app_folders
      # Find all 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) }

        # Gem folders with volt in them
        # TODO: we should probably qualify this a bit more
        app_folders += Gem.loaded_specs.values.map(&:full_gem_path).reject { |g| g !~ /volt/ }.map { |f| f + '/app' }

        app_folders.uniq
      end

      # Yield each app folder and return a flattened array with
      # the results

      files        = []
      @app_folders.each do |app_folder|
        files << yield(app_folder)
      end

      files.flatten
    end
# 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(&:full_gem_path).reject { |g| g !~ /volt/ }.map { |f| f + '/app' }
        app_folders.uniq
      end
      files        = []
      @app_folders.each do |app_folder|
        files << yield(app_folder)
      end
      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 ( & :full_gem_path ) . reject { | g | g !~ / volt / } . map { | f | f + '/app' } app_folders . uniq end files = [ ] @app_folders . each do | app_folder | files << yield ( app_folder ) end 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