bundler 1.3.6 → 1.4.0.pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +1 -3
- data/CHANGELOG.md +27 -14
- data/CONTRIBUTING.md +2 -2
- data/{CONTRIBUTE.md → DEVELOPMENT.md} +31 -12
- data/ISSUES.md +1 -1
- data/README.md +6 -4
- data/Rakefile +1 -15
- data/bin/bundle +5 -8
- data/bundler.gemspec +1 -1
- data/lib/bundler.rb +37 -21
- data/lib/bundler/cli.rb +33 -21
- data/lib/bundler/constants.rb +5 -0
- data/lib/bundler/current_ruby.rb +88 -0
- data/lib/bundler/definition.rb +35 -11
- data/lib/bundler/dependency.rb +7 -78
- data/lib/bundler/dsl.rb +1 -1
- data/lib/bundler/fetcher.rb +37 -24
- data/lib/bundler/gem_helper.rb +2 -2
- data/lib/bundler/gem_installer.rb +9 -0
- data/lib/bundler/installer.rb +76 -7
- data/lib/bundler/parallel_workers.rb +18 -0
- data/lib/bundler/parallel_workers/thread_worker.rb +27 -0
- data/lib/bundler/parallel_workers/unix_worker.rb +88 -0
- data/lib/bundler/parallel_workers/worker.rb +68 -0
- data/lib/bundler/resolver.rb +17 -11
- data/lib/bundler/rubygems_ext.rb +2 -2
- data/lib/bundler/rubygems_integration.rb +37 -25
- data/lib/bundler/runtime.rb +8 -1
- data/lib/bundler/safe_catch.rb +101 -0
- data/lib/bundler/shared_helpers.rb +27 -1
- data/lib/bundler/source/git.rb +2 -1
- data/lib/bundler/source/git/git_proxy.rb +3 -3
- data/lib/bundler/source/path.rb +3 -2
- data/lib/bundler/source/rubygems.rb +5 -17
- data/lib/bundler/spec_set.rb +16 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/lib/bundler/vendor/net/http/persistent.rb +136 -38
- data/lib/bundler/vendor/thor.rb +211 -188
- data/lib/bundler/vendor/thor/actions.rb +19 -19
- data/lib/bundler/vendor/thor/actions/create_link.rb +3 -0
- data/lib/bundler/vendor/thor/actions/directory.rb +30 -10
- data/lib/bundler/vendor/thor/actions/empty_directory.rb +3 -19
- data/lib/bundler/vendor/thor/actions/file_manipulation.rb +6 -3
- data/lib/bundler/vendor/thor/base.rb +101 -97
- data/lib/bundler/vendor/thor/{task.rb → command.rb} +17 -13
- data/lib/bundler/vendor/thor/core_ext/io_binary_read.rb +12 -0
- data/lib/bundler/vendor/thor/error.rb +8 -11
- data/lib/bundler/vendor/thor/group.rb +35 -38
- data/lib/bundler/vendor/thor/invocation.rb +28 -26
- data/lib/bundler/vendor/thor/parser/options.rb +21 -19
- data/lib/bundler/vendor/thor/rake_compat.rb +3 -2
- data/lib/bundler/vendor/thor/runner.rb +22 -21
- data/lib/bundler/vendor/thor/shell/basic.rb +44 -22
- data/lib/bundler/vendor/thor/shell/color.rb +13 -9
- data/lib/bundler/vendor/thor/shell/html.rb +13 -9
- data/lib/bundler/vendor/thor/util.rb +214 -210
- data/lib/bundler/vendor/thor/version.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-install.ronn +5 -1
- data/man/gemfile.5.ronn +10 -2
- data/spec/bundler/dsl_spec.rb +3 -3
- data/spec/bundler/gem_helper_spec.rb +14 -17
- data/spec/bundler/safe_catch_spec.rb +37 -0
- data/spec/install/gems/dependency_api_spec.rb +1 -36
- data/spec/install/gems/packed_spec.rb +4 -2
- data/spec/install/gems/resolving_spec.rb +37 -0
- data/spec/install/gems/simple_case_spec.rb +18 -16
- data/spec/install/git_spec.rb +1 -1
- data/spec/other/binstubs_spec.rb +24 -13
- data/spec/other/exec_spec.rb +24 -2
- data/spec/other/help_spec.rb +6 -6
- data/spec/other/outdated_spec.rb +3 -3
- data/spec/quality_spec.rb +3 -2
- data/spec/realworld/dependency_api_spec.rb +1 -1
- data/spec/realworld/edgecases_spec.rb +3 -3
- data/spec/realworld/parallel_install_spec.rb +19 -0
- data/spec/resolver/basic_spec.rb +11 -0
- data/spec/runtime/require_spec.rb +9 -0
- data/spec/runtime/setup_spec.rb +2 -3
- data/spec/spec_helper.rb +0 -1
- data/spec/support/builders.rb +2 -4
- data/spec/support/helpers.rb +4 -8
- data/spec/support/indexes.rb +18 -0
- data/spec/support/streams.rb +13 -0
- metadata +19 -11
- data/lib/bundler/vendor/thor/core_ext/dir_escape.rb +0 -0
- data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +0 -9
- data/spec/support/artifice/endpoint_host_redirect.rb +0 -15
- data/spec/support/permissions.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb14de795ee1e2465028243460a3fb96dfdbcaa
|
4
|
+
data.tar.gz: 12561bb2d356025acecf0256224ae8e6ded869d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a4e14da992b28d578950b11b3cd2fedbbb79f33300106c979a365a205be106f8922ef272566eb44145b8ff131a0def5646dd6929ea90a8a95642413cbc3bffb
|
7
|
+
data.tar.gz: 51d99c4f9383fbb0685d72f120b2ae8117e9b0d084f88517fa8429c7084c604e1458394c72ec4de911a17944f7d020e3ac87437b46fe3a8113b0e11d6710a8c5
|
data/.travis.yml
CHANGED
@@ -33,14 +33,12 @@ env:
|
|
33
33
|
# we need to know if changes to rubygems will break bundler on release
|
34
34
|
- RGV=master
|
35
35
|
# test the latest rubygems release with all of our supported rubies
|
36
|
-
- RGV=v2.0.
|
37
|
-
- RGV=2.0
|
36
|
+
- RGV=v2.0.3
|
38
37
|
matrix:
|
39
38
|
allow_failures:
|
40
39
|
# we want to know how we're doing with head, but not fail the build
|
41
40
|
- rvm: ruby-head
|
42
41
|
- env: RGV=master
|
43
|
-
- env: RGV=2.0
|
44
42
|
# 1.9.2 is simply too slow. it sometimes exceeds the 25m hard limit.
|
45
43
|
- rvm: 1.9.2
|
46
44
|
include:
|
data/CHANGELOG.md
CHANGED
@@ -1,22 +1,35 @@
|
|
1
|
+
## 1.4.0.pre.1 (2013-08-04)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- retry network requests while installing gems (#2561, @ascherger)
|
6
|
+
- faster installs using gemspecs from the local system cache (#2497, @mipearson)
|
7
|
+
- add `bundle install -jN` for N parallel gem installations (#2481, @eagletmt)
|
8
|
+
- add `ENV['DEBUG_RESOLVER_TREE']` outputs resolver tree (@dblock)
|
9
|
+
- set $MANPATH so `bundle exec man name` works (#1624, @sunaku)
|
10
|
+
- use `man` instead of `groff` (#2579, @ixti, @simi)
|
11
|
+
- add Gemfile dependency info to bundle outdated output (#2487, @rahearn)
|
12
|
+
- allow `require: true` as an alias for `require: <name>` (#2538, @ndbroadbent)
|
13
|
+
- rescue and report Thor errors (#2478, @pjvds)
|
14
|
+
- detect cyclic dependencies (#2564, @gnufied)
|
15
|
+
- support multiple gems in `binstubs` (#2576, @lucasmazza)
|
16
|
+
- use https instead of git for :github gems (#2569, @fuadsaud)
|
17
|
+
- add quiet option to `bundle package` (#2573, @shtirlic)
|
18
|
+
- use RUBYLIB instead of RUBYOPT for better Windows support (#2536, @equinux)
|
19
|
+
|
20
|
+
Bugfixes:
|
21
|
+
|
22
|
+
- reduce stack size while resolving to fix JRuby overflow (#2510, @headius)
|
23
|
+
- display GitErrors while loading specs in --verbose mode (#2461)
|
24
|
+
- allow the same options hash to be passed to multiple gems (#2447)
|
25
|
+
- handle missing binaries without an exception (#2019, @luismreis)
|
26
|
+
|
1
27
|
## 1.3.6
|
2
28
|
|
3
29
|
Bugfixes:
|
4
30
|
|
31
|
+
- set --no-cache when bundle install --local is called (@TimMoore)
|
5
32
|
- make gemspec path option preserve relative paths in lock file (@bwillis)
|
6
|
-
- use umask when creating binstubs (#1618, @v-yarotsky)
|
7
|
-
- warn if graphviz is not installed (#2435, @Agis-)
|
8
|
-
- show git errors while loading gemspecs
|
9
|
-
- don't mutate gem method options hash (#2447)
|
10
|
-
- print Thor errors (#2478, @pjvds)
|
11
|
-
- print Rubygems system exit errors (James Cook)
|
12
|
-
- more Pathnames into Strings for MacRuby (@kml)
|
13
|
-
- preserve original gemspec path (@bwillis)
|
14
|
-
- remove warning about deps with :git (#1651, @ixti)
|
15
|
-
- split git files on null (#2634, @jasonmp85)
|
16
|
-
- handle cross-host redirects without SSL (#2686, @grddev)
|
17
|
-
- handle Rubygems 2 security exception (@zzak)
|
18
|
-
- reinstall gems if they are missing with spec present
|
19
|
-
- set binstub permissions using umask (#1618, @v-yarotsky)
|
20
33
|
|
21
34
|
## 1.3.5 (3 April 2013)
|
22
35
|
|
data/CONTRIBUTING.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Creating Issues
|
2
2
|
|
3
|
-
If you're having a problem, please see [ISSUES](https://github.com/
|
3
|
+
If you're having a problem, please see [ISSUES](https://github.com/bundler/bundler/blob/master/ISSUES.md) for troubleshooting steps and a guide for how to submit a ticket that will help us solve the problem you are having as quickly as possible.
|
4
4
|
|
5
5
|
# Discussing Bundler
|
6
6
|
|
@@ -8,6 +8,6 @@ If you'd like to discuss features, ask questions, or just engage in general Bund
|
|
8
8
|
|
9
9
|
# Helping Out
|
10
10
|
|
11
|
-
If you'd like to help make Bundler better, you totally rock! Please check out the [
|
11
|
+
If you'd like to help make Bundler better, you totally rock! Please check out the [DEVELOPMENT](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md) file for an introduction to the project, guidelines for contributing, and suggestions for things anyone can do that would be helpful.
|
12
12
|
|
13
13
|
Thanks for helping us make Bundler better.
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Great to have you here! Here are a few ways you can help out with [Bundler](http://github.com/
|
1
|
+
Great to have you here! Here are a few ways you can help out with [Bundler](http://github.com/bundler/bundler).
|
2
2
|
|
3
|
-
#
|
3
|
+
# Where should I start?
|
4
4
|
|
5
5
|
You can start learning about Bundler by reading [the documentation](http://gembundler.com). If you want, you can also read a (lengthy) explanation of [why Bundler exists and what it does](http://gembundler.com/v1.2/rationale.html). You can also check out discussions about Bundler on the [Bundler mailing list](https://groups.google.com/group/ruby-bundler) and in the [Bundler IRC channel](irc://irc.freenode.net/#bundler), which is #bundler on Freenode.
|
6
6
|
|
@@ -8,14 +8,33 @@ You can start learning about Bundler by reading [the documentation](http://gembu
|
|
8
8
|
|
9
9
|
The Bundler core team consists of André Arko ([@indirect](http://github.com/indirect)), Terence Lee ([@hone](http://github.com/hone)), and Jessica Lynn Suttles ([@jlsuttles](http://github.com/jlsuttles)), with support and advice from original Bundler author Yehuda Katz ([@wycats](http://github.com/wycats)).
|
10
10
|
|
11
|
+
# Development setup
|
12
|
+
|
13
|
+
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.
|
14
|
+
|
15
|
+
1. Install Bundler's development dependencies
|
16
|
+
|
17
|
+
$ rake spec:deps
|
18
|
+
|
19
|
+
2. Run the test suite, to make sure things are working
|
20
|
+
|
21
|
+
$ rake spec
|
22
|
+
|
23
|
+
3. Set up a shell alias to run Bundler from your clone, e.g. a Bash alias:
|
24
|
+
|
25
|
+
$ alias dbundle='ruby -I /path/to/bundler/lib /path/to/bundler/bin/bundle'
|
26
|
+
|
27
|
+
With that set up, you can test changes you've made to Bundler by running `dbundle`, without interfering with the regular `bundle` command.
|
28
|
+
|
29
|
+
|
11
30
|
# Adding new features
|
12
31
|
|
13
|
-
|
32
|
+
If you would like to add a new feature to Bundler, please follow these steps:
|
14
33
|
|
15
|
-
1. [Create an issue](https://github.com/
|
34
|
+
1. [Create an issue](https://github.com/bundler/bundler/issues/new) to discuss your feature.
|
16
35
|
2. Base your commits on the master branch, since we follow [SemVer](http://semver.org) and don't add new features to old releases.
|
17
36
|
3. Commit the code and at least one test covering your changes to a feature branch in your fork.
|
18
|
-
4. Put a line in the [CHANGELOG](https://github.com/
|
37
|
+
4. Put a line in the [CHANGELOG](https://github.com/bundler/bundler/blob/master/CHANGELOG.md) summarizing your changes under the next release under the "Features" heading.
|
19
38
|
5. Send us a [pull request](https://help.github.com/articles/using-pull-requests) from your feature branch.
|
20
39
|
|
21
40
|
If you don't hear back immediately, don’t get discouraged! We all have day jobs, but we respond to most tickets within a day or two.
|
@@ -24,9 +43,9 @@ If you don't hear back immediately, don’t get discouraged! We all have day job
|
|
24
43
|
|
25
44
|
Triage is the work of processing tickets that have been opened into actionable issues, feature requests, or bug reports. That includes verifying bugs, categorizing the ticket, and ensuring there's enough information to reproduce the bug for anyone who wants to try to fix it.
|
26
45
|
|
27
|
-
We've created an [issues guide](https://github.com/
|
46
|
+
We've created an [issues guide](https://github.com/bundler/bundler/blob/master/ISSUES.md) to walk Bundler users through the process of troubleshooting issues and reporting bugs.
|
28
47
|
|
29
|
-
If you'd like to help, awesome! You can [report a new bug](https://github.com/
|
48
|
+
If you'd like to help, awesome! You can [report a new bug](https://github.com/bundler/bundler/issues/new) or browse our [existing open tickets](https://github.com/bundler/bundler/issues).
|
30
49
|
|
31
50
|
Not every ticket will point to a bug in Bundler's code, but open tickets usually mean that there is something we could improve to help that user. Sometimes that means writing additional documentation, sometimes that means making error messages clearer, and sometimes that means explaining to a user that they need to install git to use git gems.
|
32
51
|
|
@@ -45,7 +64,7 @@ If you can reproduce an issue, you're well on your way to fixing it. :) Fixing i
|
|
45
64
|
1. Discuss the fix on the existing issue. Coordinating with everyone else saves duplicate work and serves as a great way to get suggestions and ideas if you need any.
|
46
65
|
2. Base your commits on the correct branch. Bugfixes for 1.x versions of Bundler should be based on the matching 1-x-stable branch.
|
47
66
|
3. Commit the code and at least one test covering your changes to a named branch in your fork.
|
48
|
-
4. Put a line in the [CHANGELOG](https://github.com/
|
67
|
+
4. Put a line in the [CHANGELOG](https://github.com/bundler/bundler/blob/master/CHANGELOG.md) summarizing your changes under the next release under the “Bugfixes” heading.
|
49
68
|
5. Send us a [pull request](https://help.github.com/articles/using-pull-requests) from your bugfix branch.
|
50
69
|
|
51
70
|
Finally, the ticket may be a duplicate of another older ticket. If you notice a ticket is a duplicate, simply comment on the ticket noting the original ticket’s number. For example, you could say “This is a duplicate of issue #42, and can be closed”.
|
@@ -71,16 +90,16 @@ Bundler has two main sources of documentation: the built-in help (including usag
|
|
71
90
|
|
72
91
|
If you’d like to submit a patch to the man pages, follow the steps for adding a feature above. All of the man pages are located in the `man` directory. Just use the “Documentation” heading when you describe what you did in the changelog.
|
73
92
|
|
74
|
-
If you have a suggestion or proposed change for [gembundler.com](http://gembundler.com), please open an issue or send a pull request to the [bundler-site
|
93
|
+
If you have a suggestion or proposed change for [gembundler.com](http://gembundler.com), please open an issue or send a pull request to the [bundler-site](https://github.com/bundler/bundler-site) repository.
|
75
94
|
|
76
95
|
|
77
96
|
# Community
|
78
97
|
|
79
98
|
Community is an important part of all we do. If you’d like to be part of the Bundler community, you can jump right in and start helping make Bundler better for everyone who uses it.
|
80
99
|
|
81
|
-
It would be tremendously helpful to have more people answering questions about Bundler (and often simply about Rubygems or Ruby itself) in our [issue tracker](https://github.com/
|
100
|
+
It would be tremendously helpful to have more people answering questions about Bundler (and often simply about Rubygems or Ruby itself) in our [issue tracker](https://github.com/bundler/bundler/issues) or on [Stack Overflow](http://stackoverflow.com/questions/tagged/bundler).
|
82
101
|
|
83
|
-
Additional documentation and explanation is always helpful, too. If you have any suggestions for the Bundler website [gembundler.com](http://www.gembundler.com), we would absolutely love it if you opened an issue or pull request on the [bundler-site
|
102
|
+
Additional documentation and explanation is always helpful, too. If you have any suggestions for the Bundler website [gembundler.com](http://www.gembundler.com), we would absolutely love it if you opened an issue or pull request on the [bundler-site](https://github.com/bundler/bundler-site) repository.
|
84
103
|
|
85
104
|
Finally, sharing your experiences and discoveries by writing them up is a valuable way to help others who have similar problems or experiences in the future. You can write a blog post, create an example and commit it to Github, take screenshots, or make videos.
|
86
105
|
|
@@ -89,7 +108,7 @@ Examples of how Bundler is used help everyone, and we’ve discovered that peopl
|
|
89
108
|
If you let someone on the core team know you wrote about Bundler, we will add your post to the list of Bundler resources on the Github project wiki.
|
90
109
|
|
91
110
|
|
92
|
-
# Your first
|
111
|
+
# Your first commits
|
93
112
|
|
94
113
|
If you’re interested in contributing to Bundler, that’s awesome! We’d love your help.
|
95
114
|
|
data/ISSUES.md
CHANGED
@@ -78,6 +78,6 @@ If you are using Rails 2.3, please also include:
|
|
78
78
|
|
79
79
|
If you have either `rubygems-bundler` or `open_gem` installed, please try removing them and then following the troubleshooting steps above before opening a new ticket.
|
80
80
|
|
81
|
-
[Create a gist](https://gist.github.com) containing all of that information, then visit the [Bundler issue tracker](https://github.com/
|
81
|
+
[Create a gist](https://gist.github.com) containing all of that information, then visit the [Bundler issue tracker](https://github.com/bundler/bundler/issues) and [create a ticket](https://github.com/bundler/bundler/issues/new) describing your problem and linking to your gist.
|
82
82
|
|
83
83
|
Thanks for reporting issues and helping make Bundler better!
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
1
|
+
[](https://codeclimate.com/github/bundler/bundler)
|
2
|
+
[](http://travis-ci.org/bundler/bundler)
|
2
3
|
|
4
|
+
# Bundler: a gem to bundle gems
|
3
5
|
Bundler keeps ruby applications running the same code on every machine.
|
4
6
|
|
5
7
|
It does this by managing the gems that the application depends on. Given a list of gems, it can automatically download and install those gems, as well as any other gems needed by the gems that are listed. Before installing gems, it checks the versions of every gem to make sure that they are compatible, and can all be loaded at the same time. After the gems have been installed, Bundler can help you update some or all of them when new versions become available. Finally, it records the exact versions that have been installed, so that others can install the exact same gems.
|
@@ -18,15 +20,15 @@ See [gembundler.com](http://gembundler.com) for the full documentation.
|
|
18
20
|
|
19
21
|
### Troubleshooting
|
20
22
|
|
21
|
-
For help with common problems, see [ISSUES](https://github.com/
|
23
|
+
For help with common problems, see [ISSUES](https://github.com/bundler/bundler/blob/master/ISSUES.md).
|
22
24
|
|
23
25
|
### Contributing
|
24
26
|
|
25
|
-
If you'd like to contribute to Bundler, that's awesome, and we <3 you. There's a guide to contributing to Bundler (both code and general help) over in [
|
27
|
+
If you'd like to contribute to Bundler, that's awesome, and we <3 you. There's a guide to contributing to Bundler (both code and general help) over in [DEVELOPMENT](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md)
|
26
28
|
|
27
29
|
### Development
|
28
30
|
|
29
|
-
To see what has changed in recent versions of Bundler, see the [CHANGELOG](https://github.com/
|
31
|
+
To see what has changed in recent versions of Bundler, see the [CHANGELOG](https://github.com/bundler/bundler/blob/master/CHANGELOG.md).
|
30
32
|
|
31
33
|
The `master` branch contains our current progress towards version 1.3. Versions 1.0 to 1.2 each have their own stable branches. Please submit bugfixes as pull requests to the stable branch for the version you would like to fix.
|
32
34
|
|
data/Rakefile
CHANGED
@@ -89,7 +89,7 @@ begin
|
|
89
89
|
namespace :rubygems do
|
90
90
|
rubyopt = ENV["RUBYOPT"]
|
91
91
|
# When editing this list, also edit .travis.yml!
|
92
|
-
%w(master
|
92
|
+
%w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.25 v2.0.3).each do |rg|
|
93
93
|
desc "Run specs with Rubygems #{rg}"
|
94
94
|
RSpec::Core::RakeTask.new(rg) do |t|
|
95
95
|
t.rspec_opts = %w(-fs --color)
|
@@ -220,18 +220,4 @@ end
|
|
220
220
|
task :build => ["man:clean", "man:build"]
|
221
221
|
task :release => ["man:clean", "man:build"]
|
222
222
|
|
223
|
-
namespace :vendor do
|
224
|
-
desc "Build the vendor dir"
|
225
|
-
task :build => :clean do
|
226
|
-
sh "git clone git://github.com/wycats/thor.git lib/bundler/vendor/tmp"
|
227
|
-
sh "mv lib/bundler/vendor/tmp/lib/* lib/bundler/vendor/"
|
228
|
-
rm_rf "lib/bundler/vendor/tmp"
|
229
|
-
end
|
230
|
-
|
231
|
-
desc "Clean the vendor dir"
|
232
|
-
task :clean do
|
233
|
-
rm_rf "lib/bundler/vendor"
|
234
|
-
end
|
235
|
-
end
|
236
|
-
|
237
223
|
task :default => :spec
|
data/bin/bundle
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
#
|
4
|
-
# https://twitter.com/mitchellh/status/283014103189053442
|
3
|
+
# Exit cleanly from an early interrupt
|
5
4
|
Signal.trap("INT") { exit 1 }
|
6
5
|
|
7
6
|
require 'bundler'
|
@@ -16,10 +15,8 @@ $:.each do |path|
|
|
16
15
|
end
|
17
16
|
|
18
17
|
require 'bundler/cli'
|
18
|
+
# Force Thor to raise exceptions so we can exit non-zero.
|
19
|
+
ENV["THOR_DEBUG"] = "1"
|
20
|
+
|
19
21
|
require 'bundler/friendly_errors'
|
20
|
-
Bundler.with_friendly_errors {
|
21
|
-
# Set debug flag so we can rescue Thor::error's
|
22
|
-
# and set the correct exit code.
|
23
|
-
ENV["THOR_DEBUG"] = "1"
|
24
|
-
Bundler::CLI.start
|
25
|
-
}
|
22
|
+
Bundler.with_friendly_errors { Bundler::CLI.start }
|
data/bundler.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.add_development_dependency 'ronn', '~> 0.7.3'
|
20
20
|
spec.add_development_dependency 'rspec', '~> 2.11'
|
21
21
|
|
22
|
-
spec.files = `git ls-files
|
22
|
+
spec.files = `git ls-files`.split($/)
|
23
23
|
spec.files += Dir.glob('lib/bundler/man/**/*') # man/ is ignored by git
|
24
24
|
spec.test_files = spec.files.grep(%r{^spec/})
|
25
25
|
|
data/lib/bundler.rb
CHANGED
@@ -5,6 +5,8 @@ require 'bundler/gem_path_manipulation'
|
|
5
5
|
require 'bundler/rubygems_ext'
|
6
6
|
require 'bundler/rubygems_integration'
|
7
7
|
require 'bundler/version'
|
8
|
+
require 'bundler/constants'
|
9
|
+
require 'bundler/current_ruby'
|
8
10
|
|
9
11
|
module Bundler
|
10
12
|
preserve_gem_path
|
@@ -48,25 +50,22 @@ module Bundler
|
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
51
|
-
class GemfileNotFound
|
52
|
-
class GemNotFound
|
53
|
-
class GemfileError
|
54
|
-
class InstallError
|
55
|
-
class InstallHookError
|
56
|
-
class PathError
|
57
|
-
class GitError
|
58
|
-
class DeprecatedError
|
59
|
-
class GemspecError
|
60
|
-
class InvalidOption
|
61
|
-
class ProductionError
|
62
|
-
class HTTPError
|
63
|
-
class RubyVersionMismatch
|
64
|
-
class SecurityError
|
65
|
-
class LockfileError
|
66
|
-
|
67
|
-
WINDOWS = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
|
68
|
-
FREEBSD = RbConfig::CONFIG["host_os"] =~ /bsd/
|
69
|
-
NULL = WINDOWS ? "NUL" : "/dev/null"
|
53
|
+
class GemfileNotFound < BundlerError; status_code(10) ; end
|
54
|
+
class GemNotFound < BundlerError; status_code(7) ; end
|
55
|
+
class GemfileError < BundlerError; status_code(4) ; end
|
56
|
+
class InstallError < BundlerError; status_code(5) ; end
|
57
|
+
class InstallHookError < BundlerError; status_code(6) ; end
|
58
|
+
class PathError < BundlerError; status_code(13) ; end
|
59
|
+
class GitError < BundlerError; status_code(11) ; end
|
60
|
+
class DeprecatedError < BundlerError; status_code(12) ; end
|
61
|
+
class GemspecError < BundlerError; status_code(14) ; end
|
62
|
+
class InvalidOption < BundlerError; status_code(15) ; end
|
63
|
+
class ProductionError < BundlerError; status_code(16) ; end
|
64
|
+
class HTTPError < BundlerError; status_code(17) ; end
|
65
|
+
class RubyVersionMismatch < BundlerError; status_code(18) ; end
|
66
|
+
class SecurityError < BundlerError; status_code(19) ; end
|
67
|
+
class LockfileError < BundlerError; status_code(20) ; end
|
68
|
+
class CyclicDependencyError < BundlerError; status_code(21) ; end
|
70
69
|
|
71
70
|
# Internal errors, should be rescued
|
72
71
|
class VersionConflict < BundlerError
|
@@ -139,6 +138,11 @@ module Bundler
|
|
139
138
|
Bundler::Environment.new(root, definition)
|
140
139
|
end
|
141
140
|
|
141
|
+
# Returns an instance of Bundler::Definition for given Gemfile and lockfile
|
142
|
+
#
|
143
|
+
# @param unlock [Hash, Boolean, nil] Gems that have been requested
|
144
|
+
# to be updated or true if all gems should be updated
|
145
|
+
# @return [Bundler::Definition]
|
142
146
|
def definition(unlock = nil)
|
143
147
|
@definition = nil if unlock
|
144
148
|
@definition ||= begin
|
@@ -289,7 +293,19 @@ module Bundler
|
|
289
293
|
end
|
290
294
|
|
291
295
|
def sudo(str)
|
292
|
-
|
296
|
+
prompt = "\n\n" + <<-PROMPT.gsub(/^ {6}/, '').strip + " "
|
297
|
+
Your user account isn't allowed to install to the system Rubygems.
|
298
|
+
You can cancel this installation and run:
|
299
|
+
|
300
|
+
bundle install --path vendor/bundle
|
301
|
+
|
302
|
+
to install the gems into ./vendor/bundle/, or you can enter your password
|
303
|
+
and install the bundled gems to Rubygems using sudo.
|
304
|
+
|
305
|
+
Password:
|
306
|
+
PROMPT
|
307
|
+
|
308
|
+
`sudo -p "#{prompt}" #{str}`
|
293
309
|
end
|
294
310
|
|
295
311
|
def read_file(file)
|
@@ -315,7 +331,7 @@ module Bundler
|
|
315
331
|
path = Pathname.new(file)
|
316
332
|
# Eval the gemspec from its parent directory, because some gemspecs
|
317
333
|
# depend on "./" relative paths.
|
318
|
-
|
334
|
+
SharedHelpers.chdir(path.dirname.to_s) do
|
319
335
|
contents = path.read
|
320
336
|
if contents[0..2] == "---" # YAML header
|
321
337
|
eval_yaml_gemspec(path, contents)
|
data/lib/bundler/cli.rb
CHANGED
@@ -12,6 +12,7 @@ module Bundler
|
|
12
12
|
rescue UnknownArgumentError => e
|
13
13
|
raise InvalidOption, e.message
|
14
14
|
ensure
|
15
|
+
options ||= {}
|
15
16
|
Bundler.ui = UI::Shell.new(options)
|
16
17
|
Bundler.ui.level = "debug" if options["verbose"]
|
17
18
|
end
|
@@ -43,11 +44,8 @@ module Bundler
|
|
43
44
|
if manpages.include?(command)
|
44
45
|
root = File.expand_path("../man", __FILE__)
|
45
46
|
|
46
|
-
if Bundler.which("
|
47
|
-
|
48
|
-
pager = pager_system
|
49
|
-
|
50
|
-
Kernel.exec "#{groff} #{root}/#{command} | #{pager}"
|
47
|
+
if Bundler.which("man") && root !~ %r{^file:/.+!/META-INF/jruby.home/.+}
|
48
|
+
Kernel.exec "man #{root}/#{command}"
|
51
49
|
else
|
52
50
|
puts File.read("#{root}/#{command}.txt")
|
53
51
|
end
|
@@ -173,6 +171,9 @@ module Bundler
|
|
173
171
|
"Gem trust policy (like gem install -P). Must be one of " +
|
174
172
|
Bundler.rubygems.security_policies.keys.join('|') unless
|
175
173
|
Bundler.rubygems.security_policies.empty?
|
174
|
+
method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
|
175
|
+
"Specify the number of jobs to run in parallel"
|
176
|
+
|
176
177
|
def install
|
177
178
|
opts = options.dup
|
178
179
|
if opts[:without]
|
@@ -224,6 +225,8 @@ module Bundler
|
|
224
225
|
opts[:system] = true
|
225
226
|
end
|
226
227
|
|
228
|
+
opts["no-cache"] ||= opts[:local]
|
229
|
+
|
227
230
|
# Can't use Bundler.settings for this because settings needs gemfile.dirname
|
228
231
|
Bundler.settings[:path] = nil if opts[:system]
|
229
232
|
Bundler.settings[:path] = "vendor/bundle" if opts[:deployment]
|
@@ -245,7 +248,7 @@ module Bundler
|
|
245
248
|
definition = Bundler.definition
|
246
249
|
definition.validate_ruby!
|
247
250
|
Installer.install(Bundler.root, definition, opts)
|
248
|
-
Bundler.load.cache if Bundler.root.join("vendor/cache").exist? && !
|
251
|
+
Bundler.load.cache if Bundler.root.join("vendor/cache").exist? && !opts["no-cache"]
|
249
252
|
|
250
253
|
if Bundler.settings[:path]
|
251
254
|
absolute_path = File.expand_path(Bundler.settings[:path])
|
@@ -373,18 +376,26 @@ module Bundler
|
|
373
376
|
"binstub destination directory (default bin)"
|
374
377
|
method_option "force", :type => :boolean, :default => false, :banner =>
|
375
378
|
"overwrite existing binstubs if they exist"
|
376
|
-
def binstubs(
|
379
|
+
def binstubs(*gems)
|
377
380
|
Bundler.definition.validate_ruby!
|
378
381
|
Bundler.settings[:bin] = options["path"] if options["path"]
|
379
382
|
Bundler.settings[:bin] = nil if options["path"] && options["path"].empty?
|
380
383
|
installer = Installer.new(Bundler.root, Bundler.definition)
|
381
|
-
spec = installer.specs.find{|s| s.name == gem_name }
|
382
|
-
raise GemNotFound, not_found_message(gem_name, Bundler.definition.specs) unless spec
|
383
384
|
|
384
|
-
if
|
385
|
-
Bundler.ui.
|
386
|
-
|
387
|
-
|
385
|
+
if gems.empty?
|
386
|
+
Bundler.ui.error "`bundle binstubs` needs at least one gem to run."
|
387
|
+
exit 1
|
388
|
+
end
|
389
|
+
|
390
|
+
gems.each do |gem_name|
|
391
|
+
spec = installer.specs.find{|s| s.name == gem_name }
|
392
|
+
raise GemNotFound, not_found_message(gem_name, Bundler.definition.specs) unless spec
|
393
|
+
|
394
|
+
if spec.name == "bundler"
|
395
|
+
Bundler.ui.warn "Sorry, Bundler can only be run via Rubygems."
|
396
|
+
else
|
397
|
+
installer.generate_bundler_executable_stubs(spec, :force => options[:force], :binstubs_cmd => true)
|
398
|
+
end
|
388
399
|
end
|
389
400
|
end
|
390
401
|
|
@@ -404,6 +415,8 @@ module Bundler
|
|
404
415
|
Bundler.definition.validate_ruby!
|
405
416
|
|
406
417
|
current_specs = Bundler.ui.silence { Bundler.load.specs }
|
418
|
+
current_dependencies = {}
|
419
|
+
Bundler.ui.silence { Bundler.load.dependencies.each { |dep| current_dependencies[dep.name] = dep } }
|
407
420
|
|
408
421
|
if gems.empty? && sources.empty?
|
409
422
|
# We're doing a full update
|
@@ -417,7 +430,8 @@ module Bundler
|
|
417
430
|
|
418
431
|
out_count = 0
|
419
432
|
# Loop through the current specs
|
420
|
-
current_specs.
|
433
|
+
gemfile_specs, dependency_specs = current_specs.partition { |spec| current_dependencies.has_key? spec.name }
|
434
|
+
[gemfile_specs.sort_by(&:name), dependency_specs.sort_by(&:name)].flatten.each do |current_spec|
|
421
435
|
next if !gems.empty? && !gems.include?(current_spec.name)
|
422
436
|
|
423
437
|
active_spec = definition.index[current_spec.name].sort_by { |b| b.version }
|
@@ -442,7 +456,9 @@ module Bundler
|
|
442
456
|
|
443
457
|
spec_version = "#{active_spec.version}#{active_spec.git_version}"
|
444
458
|
current_version = "#{current_spec.version}#{current_spec.git_version}"
|
445
|
-
|
459
|
+
dependency = current_dependencies[current_spec.name]
|
460
|
+
dependency_version = %|Gemfile specifies "#{dependency.requirement}"| if dependency && dependency.specific?
|
461
|
+
Bundler.ui.info " * #{active_spec.name} (#{spec_version} > #{current_version}) #{dependency_version}".rstrip
|
446
462
|
out_count += 1
|
447
463
|
end
|
448
464
|
Bundler.ui.debug "from #{active_spec.loaded_from}"
|
@@ -474,6 +490,7 @@ module Bundler
|
|
474
490
|
desc "package", "Locks and then caches all of the gems into vendor/cache"
|
475
491
|
method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
|
476
492
|
method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)."
|
493
|
+
method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
|
477
494
|
long_desc <<-D
|
478
495
|
The package command will copy the .gem files for every gem in the bundle into the
|
479
496
|
directory ./vendor/cache. If you then check that directory into your source
|
@@ -481,6 +498,7 @@ module Bundler
|
|
481
498
|
bundle without having to download any additional gems.
|
482
499
|
D
|
483
500
|
def package
|
501
|
+
Bundler.ui.level = "warn" if options[:quiet]
|
484
502
|
setup_cache_all
|
485
503
|
install
|
486
504
|
# TODO: move cache contents here now that all bundles are locked
|
@@ -855,12 +873,6 @@ module Bundler
|
|
855
873
|
message
|
856
874
|
end
|
857
875
|
|
858
|
-
def pager_system
|
859
|
-
pager = ENV['PAGER'] || ENV['MANPAGER']
|
860
|
-
pager ||= 'less -R' if Bundler.which("less")
|
861
|
-
pager ||= 'more' if Bundler.which("more")
|
862
|
-
pager ||= 'cat'
|
863
|
-
end
|
864
876
|
|
865
877
|
def without_groups_message
|
866
878
|
groups = Bundler.settings.without
|