lib/volt/server/rack/component_paths.rb
# 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,tasks}/*.rb"].each do |ruby_file|
            path = ruby_file.gsub(/^#{app_folder}\//, '')[0..-4]
            require(path)
          end
          if Volt.server?
            Dir["#{app_folder}/*/models/*.rb"].each do |ruby_file|
              class_name = File.basename(ruby_file).gsub(/[.]rb$/, '')
              $page.add_model(class_name)
            end
          end
        end
        load_views_and_routes
      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,tasks}/*.rb" ] . each do | ruby_file | path = ruby_file . gsub ( / ^ #{ app_folder } \/ / , '' ) [ 0 .. - 4 ] require ( path ) end if Volt . server? Dir [ "#{app_folder}/*/models/*.rb" ] . each do | ruby_file | class_name = File . basename ( ruby_file ) . gsub ( / [.]rb$ / , '' ) $page . add_model ( class_name ) end end end load_views_and_routes end end
Makes each components classes available on the load path, require classes.
Makes each components classes available on the load path require classes .
# Sort so we get consistent load order across platforms # Add models to page