Customizing Files app favorites

Hi, I’m trying to follow the customization instructions for the Files app found here:

Specifically this:

OodFilesApp.candidate_favorite_paths.tap do |paths|
  # add project space directories
  projects =^P./)
  paths.concat { |p|"/fs/project/#{p}")  }

  # add User scratch space directory
  paths <<"/fs/scratch/#{}")

  # Project scratch is given an optional title field
  paths.concat { |p|"/fs/scratch/#{p}", title: "Scratch")  }

So, I don’t understand how this does what it does.

  1. What is the “tap” attribute of OodFilesApp.candidate_favorite_paths? This is a method? So nothing will happen in this initializer without doing something with method “tap?”
  2. I don’t need anything this complicated w/r/t building a dynamic list of favorites every time the user opens the dashboard. It only needs exactly one path (/mnt/data) – in fact, I don’t even want the user’s home. How can this be accomplished?


tap, and the way we’re using it here, is sort of a ruby idiom. Sort of a ‘give me this thing (paths) and let me operate on that thing’ - without having to keep it as a variable or similar.

In any case - this should work for you.

OodFilesApp.candidate_favorite_paths.tap do |paths|
  paths <<"/mnt/data")

This much simpler form may actually work for you, but I’m only like 80% sure without actually trying it out.

OodFilesApp.candidate_favorite_paths <<"/mnt/data")

Close, but “Home” is still there.