pub fn mark_required(&mut self, path: &Path) -> io::Result<()> {
        let path = absolutize_relative_to(path, &self.cwd);
        if path.strip_prefix(RUBY_LOAD_PATH).is_err() {
            let mut message = String::from("Only paths beginning with ");
            message.push_str(RUBY_LOAD_PATH);
            message.push_str(" are writable");
            return Err(io::Error::new(io::ErrorKind::PermissionDenied, message));
        }
        match normalize_slashes(path) {
            Ok(path) => {
                self.loaded_features.insert(path.into());
                Ok(())
            }
            Err(err) => Err(io::Error::new(io::ErrorKind::NotFound, err)),
        }
    }
/// Mark a source at `path` as required on the interpreter.
///
/// This metadata is used by `Kernel#require` and friends to enforce that
/// Ruby sources are only loaded into the interpreter once to limit side
/// effects.
///
/// # Errors
///
/// If `path` does not exist, an [`io::Error`] with error kind
/// [`io::ErrorKind::NotFound`] is returned.
Mark a source at `path` as required on the interpreter.
This metadata is used by `Kernel#require` and friends to enforce that
Ruby sources are only loaded into the interpreter once to limit side
effects.
Mark a source at ` path ` as required on the interpreter . This metadata is used by ` Kernel#require ` and friends to enforce that Ruby sources are only loaded into the interpreter once to limit side effects .
pub fn mark_required(&mut self, path: &Path) -> io::Result<()> {
        let path = absolutize_relative_to(path, &self.cwd);
        if path.strip_prefix(RUBY_LOAD_PATH).is_err() {
            let mut message = String::from("Only paths beginning with ");
            message.push_str(RUBY_LOAD_PATH);
            message.push_str(" are writable");
            return Err(io::Error::new(io::ErrorKind::PermissionDenied, message));
        }
        match normalize_slashes(path) {
            Ok(path) => {
                self.loaded_features.insert(path.into());
                Ok(())
            }
            Err(err) => Err(io::Error::new(io::ErrorKind::NotFound, err)),
        }
    }
pub fn mark_required ( & mut self , path : & Path ) -> io :: Result < ( ) > { let path = absolutize_relative_to ( path , & self . cwd ) ; if path . strip_prefix ( RUBY_LOAD_PATH ) . is_err ( ) { let mut message = String :: from ( " " ) ; message . push_str ( RUBY_LOAD_PATH ) ; message . push_str ( " " ) ; return Err ( io :: Error :: new ( io :: ErrorKind :: PermissionDenied , message ) ) ; } match normalize_slashes ( path ) { Ok ( path ) => { self . loaded_features . insert ( path . into ( ) ) ; Ok ( ( ) ) } Err ( err ) => Err ( io :: Error :: new ( io :: ErrorKind :: NotFound , err ) ) , } }
Mark a source at `path` as required on the interpreter.
Mark a source at ` path ` as required on the interpreter .
&mut self
path
&Path
errors
If `path` does not exist, an [`io::Error`] with error kind
[`io::ErrorKind::NotFound`] is returned.
If ` path ` does not exist an [ ` io :: Error ` ] with error kind [ ` io :: ErrorKind :: NotFound ` ] is returned .