class Stibium::Bundled::Bundle::Directory

Describe vendor directory.

Attributes

path[R]

@return [Pathname]

ruby_config[R]

@return [Hash{Symbol => Object}]

Public Class Methods

new(path, ruby_config: {}) click to toggle source

@param path [String, Pathname] @param ruby_config [Hash{Symbol => Object}]

# File lib/stibium/bundled/bundle/directory.rb, line 21
def initialize(path, ruby_config: {})
  @path = Pathname.new(path).expand_path.freeze
  @ruby_config = {
    engine: RUBY_ENGINE,
    version: RbConfig::CONFIG['ruby_version'],
  }.merge(ruby_config.to_h)
end

Public Instance Methods

specifications() click to toggle source

@return [Array<Pathname>]

# File lib/stibium/bundled/bundle/directory.rb, line 37
def specifications
  [
    [ruby_config.fetch(:engine), ruby_config.fetch(:version), 'specifications', '*.gemspec'],
    [ruby_config.fetch(:engine), ruby_config.fetch(:version), 'bundler', 'gems', '*/*.gemspec'],
  ].map do |parts|
    self.path.join(*parts).yield_self do |s|
      Dir.glob(s).sort.map { |fp| Pathname.new(fp) }.keep_if(&:file?)
    end
  end.flatten.sort
end
to_path() click to toggle source

@return [String]

# File lib/stibium/bundled/bundle/directory.rb, line 30
def to_path
  path.to_path
end
Also aliased as: to_s
to_s()
Alias for: to_path