lib/volt/server/rack/component_paths.rb
def require_in_components
    if RUBY_PLATFORM == 'opal'
    else
      app_folders do |app_folder|
        $LOAD_PATH.unshift(app_folder)

        Dir["#{app_folder}/*/{controllers,models}/*.rb"].each do |ruby_file|
          path = ruby_file.gsub(/^#{app_folder}\//, '')[0..-4]
          require(path)
        end
      end
    end

    # add each tasks folder directly
    components.each do |name,component_folders|
      component_folders.each do |component_folder|
        Dir["#{component_folder}/tasks"].sort.each do |tasks_folder|
          $LOAD_PATH.unshift(tasks_folder)
        end
      end
    end
  end
# Makes each components classes available on the load path, require classes.
Makes each components classes available on the load path, require classes.
Makes each components classes available on the load path require classes .
def require_in_components
    if RUBY_PLATFORM == 'opal'
    else
      app_folders do |app_folder|
        $LOAD_PATH.unshift(app_folder)
        Dir["#{app_folder}/*/{controllers,models}/*.rb"].each do |ruby_file|
          path = ruby_file.gsub(/^#{app_folder}\//, '')[0..-4]
          require(path)
        end
      end
    end
    components.each do |name,component_folders|
      component_folders.each do |component_folder|
        Dir["#{component_folder}/tasks"].sort.each do |tasks_folder|
          $LOAD_PATH.unshift(tasks_folder)
        end
      end
    end
  end
def require_in_components if RUBY_PLATFORM == 'opal' else app_folders do | app_folder | $LOAD_PATH . unshift ( app_folder ) Dir [ "#{app_folder}/*/{controllers,models}/*.rb" ] . each do | ruby_file | path = ruby_file . gsub ( / ^ #{ app_folder } \/ / , '' ) [ 0 .. - 4 ] require ( path ) end end end components . each do | name , component_folders | component_folders . each do | component_folder | Dir [ "#{component_folder}/tasks" ] . sort . each do | tasks_folder | $LOAD_PATH . unshift ( tasks_folder ) end end end end
Makes each components classes available on the load path, require classes.
Makes each components classes available on the load path require classes .
# add each tasks folder directly