[][src]Struct aloxide::Ruby

pub struct Ruby { /* fields omitted */ }

An existing Ruby installation

Ruby's sources are located in src_dir and its build output in out_dir.

Methods

impl Ruby[src]

pub fn src<P: AsRef<Path> + ?Sized>(path: &P) -> &RubySrc[src]

Returns a RubySrc instance that can be used to download and build Ruby sources at path.

pub fn new(version: Version, out_dir: impl Into<PathBuf>) -> Ruby[src]

Creates a new instance without doing anything.

pub fn current() -> Result<Ruby, RubyVersionError>[src]

Returns the current Ruby found in PATH.

pub fn from_bin(ruby: impl AsRef<OsStr>) -> Result<Ruby, RubyVersionError>[src]

Creates a new instance from the specified ruby binary.

pub fn from_cmd(ruby: &mut Command) -> Result<Ruby, RubyVersionError>[src]

Creates a new instance from executing ruby.

pub fn from_path(out_dir: impl Into<PathBuf>) -> Result<Ruby, RubyVersionError>[src]

Creates a new instance, finding out the version by running the ruby executable in out_dir.

pub fn from_rvm(version: &Version) -> Result<Ruby, RubyVersionError>[src]

Creates a new instance from the ruby binary installed via rvm.

pub fn from_rbenv(version: &Version) -> Result<Ruby, RubyVersionError>[src]

Creates a new instance from the ruby binary installed via rbenv.

pub fn version(&self) -> &Version[src]

Returns the Ruby version.

pub fn full_version(&self) -> Result<String, RubyExecError>[src]

Returns the result of executing ruby -v.

pub fn out_dir(&self) -> &Path[src]

The directory of Ruby's installed files.

pub fn lib_dir(&self) -> &Path[src]

The directory where Ruby's library lives.

pub fn bin_path(&self) -> &Path[src]

The path of the ruby executable.

pub fn exec<I, S>(&self, args: I) -> Result<String, RubyExecError> where
    I: IntoIterator<Item = S>,
    S: AsRef<OsStr>, 
[src]

Executes the ruby binary at bin_path with args.

pub fn run(&self, script: impl AsRef<OsStr>) -> Result<String, RubyExecError>[src]

Runs script through the ruby interpreter at bin_path.

pub fn run_multiple<I, S>(&self, scripts: I) -> Result<String, RubyExecError> where
    I: IntoIterator<Item = S>,
    S: AsRef<OsStr>, 
[src]

Runs multiple scripts through the ruby interpreter at bin_path separate from one another and returns their concatenated outputs.

This is the same as doing:

ruby -e $script1 -e $script2 -e $script3 ...

pub fn get_config(&self, key: impl Display) -> Result<String, RubyExecError>[src]

Returns the configuration value for key.

pub fn include_dir(&self) -> Result<String, RubyExecError>[src]

Returns the include directory.

pub fn header_dir(&self) -> Result<String, RubyExecError>[src]

Returns the directory containing the Ruby library's main header files.

pub fn arch_header_dir(&self) -> Result<String, RubyExecError>[src]

Returns the directory containing the Ruby library's architecture-specific header files.

pub fn lib_name(&self, static_lib: bool) -> Result<String, RubyExecError>[src]

Returns the name of the Ruby library.

pub fn lib_args(&self) -> Result<String, RubyExecError>[src]

Returns the value of RbConfig::CONFIG['LIBRUBYARG'].

pub fn libs(&self) -> Result<String, RubyExecError>[src]

Returns the value of RbConfig::CONFIG['LIBS'].

pub fn main_libs(&self) -> Result<String, RubyExecError>[src]

Returns the value of RbConfig::CONFIG['MAINLIBS'].

pub fn so_libs(&self) -> Result<String, RubyExecError>[src]

Returns the value of RbConfig::CONFIG['SOLIBS'].

The returned value is a list of shared object libraries.

pub fn aux_libs(&self, static_lib: bool) -> Result<String, RubyExecError>[src]

The auxiliary libraries that should be dynamically linked to.

Tells cargo to link to Ruby and its libraries.

pub fn with_headers<F: FnMut(PathBuf)>(&self, f: F) -> Result<()>[src]

Iterates over the header directory paths for the Ruby library.

pub fn headers(&self) -> Result<Vec<PathBuf>>[src]

Returns all header paths for the Ruby library.

pub fn wrapper_header(&self) -> Result<String>[src]

Returns header contents with #includes that are suitable for passing into bindgen.

This method filters out headers in arch_header_dir. If you'd like to keep those headers, use wrapper_header_filtered with a filter that returns true.

pub fn wrapper_header_filtered<F>(&self, f: F) -> Result<String> where
    F: FnMut(&Path) -> bool
[src]

Returns header contents with filtered #includes that are suitable for passing into bindgen.

Filtering of headers is left completely up to the caller. Note that headers in arch_header_dir will be passed in as well. This can sometimes lead to issues regarding redefined types.

Trait Implementations

impl Debug for Ruby[src]

Auto Trait Implementations

impl Send for Ruby

impl Sync for Ruby

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]