[−][src]Struct aloxide::Ruby
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]
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
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]
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
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.
pub fn link(&self, static_lib: bool) -> Result<(), RubyLinkError>
[src]
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 #include
s 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]
F: FnMut(&Path) -> bool,
Returns header contents with filtered #include
s 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
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,