bundler 1.15.4 → 1.16.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +43 -0
- data/README.md +12 -7
- data/exe/bundle +1 -1
- data/exe/bundle_ruby +4 -3
- data/lib/bundler.rb +47 -37
- data/lib/bundler/build_metadata.rb +38 -0
- data/lib/bundler/capistrano.rb +5 -0
- data/lib/bundler/cli.rb +155 -67
- data/lib/bundler/cli/add.rb +0 -1
- data/lib/bundler/cli/binstubs.rb +9 -7
- data/lib/bundler/cli/cache.rb +5 -4
- data/lib/bundler/cli/check.rb +3 -5
- data/lib/bundler/cli/clean.rb +5 -6
- data/lib/bundler/cli/common.rb +11 -2
- data/lib/bundler/cli/config.rb +2 -1
- data/lib/bundler/cli/console.rb +2 -1
- data/lib/bundler/cli/doctor.rb +1 -0
- data/lib/bundler/cli/exec.rb +2 -1
- data/lib/bundler/cli/gem.rb +3 -2
- data/lib/bundler/cli/info.rb +0 -1
- data/lib/bundler/cli/init.rb +17 -6
- data/lib/bundler/cli/inject.rb +1 -0
- data/lib/bundler/cli/install.rb +61 -61
- data/lib/bundler/cli/issue.rb +1 -1
- data/lib/bundler/cli/list.rb +22 -0
- data/lib/bundler/cli/lock.rb +0 -1
- data/lib/bundler/cli/open.rb +2 -2
- data/lib/bundler/cli/outdated.rb +13 -8
- data/lib/bundler/cli/package.rb +9 -6
- data/lib/bundler/cli/platform.rb +1 -0
- data/lib/bundler/cli/plugin.rb +1 -0
- data/lib/bundler/cli/pristine.rb +9 -2
- data/lib/bundler/cli/show.rb +0 -1
- data/lib/bundler/cli/update.rb +31 -5
- data/lib/bundler/cli/viz.rb +1 -0
- data/lib/bundler/compact_index_client.rb +1 -0
- data/lib/bundler/compact_index_client/cache.rb +1 -0
- data/lib/bundler/compact_index_client/updater.rb +3 -2
- data/lib/bundler/compatibility_guard.rb +14 -0
- data/lib/bundler/constants.rb +1 -0
- data/lib/bundler/current_ruby.rb +5 -4
- data/lib/bundler/definition.rb +140 -95
- data/lib/bundler/dep_proxy.rb +2 -0
- data/lib/bundler/dependency.rb +6 -7
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/deprecate.rb +1 -0
- data/lib/bundler/dsl.rb +97 -62
- data/lib/bundler/endpoint_specification.rb +9 -0
- data/lib/bundler/env.rb +63 -27
- data/lib/bundler/environment_preserver.rb +26 -6
- data/lib/bundler/errors.rb +1 -0
- data/lib/bundler/feature_flag.rb +39 -4
- data/lib/bundler/fetcher.rb +15 -8
- data/lib/bundler/fetcher/base.rb +1 -0
- data/lib/bundler/fetcher/compact_index.rb +2 -11
- data/lib/bundler/fetcher/dependency.rb +1 -0
- data/lib/bundler/fetcher/downloader.rb +1 -0
- data/lib/bundler/fetcher/index.rb +1 -0
- data/lib/bundler/friendly_errors.rb +2 -1
- data/lib/bundler/gem_helper.rb +14 -9
- data/lib/bundler/gem_helpers.rb +1 -0
- data/lib/bundler/gem_remote_fetcher.rb +1 -0
- data/lib/bundler/gem_tasks.rb +1 -0
- data/lib/bundler/gem_version_promoter.rb +1 -0
- data/lib/bundler/gemdeps.rb +1 -0
- data/lib/bundler/graph.rb +1 -0
- data/lib/bundler/index.rb +15 -8
- data/lib/bundler/injector.rb +25 -22
- data/lib/bundler/inline.rb +5 -7
- data/lib/bundler/installer.rb +93 -45
- data/lib/bundler/installer/gem_installer.rb +2 -0
- data/lib/bundler/installer/parallel_installer.rb +73 -42
- data/lib/bundler/installer/standalone.rb +1 -0
- data/lib/bundler/lazy_specification.rb +2 -1
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +10 -4
- data/lib/bundler/match_platform.rb +1 -0
- data/lib/bundler/mirror.rb +6 -3
- data/lib/bundler/plugin.rb +1 -0
- data/lib/bundler/plugin/api/source.rb +8 -0
- data/lib/bundler/plugin/installer.rb +7 -6
- data/lib/bundler/plugin/source_list.rb +7 -8
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +1 -0
- data/lib/bundler/remote_specification.rb +1 -0
- data/lib/bundler/resolver.rb +138 -191
- data/lib/bundler/resolver/spec_group.rb +111 -0
- data/lib/bundler/retry.rb +1 -0
- data/lib/bundler/ruby_dsl.rb +1 -0
- data/lib/bundler/ruby_version.rb +1 -0
- data/lib/bundler/rubygems_ext.rb +5 -4
- data/lib/bundler/rubygems_gem_installer.rb +23 -0
- data/lib/bundler/rubygems_integration.rb +56 -27
- data/lib/bundler/runtime.rb +3 -5
- data/lib/bundler/settings.rb +177 -76
- data/lib/bundler/settings/validator.rb +79 -0
- data/lib/bundler/setup.rb +1 -0
- data/lib/bundler/shared_helpers.rb +86 -26
- data/lib/bundler/similarity_detector.rb +1 -0
- data/lib/bundler/source.rb +32 -0
- data/lib/bundler/source/gemspec.rb +1 -0
- data/lib/bundler/source/git.rb +21 -16
- data/lib/bundler/source/git/git_proxy.rb +14 -10
- data/lib/bundler/source/metadata.rb +63 -0
- data/lib/bundler/source/path.rb +8 -8
- data/lib/bundler/source/path/installer.rb +2 -0
- data/lib/bundler/source/rubygems.rb +131 -84
- data/lib/bundler/source/rubygems/remote.rb +3 -0
- data/lib/bundler/source_list.rb +75 -15
- data/lib/bundler/spec_set.rb +2 -1
- data/lib/bundler/ssl_certs/certificate_manager.rb +2 -1
- data/lib/bundler/stub_specification.rb +1 -0
- data/lib/bundler/templates/Executable +4 -0
- data/lib/bundler/templates/Executable.bundler +105 -0
- data/lib/bundler/templates/Gemfile +1 -0
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/templates/newgem/gitignore.tt +0 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -1
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +0 -2
- data/lib/bundler/ui.rb +1 -0
- data/lib/bundler/ui/rg_proxy.rb +1 -0
- data/lib/bundler/ui/shell.rb +15 -4
- data/lib/bundler/ui/silent.rb +1 -0
- data/lib/bundler/uri_credentials_filter.rb +1 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +2 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +3 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +3 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +69 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +487 -148
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -4
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
- data/lib/bundler/vendored_fileutils.rb +9 -0
- data/lib/bundler/vendored_molinillo.rb +1 -0
- data/lib/bundler/vendored_persistent.rb +34 -0
- data/lib/bundler/vendored_thor.rb +1 -0
- data/lib/bundler/version.rb +6 -2
- data/lib/bundler/version_ranges.rb +1 -0
- data/lib/bundler/vlad.rb +5 -0
- data/lib/bundler/worker.rb +1 -0
- data/lib/bundler/yaml_serializer.rb +3 -3
- data/man/bundle-add.1 +43 -0
- data/man/bundle-add.1.txt +40 -0
- data/man/bundle-binstubs.1 +40 -0
- data/man/bundle-binstubs.1.txt +48 -0
- data/man/bundle-binstubs.ronn +14 -0
- data/man/bundle-check.1 +31 -0
- data/man/bundle-check.1.txt +32 -0
- data/man/bundle-clean.1 +24 -0
- data/man/bundle-clean.1.txt +26 -0
- data/man/bundle-config.1 +455 -0
- data/man/bundle-config.1.txt +491 -0
- data/man/bundle-config.ronn +133 -79
- data/man/bundle-exec.1 +165 -0
- data/man/bundle-exec.1.txt +178 -0
- data/man/bundle-exec.ronn +7 -0
- data/man/bundle-gem.1 +80 -0
- data/man/bundle-gem.1.txt +91 -0
- data/man/bundle-gem.ronn +2 -1
- data/man/bundle-info.1 +20 -0
- data/man/bundle-info.1.txt +21 -0
- data/man/bundle-init.1 +20 -0
- data/man/bundle-init.1.txt +24 -0
- data/man/bundle-inject.1 +33 -0
- data/man/bundle-inject.1.txt +32 -0
- data/man/bundle-install.1 +305 -0
- data/man/bundle-install.1.txt +385 -0
- data/man/bundle-install.ronn +32 -32
- data/man/bundle-list.1 +20 -0
- data/man/bundle-list.1.txt +21 -0
- data/man/bundle-list.ronn +15 -0
- data/man/bundle-lock.1 +84 -0
- data/man/bundle-lock.1.txt +93 -0
- data/man/bundle-open.1 +32 -0
- data/man/bundle-open.1.txt +29 -0
- data/man/bundle-outdated.1 +151 -0
- data/man/bundle-outdated.1.txt +127 -0
- data/man/bundle-outdated.ronn +1 -1
- data/man/bundle-package.1 +55 -0
- data/man/bundle-package.1.txt +79 -0
- data/man/bundle-package.ronn +5 -0
- data/man/bundle-platform.1 +61 -0
- data/man/bundle-platform.1.txt +57 -0
- data/man/bundle-pristine.1 +34 -0
- data/man/bundle-pristine.1.txt +44 -0
- data/man/bundle-pristine.ronn +24 -3
- data/man/bundle-show.1 +23 -0
- data/man/bundle-show.1.txt +25 -0
- data/man/bundle-update.1 +390 -0
- data/man/bundle-update.1.txt +386 -0
- data/man/bundle-update.ronn +2 -2
- data/man/bundle-viz.1 +39 -0
- data/man/bundle-viz.1.txt +38 -0
- data/man/bundle-viz.ronn +5 -5
- data/man/bundle.1 +132 -0
- data/man/bundle.1.txt +113 -0
- data/man/bundle.ronn +5 -2
- data/man/gemfile.5 +679 -0
- data/man/gemfile.5.ronn +31 -0
- data/man/gemfile.5.txt +636 -0
- data/man/index.txt +23 -0
- metadata +21 -36
- data/.codeclimate.yml +0 -25
- data/.gitignore +0 -18
- data/.rspec +0 -3
- data/.rubocop.yml +0 -131
- data/.rubocop_todo.yml +0 -418
- data/.travis.yml +0 -122
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -17
- data/Rakefile +0 -338
- data/bin/rake +0 -19
- data/bin/rspec +0 -15
- data/bin/rubocop +0 -17
- data/bin/with_rubygems +0 -39
- data/bundler.gemspec +0 -48
- data/doc/README.md +0 -30
- data/doc/TROUBLESHOOTING.md +0 -64
- data/doc/contributing/BUG_TRIAGE.md +0 -36
- data/doc/contributing/COMMUNITY.md +0 -13
- data/doc/contributing/GETTING_HELP.md +0 -11
- data/doc/contributing/HOW_YOU_CAN_HELP.md +0 -27
- data/doc/contributing/ISSUES.md +0 -51
- data/doc/contributing/README.md +0 -38
- data/doc/development/NEW_FEATURES.md +0 -10
- data/doc/development/PULL_REQUESTS.md +0 -40
- data/doc/development/README.md +0 -19
- data/doc/development/RELEASING.md +0 -9
- data/doc/development/SETUP.md +0 -27
- data/doc/documentation/README.md +0 -29
- data/doc/documentation/VISION.md +0 -26
- data/doc/documentation/WRITING.md +0 -54
- data/task/release.rake +0 -116
data/doc/development/README.md
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# Development
|
2
|
-
|
3
|
-
So, you're ready to start contributing to Bundler! You've come to the right place. Here you'll find an overview of how to work on Bundler locally and a description of the process from code to release.
|
4
|
-
|
5
|
-
##[Development setup](SETUP.md)
|
6
|
-
|
7
|
-
Guidelines for setting up your local development environment.
|
8
|
-
|
9
|
-
##[Submitting pull requests](PULL_REQUESTS.md)
|
10
|
-
|
11
|
-
An overview of our preferred PR process, including how to run the test suite and what to expect when you submit code for review.
|
12
|
-
|
13
|
-
##[Adding new features](NEW_FEATURES.md)
|
14
|
-
|
15
|
-
Guidelines for proposing and writing new features for Bundler.
|
16
|
-
|
17
|
-
##[Releasing Bundler](RELEASING.md)
|
18
|
-
|
19
|
-
A broad-strokes overview of the release process adhered to by the Bundler core team.
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# Releasing
|
2
|
-
|
3
|
-
_Release process documentation is in progress, see [PR 5252](https://github.com/bundler/bundler/pull/5252)._
|
4
|
-
|
5
|
-
## Beta testing
|
6
|
-
|
7
|
-
Early releases require heavy testing, especially across various system setups. We :heart: testers, and are big fans of anyone who can run `gem install bundler --pre` and try out upcoming releases in their development and staging environments.
|
8
|
-
|
9
|
-
There may not always be prereleases or beta versions of Bundler. The Bundler team will tweet from the [@bundlerio account](http://twitter.com/bundlerio) when a prerelease or beta version becomes available. You are also always welcome to try checking out master and building a gem yourself if you want to try out the latest changes.
|
data/doc/development/SETUP.md
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# Development setup
|
2
|
-
|
3
|
-
Bundler doesn't use a Gemfile to list development dependencies, because when we tried it we couldn't tell if we were awake or it was just another level of dreams. To work on Bundler, you'll probably want to do a couple of things.
|
4
|
-
|
5
|
-
1. Install `groff-base` and `graphviz` packages using your package manager, e.g for ubuntu
|
6
|
-
|
7
|
-
$ sudo apt-get install graphviz groff-base -y
|
8
|
-
|
9
|
-
and for OS X (with brew installed)
|
10
|
-
|
11
|
-
$ brew install graphviz homebrew/dupes/groff
|
12
|
-
|
13
|
-
2. Install Bundler's development dependencies
|
14
|
-
|
15
|
-
$ bin/rake spec:deps
|
16
|
-
|
17
|
-
3. Run the test suite, to make sure things are working
|
18
|
-
|
19
|
-
$ bin/rake spec
|
20
|
-
|
21
|
-
4. Set up a shell alias to run Bundler from your clone, e.g. a Bash alias:
|
22
|
-
|
23
|
-
`$ alias dbundle='ruby -I /path/to/bundler/lib /path/to/bundler/exe/bundle'`
|
24
|
-
|
25
|
-
## Debugging with `pry`
|
26
|
-
|
27
|
-
To dive into the code with Pry: `RUBYOPT=-rpry dbundle` to require pry and then run commands.
|
data/doc/documentation/README.md
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# Documentation
|
2
|
-
|
3
|
-
Code needs explanation, and sometimes those who know the code well have trouble explaining it to someone just getting into it. Because of that, we welcome documentation suggestions and patches from everyone, especially if they are brand new to using Bundler.
|
4
|
-
|
5
|
-
Currently, Bundler has two main sources of documentation:
|
6
|
-
|
7
|
-
1. built-in `help` (including usage information and man pages)
|
8
|
-
2. [Bundler documentation site](http://bundler.io)
|
9
|
-
|
10
|
-
If you have a suggestion or proposed change for [bundler.io](http://bundler.io), please open an issue or send a pull request to the [bundler-site](https://github.com/bundler/bundler-site) repository.
|
11
|
-
|
12
|
-
Not sure where to write documentation? In general, follow these guidelines:
|
13
|
-
|
14
|
-
* For an explanation of a specific Bundler command (ex: `bundle clean`): make changes to the man pages
|
15
|
-
* For longer explanations or usage guides (ex: "Using Bundler with Rails"): create new documentation within the [bundler-site](https://github.com/bundler/bundler-site) repository
|
16
|
-
|
17
|
-
If you are unsure where to begin, ping [@feministy](https://github.com/feministy) or [@indirect](https://github.com/indirect) in the Bundler Slack ([get an invite here](../contributing/GETTING_HELP.md)).
|
18
|
-
|
19
|
-
## [Writing docs for man pages)](WRITING.md)
|
20
|
-
|
21
|
-
If you’d like to submit a patch to the man pages, you're in the right place! Details on editing and previewing changes to man pages can be found here.
|
22
|
-
|
23
|
-
## [Documentation vision](VISION.md)
|
24
|
-
|
25
|
-
Just like Bundler, we have a grand plan (really, a wish list of sorts) for Bundler documentation. Preview our hopes and dreams for our documentation here.
|
26
|
-
|
27
|
-
## Translations
|
28
|
-
|
29
|
-
We don't currently have any translations, but please reach out to us if you would like to help get this going.
|
data/doc/documentation/VISION.md
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# Documentation vision
|
2
|
-
|
3
|
-
Currently, documentation for using Bundler is spread across two places:
|
4
|
-
|
5
|
-
1. built-in `help` (including usage information and man pages)
|
6
|
-
2. [Bundler documentation site](http://bundler.io)
|
7
|
-
|
8
|
-
Additional documentation about using Bundler to publish gems can also be found on the [RubyGems guides](http://guides.rubygems.org/).
|
9
|
-
|
10
|
-
## Goals
|
11
|
-
|
12
|
-
Bundler documentation should provide users with assistance:
|
13
|
-
|
14
|
-
1. Installing Bundler
|
15
|
-
2. Using Bundler to manage an application's dependencies
|
16
|
-
3. Using Bundler to create, package, and publish gems
|
17
|
-
|
18
|
-
Our goal is to provide three types of documentation:
|
19
|
-
|
20
|
-
* High level overviews that provide topical guidance
|
21
|
-
* Step-by-step tutorials
|
22
|
-
* Command-specific reference material for the CLI
|
23
|
-
|
24
|
-
Additionally, this documentation should be readily available in a logical place and easy to follow.
|
25
|
-
|
26
|
-
Someday, we'd like to create deep-dive reference material about the inner workings of Bundler. However, while this is part of our overall vision for Bundler documentation, it is not the focus of our current work.
|
@@ -1,54 +0,0 @@
|
|
1
|
-
# Writing docs for man pages
|
2
|
-
|
3
|
-
A primary source of help for Bundler users are the man pages: the output printed when you run `bundle help` (or `bundler help`). These pages can be a little tricky to format and preview, but are pretty straightforward once you get the hang of it.
|
4
|
-
|
5
|
-
_Note: `bundler` and `bundle` may be used interchangeably in the CLI. This guide uses `bundle` because it's cuter._
|
6
|
-
|
7
|
-
## What goes in man pages?
|
8
|
-
|
9
|
-
We use man pages for Bundler commands used in the CLI (command line interface). They can vary in length from large (see `bundle install`) to very short (see `bundle clean`).
|
10
|
-
|
11
|
-
To see a list of commands available in the Bundler CLI, type:
|
12
|
-
|
13
|
-
$ bundle help
|
14
|
-
|
15
|
-
Our goal is to have a man page for every command.
|
16
|
-
|
17
|
-
Don't see a man page for a command? Make a new page and send us a PR! We also welcome edits to existing pages.
|
18
|
-
|
19
|
-
## Creating a new man page
|
20
|
-
|
21
|
-
To create a new man page, simply create a new `.ronn` file in the `man/` directory.
|
22
|
-
|
23
|
-
For example: to create a man page for the command `bundle cookies` (not a real command, sadly), I would create a file `man/bundle-cookies.ronn` and add my documentation there.
|
24
|
-
|
25
|
-
## Formatting
|
26
|
-
|
27
|
-
Our man pages use ronn formatting, a combination of Markdown and standard man page conventions. It can be a little weird getting used to it at first, especially if you've used Markdown a lot.
|
28
|
-
|
29
|
-
[The ronn guide formatting guide](https://rtomayko.github.io/ronn/ronn.7.html) provides a good overview of the common types of formatting.
|
30
|
-
|
31
|
-
In general, make your page look like the other pages: utilize sections like `##OPTIONS` and formatting like code blocks and definition lists where appropriate.
|
32
|
-
|
33
|
-
If you're not sure if the formatting looks right, that's ok! Make a pull request with what you've got and we'll take a peek.
|
34
|
-
|
35
|
-
## Previewing
|
36
|
-
|
37
|
-
To preview your changes as they will print out for Bundler users, you'll need to run a series of commands:
|
38
|
-
|
39
|
-
```
|
40
|
-
$ rake spec:deps
|
41
|
-
$ rake man:build
|
42
|
-
$ man man/bundle-cookies.1
|
43
|
-
```
|
44
|
-
|
45
|
-
If you make more changes to `bundle-cookies.ronn`, you'll need to run the `rake man:build` again before previewing.
|
46
|
-
|
47
|
-
## Testing
|
48
|
-
|
49
|
-
We have tests for our documentation! The most important test file to run before you make your pull request is the one for the `help` command and another for documentation quality.
|
50
|
-
|
51
|
-
```
|
52
|
-
$ rspec ./spec/commands/help_spec.rb
|
53
|
-
$ rspec ./spec/quality_spec.rb
|
54
|
-
```
|
data/task/release.rake
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
namespace :release do
|
3
|
-
def confirm(prompt = "")
|
4
|
-
loop do
|
5
|
-
print(prompt)
|
6
|
-
print(": ") unless prompt.empty?
|
7
|
-
break if $stdin.gets.strip == "y"
|
8
|
-
end
|
9
|
-
rescue Interrupt
|
10
|
-
abort
|
11
|
-
end
|
12
|
-
|
13
|
-
def gh_api_request(opts)
|
14
|
-
require "net/http"
|
15
|
-
require "json"
|
16
|
-
host = opts.fetch(:host) { "https://api.github.com/" }
|
17
|
-
path = opts.fetch(:path)
|
18
|
-
response = Net::HTTP.get_response(URI.join(host, path))
|
19
|
-
|
20
|
-
links = Hash[*(response["Link"] || "").split(", ").map do |link|
|
21
|
-
href, name = link.match(/<(.*?)>; rel="(\w+)"/).captures
|
22
|
-
|
23
|
-
[name.to_sym, href]
|
24
|
-
end.flatten]
|
25
|
-
|
26
|
-
parsed_response = JSON.parse(response.body)
|
27
|
-
|
28
|
-
if n = links[:next]
|
29
|
-
parsed_response.concat gh_api_request(:host => host, :path => n)
|
30
|
-
end
|
31
|
-
|
32
|
-
parsed_response
|
33
|
-
end
|
34
|
-
|
35
|
-
desc "Make a patch release with the PRs from master in the patch milestone"
|
36
|
-
task :patch, :version do |_t, args|
|
37
|
-
version = args.version
|
38
|
-
|
39
|
-
version ||= begin
|
40
|
-
version = BUNDLER_SPEC.version
|
41
|
-
segments = version.segments
|
42
|
-
if segments.last.is_a?(String)
|
43
|
-
segments << "1"
|
44
|
-
else
|
45
|
-
segments[-1] += 1
|
46
|
-
end
|
47
|
-
segments.join(".")
|
48
|
-
end
|
49
|
-
|
50
|
-
confirm "You are about to release #{version}, currently #{BUNDLER_SPEC.version}"
|
51
|
-
|
52
|
-
milestones = gh_api_request(:path => "repos/bundler/bundler/milestones?state=open")
|
53
|
-
unless patch_milestone = milestones.find {|m| m["title"] == version }
|
54
|
-
abort "failed to find #{version} milestone on GitHub"
|
55
|
-
end
|
56
|
-
prs = gh_api_request(:path => "repos/bundler/bundler/issues?milestone=#{patch_milestone["number"]}&state=all")
|
57
|
-
prs.map! do |pr|
|
58
|
-
abort "#{pr["html_url"]} hasn't been closed yet!" unless pr["state"] == "closed"
|
59
|
-
next unless pr["pull_request"]
|
60
|
-
pr["number"].to_s
|
61
|
-
end
|
62
|
-
prs.compact!
|
63
|
-
|
64
|
-
version_file = "lib/bundler/version.rb"
|
65
|
-
version_contents = File.read(version_file)
|
66
|
-
unless version_contents.sub!(/^(\s*VERSION = )"#{Gem::Version::VERSION_PATTERN}"/, "\\1#{version.to_s.dump}")
|
67
|
-
abort "failed to update #{version_file}, is it in the expected format?"
|
68
|
-
end
|
69
|
-
File.open(version_file, "w") {|f| f.write(version_contents) }
|
70
|
-
|
71
|
-
BUNDLER_SPEC.version = version
|
72
|
-
|
73
|
-
branch = version.split(".", 3)[0, 2].push("stable").join("-")
|
74
|
-
sh("git", "checkout", branch)
|
75
|
-
|
76
|
-
commits = `git log --oneline origin/master --`.split("\n").map {|l| l.split(/\s/, 2) }.reverse
|
77
|
-
commits.select! {|_sha, message| message =~ /(Auto merge of|Merge pull request) ##{Regexp.union(*prs)}/ }
|
78
|
-
|
79
|
-
abort "Could not find commits for all PRs" unless commits.size == prs.size
|
80
|
-
|
81
|
-
unless system("git", "cherry-pick", "-x", "-m", "1", *commits.map(&:first))
|
82
|
-
abort unless system("zsh")
|
83
|
-
end
|
84
|
-
|
85
|
-
prs.each do |pr|
|
86
|
-
system("open", "https://github.com/bundler/bundler/pull/#{pr}")
|
87
|
-
confirm "Add to the changelog"
|
88
|
-
end
|
89
|
-
|
90
|
-
confirm "Update changelog"
|
91
|
-
sh("git", "commit", "-am", "Version #{version} with changelog")
|
92
|
-
sh("rake", "release")
|
93
|
-
sh("git", "checkout", "master")
|
94
|
-
sh("git", "pull")
|
95
|
-
sh("git", "merge", "v#{version}", "--no-edit")
|
96
|
-
sh("git", "push")
|
97
|
-
end
|
98
|
-
|
99
|
-
desc "Open all PRs that have not been included in a stable release"
|
100
|
-
task :open_unreleased_prs do
|
101
|
-
def prs(on = "master")
|
102
|
-
commits = `git log --oneline origin/#{on} --`.split("\n")
|
103
|
-
commits.reverse_each.map {|c| c =~ /(Auto merge of|Merge pull request) #(\d+)/ && $2 }.compact
|
104
|
-
end
|
105
|
-
|
106
|
-
last_stable = `git ls-remote origin`.split("\n").map {|r| r =~ %r{refs/tags/v([\d.]+)$} && $1 }.compact.map {|v| Gem::Version.create(v) }.max
|
107
|
-
last_stable = last_stable.segments[0, 2].<<("stable").join("-")
|
108
|
-
|
109
|
-
in_release = prs("HEAD") - prs(last_stable)
|
110
|
-
|
111
|
-
in_release.each do |pr|
|
112
|
-
system("open", "https://github.com/bundler/bundler/pull/#{pr}")
|
113
|
-
confirm
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|