Class: Bundler::CLI::Install
- Inherits:
-
Object
- Object
- Bundler::CLI::Install
- Defined in:
- lib/bundler/cli/install.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Install
constructor
A new instance of Install.
- #run ⇒ Object
Constructor Details
permalink #initialize(options) ⇒ Install
Returns a new instance of Install.
6 7 8 |
# File 'lib/bundler/cli/install.rb', line 6 def initialize() @options = end |
Instance Attribute Details
permalink #options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/bundler/cli/install.rb', line 5 def @options end |
Instance Method Details
permalink #run ⇒ Object
[View source]
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/bundler/cli/install.rb', line 10 def run Bundler.ui.level = "warn" if [:quiet] warn_if_root if [:local] Bundler.self_manager.restart_with_locked_bundler_if_needed else Bundler.self_manager.install_locked_bundler_and_restart_with_it_if_needed end Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Gem.freebsd_platform? # Disable color in deployment mode Bundler.ui.shell = Thor::Shell::Basic.new if [:deployment] if target_rbconfig_path = [:"target-rbconfig"] Bundler.rubygems.set_target_rbconfig(target_rbconfig_path) end check_trust_policy if [:deployment] || [:frozen] || Bundler.frozen_bundle? unless Bundler.default_lockfile.exist? flag = "--deployment flag" if [:deployment] flag ||= "--frozen flag" if [:frozen] flag ||= "deployment setting" if Bundler.settings[:deployment] flag ||= "frozen setting" if Bundler.settings[:frozen] raise ProductionError, "The #{flag} requires a lockfile. Please make " \ "sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control " \ "before deploying." end [:local] = true if Bundler.app_cache.exist? Bundler.settings.set_command_option :deployment, true if [:deployment] Bundler.settings.set_command_option :frozen, true if [:frozen] end # When install is called with --no-deployment, disable deployment mode if [:deployment] == false Bundler.settings.set_command_option :frozen, nil [:system] = true end normalize_settings Bundler::Fetcher.disable_endpoint = ["full-index"] if ["binstubs"] Bundler::SharedHelpers.major_deprecation 2, "The --binstubs option will be removed in favor of `bundle binstubs --all`", removed_message: "The --binstubs option have been removed in favor of `bundle binstubs --all`" end Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins? definition = Bundler.definition definition.validate_runtime! installer = Installer.install(Bundler.root, definition, ) Bundler.settings.temporary(cache_all_platforms: [:local] ? false : Bundler.settings[:cache_all_platforms]) do Bundler.load.cache(nil, [:local]) if Bundler.app_cache.exist? && !["no-cache"] && !Bundler.frozen_bundle? end Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}." Bundler::CLI::Common.(:install) if Bundler.use_system_gems? Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed." else relative_path = Bundler.configured_bundle_path.base_path_relative_to_pwd Bundler.ui.confirm "Bundled gems are installed into `#{relative_path}`" end Bundler::CLI::Common. installer. warn_ambiguous_gems if CLI::Common.clean_after_install? require_relative "clean" Bundler::CLI::Clean.new().run end Bundler::CLI::Common. rescue Gem::InvalidSpecificationException Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed." raise end |