summaryrefslogtreecommitdiff
path: root/lib/bundler/installer
Commit message (Collapse)AuthorAgeFilesLines
* RUBY_ENGINE should always be defined after 1.8.7ruby_engine_always_definedDavid Rodríguez2019-06-261-2/+1
|
* Prefer `require_relative` for internal requiresDavid Rodríguez2019-04-191-2/+2
| | | | | | | | Due to the way rubygems monkey-patched require interacts with default gems, and given that bundler is a default gem, and that bundler manipulates the LOAD_PATH in very intricated ways, we can reduce the risk of "leaking" to a different copy of `bundler` by using `require_relative` for internal requires.
* Shellsplit build configshellsplit_build_configDavid Rodríguez2019-03-281-1/+5
|
* removing requre gem_remote_fetcherGavriel Loria2018-11-241-4/+0
|
* Auto merge of #6549 - bundler:jules2689/more-registered-events, r=segiddinsThe Bundler Bot2018-06-171-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add registered plugin events for before-all, before, and after gem install Depends on #6548 ### What was the end-user problem that led to this PR? We only had one plugin hook, which limited the plugin's capabilities a lot. This adds more ### What was your diagnosis of the problem? We need more plugin hooks for gem stuff ### What is your fix for the problem, implemented in this PR? Add more hooks in after-all (including dependencies) and before/after (including install spec) ### Why did you choose this fix out of the possible options? These seemed like the obvious spots to put the hooks, but I could be wrong. The passed objects also seem to include all the info we need to action on the installations (errors, etc)
| * Add registered events for after-all, before, after gem installjules26892018-06-121-0/+2
| |
* | Check if source responds to `#remotes` before printing gem install error messagecolby/fix-git-gem-error-messageColby Swandale2018-06-081-3/+5
|/
* Fix some rescue calls that do not specifiy error type.utilum2018-03-172-2/+2
|
* Add explicit source when available in the error msg upon failureGeorge Papanikolaou2018-01-251-1/+6
| | | | | | | The error-message function did not provide an explicit source, and that could lead in some confusion especially with big Gemfiles. The command that is output, should be valid.
* improve rubocop_todo.ymlKeiji Yoshimi2017-09-241-2/+2
| | | | | | | | | | | | | | - Style/EmptyLinesAroundExceptionHandlingKeywords - Style/SpaceAroundOperators - Style/SpaceInsideBlockBraces - Lint/DuplicateMethods - Lint/Void - Style/IfUnlessModifier - Style/MixinGrouping - Style/NestedParenthesizedCalls - Style/OrAssignment - Style/RedundantParentheses - Style/TernaryParentheses
* Ensure that rake is always installed first when presentSamuel Giddins2017-09-061-0/+3
|
* Remove several CLI flags that need to be set via config in Bundler 2Samuel Giddins2017-07-191-0/+1
|
* Speed up no-op installsseg-speed-up-no-op-installSamuel Giddins2017-07-191-47/+72
| | | | This should make them nearly as fast a bundle check
* [RuboCop] Enable Layout/EmptyLineAfterMagicComment copKoichi ITO2017-07-163-0/+3
|
* Auto merge of #5850 - bundler:seg-corrupted-lockfile-show-tree, r=segiddinsThe Bundler Bot2017-07-111-1/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ParallelInstaller] Show require tree when a gem fails to install due to corrupted lockfile ### What was the end-user problem that led to this PR? The problem was that when installation failed due to a corrupted lockfile or checksum mis-match, we wouldn't show the reason that gem was being installed in the first place, as we would when other errors happened. See https://github.com/bundler/bundler/issues/5846 ### What was your diagnosis of the problem? My diagnosis was we needed to show that requirement tree whenever installation fails, regardless of the reason for the failure. ### What is your fix for the problem, implemented in this PR? My fix rescues hard installation errors and re-raises with the tree appended.
| * [ParallelInstaller] Show require tree when a gem fails to install due to ↵seg-corrupted-lockfile-show-treeSamuel Giddins2017-07-071-1/+6
| | | | | | | | corrupted lockfile
* | [Inline] Work when BUNDLE_BIN is setseg-inline-bundle-binSamuel Giddins2017-07-071-0/+1
|/
* [ParallelInstaller] Print out why a gem needed to be installed if ↵Samuel Giddins2017-03-111-1/+15
| | | | installation fails
* Auto merge of #5436 - ↵The Bundler Bot2017-02-211-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | okkez:fix-frozen-string-literal-error-with-rubygems-2.6.8, r=segiddins Use empty array when `spec_settings` returns `nil` If use bundler 1.14.4 with rubygems 2.6.8 and `Bundler.settings["build.#{spec.name}"]` returns `nil` then we get error "can't modify frozen literal string" from [rubygems](https://github.com/rubygems/rubygems/blob/v2.6.8/lib/rubygems/ext/rake_builder.rb#L13). RubyGems 2.6.8 is the default version for Ruby2.4.0. See also https://github.com/sickill/rainbow/issues/48
| * Use empty array when `spec_settings` returns `nil`okkez2017-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | If use bundler 1.14.4 with rubygems 2.6.8 and `Bundler.settings["build.#{spec.name}"]` returns `nil` then we get error "can't modify frozen literal string" from rubygems[1]. RubyGems 2.6.8 is the default version for Ruby2.4.0. [1]: https://github.com/rubygems/rubygems/blob/v2.6.8/lib/rubygems/ext/rake_builder.rb#L13 See also https://github.com/sickill/rainbow/issues/48
* | Fail gracefully when installing a spec where the API is missing depsSamuel Giddins2017-02-131-1/+1
|/
* [SpecInstallation] Add #to_sSamuel Giddins2017-01-211-0/+4
|
* Auto merge of #5279 - bundler:seg-parallel-extensions, r=indirectThe Bundler Bot2016-12-271-2/+2
|\ | | | | | | | | | | | | | | [GemInstaller] Allow installing extensions in parallel I believe this closes #4684 \c @lynnco
| * [GemInstaller] Allow installing extensions in parallelseg-parallel-extensionsSamuel Giddins2016-12-251-2/+2
| |
* | Add specs for falling back to 1 thread when the lockfile is corruptseg-parallel-installer-missing-specs-warningSamuel Giddins2016-12-261-0/+2
| |
* | [ParallelInstaller] Only print 1 warning for missing dependenciesSamuel Giddins2016-12-261-9/+24
| |
* | [ParallelInstaller] Allow installing with corrupted lockfilesSamuel Giddins2016-12-261-9/+19
|/
* [ParallelInstaller] Pre-require gem_remote_fetcher on 1.8.7seg-require-speedSamuel Giddins2016-12-211-0/+4
|
* Auto merge of #4840 - bundler:seg-unlock-locals, r=indirectHomu2016-08-091-1/+1
|\ | | | | | | | | | | | | Unlock sources when a local override leads to changes Closes #4838. Requires tests
| * Unlock sources when a local override leads to changesSamuel Giddins2016-08-051-1/+1
| |
* | [ParallelInstaller] Account for lines returning an Enumerator in old rubiesseg-installation-errorsSamuel Giddins2016-08-051-1/+1
| |
* | [ParallelInstaller] Check for proper exception classSamuel Giddins2016-08-041-1/+1
| |
* | [Installer] Move post-install messages to be an instance attributeSamuel Giddins2016-08-041-8/+2
| |
* | [ParallelInstaller] Only raise when there is an errorSamuel Giddins2016-08-041-1/+9
| |
* | [Install] Print errors at the end of installation instead of inlineSamuel Giddins2016-08-042-23/+39
|/
* [ParallelInstaller] Wrap in the Bundler namespaceseg-parallel-installer-namespaceSamuel Giddins2016-06-281-99/+101
|
* Create standalone bundler/setup.rb at a consistent path.Glenn Pratt2016-03-221-1/+1
| | | | Fixes #4274
* Add test for checking langauge of sentences used in source codeAditya Prakash2016-03-091-1/+1
|
* Merge pull request #4283 from ↵André Arko2016-02-081-0/+3
|\ | | | | | | | | RochesterinNYC/improve-error-message-invalid-gemspec-for-dependency Add helpful invalid gemspec error message for `bundle install --standalone`
| * Add helpful invalid gemspec error message for `bundle installJames Wen2016-02-071-0/+3
| | | | | | | | --standalone` when a gem/dependency has an invalid gemspec
* | [RuboCop] Update to 0.37.0seg-rubocop-0.37Samuel Giddins2016-02-051-1/+1
|/
* Compatibility with frozen string literalsSamuel Giddins2016-01-313-0/+3
|
* [Worker] Add a worker name to ease debuggingseg-thread-namesSamuel Giddins2016-01-301-1/+1
|
* Move `Bundler#ruby_version` functionality to `Bundler::RubyVersion#system`James Wen2016-01-141-1/+1
| | | | | - Part of design direction to move more functionality out of the `Bundler` top-level module.
* [RuboCop] Enable Style/PercentLiteralDelimitersSamuel Giddins2015-11-261-1/+1
|
* My goal was to reveal the main part of install_gem_from_spec. From myAndreas Hellwig2015-10-272-1/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | perspective the main part is: 1. Install 2. Generate stubs 3. Print message to the user (4. handle exceptions) While working on it I found that Bundler::Installer's run method and instance variables weren't used when installing gems with install_gem_from_spec. The installer was (and still is) only used to generate executable stubs. So I inserted the new GemInstaller in ParallelInstaller; passing the instantiated Bundler::Installer to the GemInstaller only to generate the executable stubs. Based on this I would continue by extracting two BinstubGenerator classes and removing GemInstaller's dependency on Bundler::Installer, possibly allowing for a more concise way to generate binstubs in other parts of bundler. I was a bit intimidated by the amount of installers and weary to add another one to this contested namespace. So I checked in with @indirect who approved of the general direction of the refactoring and suggested to rename the old GemInstaller to RubyGemsGemInstaller.
* There's no flat_map in 1.8.7Andreas Hellwig2015-10-031-2/+2
|
* Rubocop adjustmentAndreas Hellwig2015-09-301-1/+1
| | | | Outdent access modifiers like private
* Extract class StandaloneAndreas Hellwig2015-09-301-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I wanted to fix some minor Rubocop issues and got confused by '#{ruby_engine}/#{ruby_version}'. I managed to confuse two other people working on bundler as well, so I decided to refactor the part around it. I wanted to encapsulate the file creation, so it's (even) more obvious from the context that another ruby file is created. So having an uninterpolated string with interpolation syntax in it isn't so unusual. To be extra sure I added a comment here as Rubocop might lead others to the same spot. I found that Standalone works quite well as its own object. While extracting the class I shortened some expressions and extracted methods that made sense as a unit to me. I ended up with a generate method that only deals with file output. What I think might be controversial: * The tendency to use methods instead of variables for small things like version_dir and bundler_path: I think it's easier to understand because methdos are "read_only", while values of variables might change during code execution. * Array(spec.require_paths) instead of "next if spec.require_paths.nil? # builtin gems". We lose the comment here, but I thought Array was more concise and that the information about the type of gems isn't crucial here. * flat_map { map { ... } } instead of "collecting" in paths My perspective is that paths is the result of a transformation of @specs and that's best expressed by using map. It's also shorter.
* Change error type to LockfileErrorLukas Oberhuber2015-09-291-1/+1
|