pub struct Lockfile {
pub sources: Vec<Source>,
pub specs: Vec<GemSpec>,
pub platforms: Vec<String>,
pub dependencies: Vec<Dependency>,
pub ruby_version: Option<String>,
pub bundled_with: Option<String>,
}Expand description
A parsed Gemfile.lock file.
Fields§
§sources: Vec<Source>All gem sources (GEM, GIT, PATH sections).
specs: Vec<GemSpec>All resolved gem specifications across all sources.
platforms: Vec<String>Target platforms.
dependencies: Vec<Dependency>Top-level dependencies from the DEPENDENCIES section.
ruby_version: Option<String>Ruby version constraint, if specified.
bundled_with: Option<String>Bundler version that generated this lockfile.
Implementations§
Source§impl Lockfile
impl Lockfile
Sourcepub fn find_spec(&self, name: &str) -> Option<&GemSpec>
pub fn find_spec(&self, name: &str) -> Option<&GemSpec>
Find a gem spec by name. Returns the first match (without platform suffix).
Sourcepub fn find_specs(&self, name: &str) -> Vec<&GemSpec>
pub fn find_specs(&self, name: &str) -> Vec<&GemSpec>
Find all gem specs by name (including platform variants).
Sourcepub fn parsed_ruby_version(&self) -> Option<RubyVersion>
pub fn parsed_ruby_version(&self) -> Option<RubyVersion>
Parse the RUBY VERSION section into a RubyVersion.
Returns None if the section is absent or cannot be parsed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lockfile
impl RefUnwindSafe for Lockfile
impl Send for Lockfile
impl Sync for Lockfile
impl Unpin for Lockfile
impl UnsafeUnpin for Lockfile
impl UnwindSafe for Lockfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more