Class: Bundler::Plugin::VaultSource
- Inherits:
-
Object
- Object
- Bundler::Plugin::VaultSource
- Defined in:
- lib/bundler/plugin/vault_source.rb
Overview
Bundler plugin source that installs gems from a .gemv vault file.
Instance Method Summary collapse
-
#cache(spec, custom_path = nil) ⇒ Object
No source-level install_path to copy: VaultSource#install installs each gem into Bundler.bundle_path via RubyGemsGemInstaller, so the default Source#cache would dereference a non-existent directory.
- #fetch_gemspec_files ⇒ Object
-
#initialize(opts) ⇒ VaultSource
constructor
A new instance of VaultSource.
- #install(spec, opts = {}) ⇒ Object
- #options_to_lock ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(opts) ⇒ VaultSource
Returns a new instance of VaultSource.
8 9 10 11 |
# File 'lib/bundler/plugin/vault_source.rb', line 8 def initialize(opts) super @vault_path = resolve_vault_path(@uri) end |
Instance Method Details
#cache(spec, custom_path = nil) ⇒ Object
No source-level install_path to copy: VaultSource#install installs each gem into Bundler.bundle_path via RubyGemsGemInstaller, so the default Source#cache would dereference a non-existent directory.
37 |
# File 'lib/bundler/plugin/vault_source.rb', line 37 def cache(spec, custom_path = nil); end |
#fetch_gemspec_files ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/bundler/plugin/vault_source.rb', line 13 def fetch_gemspec_files validate_vault_exists! Gemvault::Vault.open(@vault_path) do |vault| vault.gem_entries.map { |entry| gemspec_file_for(vault, entry) } end end |
#install(spec, opts = {}) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/bundler/plugin/vault_source.rb', line 21 def install(spec, opts = {}) gem_dir = gem_dir_for(spec.full_name) return use_installed_gem(spec, gem_dir) if File.directory?(gem_dir) && !opts[:force] Bundler.ui.confirm "Installing #{(spec)} from vault #{@uri}" install_into_bundle(spec, opts) spec. end |
#options_to_lock ⇒ Object
30 31 32 |
# File 'lib/bundler/plugin/vault_source.rb', line 30 def {} end |
#to_s ⇒ Object
39 40 41 |
# File 'lib/bundler/plugin/vault_source.rb', line 39 def to_s "vault at #{@uri}" end |