bundler_package_git 1.1.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. data/.gitignore +22 -0
  2. data/.rvmrc +1 -0
  3. data/CHANGELOG.md +659 -0
  4. data/ISSUES.md +47 -0
  5. data/LICENSE +23 -0
  6. data/README.md +29 -0
  7. data/Rakefile +167 -0
  8. data/UPGRADING.md +103 -0
  9. data/bin/bundle +22 -0
  10. data/bundler.gemspec +30 -0
  11. data/lib/bundler.rb +283 -0
  12. data/lib/bundler/capistrano.rb +11 -0
  13. data/lib/bundler/cli.rb +490 -0
  14. data/lib/bundler/definition.rb +429 -0
  15. data/lib/bundler/dependency.rb +130 -0
  16. data/lib/bundler/deployment.rb +53 -0
  17. data/lib/bundler/dsl.rb +243 -0
  18. data/lib/bundler/environment.rb +47 -0
  19. data/lib/bundler/fetcher.rb +101 -0
  20. data/lib/bundler/gem_helper.rb +146 -0
  21. data/lib/bundler/graph.rb +130 -0
  22. data/lib/bundler/index.rb +131 -0
  23. data/lib/bundler/installer.rb +117 -0
  24. data/lib/bundler/lazy_specification.rb +71 -0
  25. data/lib/bundler/lockfile_parser.rb +108 -0
  26. data/lib/bundler/remote_specification.rb +57 -0
  27. data/lib/bundler/resolver.rb +470 -0
  28. data/lib/bundler/rubygems_ext.rb +226 -0
  29. data/lib/bundler/runtime.rb +201 -0
  30. data/lib/bundler/settings.rb +117 -0
  31. data/lib/bundler/setup.rb +16 -0
  32. data/lib/bundler/shared_helpers.rb +167 -0
  33. data/lib/bundler/source.rb +675 -0
  34. data/lib/bundler/spec_set.rb +134 -0
  35. data/lib/bundler/templates/Executable +16 -0
  36. data/lib/bundler/templates/Gemfile +4 -0
  37. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  38. data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
  39. data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
  40. data/lib/bundler/templates/newgem/gitignore.tt +4 -0
  41. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -0
  42. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  43. data/lib/bundler/templates/newgem/newgem.gemspec.tt +21 -0
  44. data/lib/bundler/ui.rb +73 -0
  45. data/lib/bundler/vendor/net/http/faster.rb +27 -0
  46. data/lib/bundler/vendor/net/http/persistent.rb +464 -0
  47. data/lib/bundler/vendor/thor.rb +319 -0
  48. data/lib/bundler/vendor/thor/actions.rb +297 -0
  49. data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
  50. data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
  51. data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
  52. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +229 -0
  53. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +104 -0
  54. data/lib/bundler/vendor/thor/base.rb +556 -0
  55. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
  56. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
  57. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
  58. data/lib/bundler/vendor/thor/error.rb +30 -0
  59. data/lib/bundler/vendor/thor/invocation.rb +168 -0
  60. data/lib/bundler/vendor/thor/parser.rb +4 -0
  61. data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
  62. data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
  63. data/lib/bundler/vendor/thor/parser/option.rb +120 -0
  64. data/lib/bundler/vendor/thor/parser/options.rb +174 -0
  65. data/lib/bundler/vendor/thor/shell.rb +88 -0
  66. data/lib/bundler/vendor/thor/shell/basic.rb +275 -0
  67. data/lib/bundler/vendor/thor/shell/color.rb +108 -0
  68. data/lib/bundler/vendor/thor/shell/html.rb +121 -0
  69. data/lib/bundler/vendor/thor/task.rb +114 -0
  70. data/lib/bundler/vendor/thor/util.rb +229 -0
  71. data/lib/bundler/vendor/thor/version.rb +3 -0
  72. data/lib/bundler/version.rb +6 -0
  73. data/lib/bundler/vlad.rb +9 -0
  74. data/man/bundle-config.ronn +90 -0
  75. data/man/bundle-exec.ronn +111 -0
  76. data/man/bundle-install.ronn +314 -0
  77. data/man/bundle-package.ronn +59 -0
  78. data/man/bundle-update.ronn +176 -0
  79. data/man/bundle.ronn +80 -0
  80. data/man/gemfile.5.ronn +279 -0
  81. data/man/index.txt +6 -0
  82. data/spec/cache/gems_spec.rb +219 -0
  83. data/spec/cache/git_spec.rb +9 -0
  84. data/spec/cache/path_spec.rb +27 -0
  85. data/spec/cache/platform_spec.rb +57 -0
  86. data/spec/install/deploy_spec.rb +197 -0
  87. data/spec/install/deprecated_spec.rb +37 -0
  88. data/spec/install/gems/c_ext_spec.rb +48 -0
  89. data/spec/install/gems/dependency_api_spec.rb +85 -0
  90. data/spec/install/gems/env_spec.rb +107 -0
  91. data/spec/install/gems/flex_spec.rb +313 -0
  92. data/spec/install/gems/groups_spec.rb +245 -0
  93. data/spec/install/gems/packed_spec.rb +84 -0
  94. data/spec/install/gems/platform_spec.rb +208 -0
  95. data/spec/install/gems/resolving_spec.rb +72 -0
  96. data/spec/install/gems/simple_case_spec.rb +715 -0
  97. data/spec/install/gems/standalone_spec.rb +162 -0
  98. data/spec/install/gems/sudo_spec.rb +73 -0
  99. data/spec/install/gems/win32_spec.rb +26 -0
  100. data/spec/install/gemspec_spec.rb +108 -0
  101. data/spec/install/git_spec.rb +571 -0
  102. data/spec/install/invalid_spec.rb +17 -0
  103. data/spec/install/path_spec.rb +353 -0
  104. data/spec/install/upgrade_spec.rb +26 -0
  105. data/spec/lock/git_spec.rb +35 -0
  106. data/spec/lock/lockfile_spec.rb +683 -0
  107. data/spec/other/check_spec.rb +221 -0
  108. data/spec/other/clean_spec.rb +202 -0
  109. data/spec/other/config_spec.rb +40 -0
  110. data/spec/other/console_spec.rb +54 -0
  111. data/spec/other/exec_spec.rb +241 -0
  112. data/spec/other/ext_spec.rb +16 -0
  113. data/spec/other/gem_helper_spec.rb +128 -0
  114. data/spec/other/help_spec.rb +38 -0
  115. data/spec/other/init_spec.rb +40 -0
  116. data/spec/other/newgem_spec.rb +24 -0
  117. data/spec/other/open_spec.rb +35 -0
  118. data/spec/other/show_spec.rb +82 -0
  119. data/spec/pack/gems_spec.rb +54 -0
  120. data/spec/quality_spec.rb +58 -0
  121. data/spec/resolver/basic_spec.rb +20 -0
  122. data/spec/resolver/platform_spec.rb +82 -0
  123. data/spec/runtime/executable_spec.rb +110 -0
  124. data/spec/runtime/load_spec.rb +107 -0
  125. data/spec/runtime/platform_spec.rb +90 -0
  126. data/spec/runtime/require_spec.rb +231 -0
  127. data/spec/runtime/setup_spec.rb +688 -0
  128. data/spec/runtime/with_clean_env_spec.rb +15 -0
  129. data/spec/spec_helper.rb +85 -0
  130. data/spec/support/artifice/endpoint.rb +50 -0
  131. data/spec/support/artifice/endpoint_fallback.rb +22 -0
  132. data/spec/support/artifice/endpoint_marshal_fail.rb +11 -0
  133. data/spec/support/artifice/endpoint_redirect.rb +11 -0
  134. data/spec/support/builders.rb +574 -0
  135. data/spec/support/fakeweb/rack-1.0.0.marshal +2 -0
  136. data/spec/support/fakeweb/windows.rb +23 -0
  137. data/spec/support/helpers.rb +246 -0
  138. data/spec/support/indexes.rb +112 -0
  139. data/spec/support/matchers.rb +89 -0
  140. data/spec/support/path.rb +73 -0
  141. data/spec/support/platforms.rb +53 -0
  142. data/spec/support/ruby_ext.rb +20 -0
  143. data/spec/support/rubygems_ext.rb +35 -0
  144. data/spec/support/rubygems_hax/platform.rb +11 -0
  145. data/spec/support/sudo.rb +21 -0
  146. data/spec/update/gems_spec.rb +121 -0
  147. data/spec/update/git_spec.rb +196 -0
  148. data/spec/update/source_spec.rb +51 -0
  149. metadata +294 -0
@@ -0,0 +1,59 @@
1
+ bundle-package(1) -- Package your needed `.gem` files into your application
2
+ ===========================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bundle package`
7
+
8
+ ## DESCRIPTION
9
+
10
+ Copy all of the `.gem` files needed to run the application into the
11
+ `vendor/cache` directory. In the future, when running [bundle install(1)][bundle-install],
12
+ use the gems in the cache in preference to the ones on `rubygems.org`.
13
+
14
+ ## GIT AND PATH GEMS
15
+
16
+ In Bundler 1.0, the `bundle package` command only packages `.gem` files,
17
+ not gems specified using the `:git` or `:path` options. This will likely
18
+ change in the future.
19
+
20
+ ## REMOTE FETCHING
21
+
22
+ By default, if you simply run [bundle install(1)][bundle-install] after running
23
+ [bundle package(1)][bundle-package], bundler will still connect to `rubygems.org`
24
+ to check whether a platform-specific gem exists for any of the gems
25
+ in `vendor/cache`.
26
+
27
+ For instance, consider this Gemfile(5):
28
+
29
+ source "http://rubygems.org"
30
+
31
+ gem "nokogiri"
32
+
33
+ If you run `bundle package` under C Ruby, bundler will retrieve
34
+ the version of `nokogiri` for the `"ruby"` platform. If you deploy
35
+ to JRuby and run `bundle install`, bundler is forced to check to
36
+ see whether a `"java"` platformed `nokogiri` exists.
37
+
38
+ Even though the `nokogiri` gem for the Ruby platform is
39
+ _technically_ acceptable on JRuby, it actually has a C extension
40
+ that does not run on JRuby. As a result, bundler will, by default,
41
+ still connect to `rubygems.org` to check whether it has a version
42
+ of one of your gems more specific to your platform.
43
+
44
+ This problem is also not just limited to the `"java"` platform.
45
+ A similar (common) problem can happen when developing on Windows
46
+ and deploying to Linux, or even when developing on OSX and
47
+ deploying to Linux.
48
+
49
+ If you know for sure that the gems packaged in `vendor/cache`
50
+ are appropriate for the platform you are on, you can run
51
+ `bundle install --local` to skip checking for more appropriate
52
+ gems, and just use the ones in `vendor/cache`.
53
+
54
+ One way to be sure that you have the right platformed versions
55
+ of all your gems is to run `bundle package` on an identical
56
+ machine and check in the gems. For instance, you can run
57
+ `bundle package` on an identical staging box during your
58
+ staging process, and check in the `vendor/cache` before
59
+ deploying to production.
@@ -0,0 +1,176 @@
1
+ bundle-update(1) -- Update your gems to the latest available versions
2
+ =====================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bundle update` <*gems> [--source=NAME]
7
+
8
+ ## DESCRIPTION
9
+
10
+ Update the gems specified (all gems, if none are specified), ignoring
11
+ the previously installed gems specified in the `Gemfile.lock`. In
12
+ general, you should use [bundle install(1)][bundle-install] to install the same exact
13
+ gems and versions across machines.
14
+
15
+ You would use `bundle update` to explicitly update the version of a
16
+ gem.
17
+
18
+ ## OPTIONS
19
+
20
+ * `--source=<name>`:
21
+ The name of a `:git` or `:path` source used in the Gemfile(5). For
22
+ instance, with a `:git` source of `http://github.com/rails/rails.git`,
23
+ you would call `bundle update --source rails`
24
+
25
+ ## UPDATING ALL GEMS
26
+
27
+ If you run `bundle update` with no parameters, bundler will ignore
28
+ any previously installed gems and resolve all dependencies again
29
+ based on the latest versions of all gems available in the sources.
30
+
31
+ Consider the following Gemfile(5):
32
+
33
+ source "http://rubygems.org"
34
+
35
+ gem "rails", "3.0.0.rc"
36
+ gem "nokogiri"
37
+
38
+ When you run [bundle install(1)][bundle-install] the first time, bundler will resolve
39
+ all of the dependencies, all the way down, and install what you need:
40
+
41
+ Fetching source index for http://rubygems.org/
42
+ Installing rake (0.8.7)
43
+ Installing abstract (1.0.0)
44
+ Installing activesupport (3.0.0.rc)
45
+ Installing builder (2.1.2)
46
+ Installing i18n (0.4.1)
47
+ Installing activemodel (3.0.0.rc)
48
+ Installing erubis (2.6.6)
49
+ Installing rack (1.2.1)
50
+ Installing rack-mount (0.6.9)
51
+ Installing rack-test (0.5.4)
52
+ Installing tzinfo (0.3.22)
53
+ Installing actionpack (3.0.0.rc)
54
+ Installing mime-types (1.16)
55
+ Installing polyglot (0.3.1)
56
+ Installing treetop (1.4.8)
57
+ Installing mail (2.2.5)
58
+ Installing actionmailer (3.0.0.rc)
59
+ Installing arel (0.4.0)
60
+ Installing activerecord (3.0.0.rc)
61
+ Installing activeresource (3.0.0.rc)
62
+ Installing bundler (1.0.0.rc.3)
63
+ Installing nokogiri (1.4.3.1) with native extensions
64
+ Installing thor (0.14.0)
65
+ Installing railties (3.0.0.rc)
66
+ Installing rails (3.0.0.rc)
67
+
68
+ Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
69
+
70
+ As you can see, even though you have just two gems in the Gemfile(5), your application
71
+ actually needs 25 different gems in order to run. Bundler remembers the exact versions
72
+ it installed in `Gemfile.lock`. The next time you run [bundle install(1)][bundle-install], bundler skips
73
+ the dependency resolution and installs the same gems as it installed last time.
74
+
75
+ After checking in the `Gemfile.lock` into version control and cloning it on another
76
+ machine, running [bundle install(1)][bundle-install] will _still_ install the gems that you installed
77
+ last time. You don't need to worry that a new release of `erubis` or `mail` changes
78
+ the gems you use.
79
+
80
+ However, from time to time, you might want to update the gems you are using to the
81
+ newest versions that still match the gems in your Gemfile(5).
82
+
83
+ To do this, run `bundle update`, which will ignore the `Gemfile.lock`, and resolve
84
+ all the dependencies again. Keep in mind that this process can result in a significantly
85
+ different set of the 25 gems, based on the requirements of new gems that the gem
86
+ authors released since the last time you ran `bundle update`.
87
+
88
+ ## UPDATING A LIST OF GEMS
89
+
90
+ Sometimes, you want to update a single gem in the Gemfile(5), and leave the rest of the
91
+ gems that you specified locked to the versions in the `Gemfile.lock`.
92
+
93
+ For instance, in the scenario above, imagine that `nokogiri` releases version `1.4.4`, and
94
+ you want to update it _without_ updating Rails and all of its dependencies. To do this,
95
+ run `bundle update nokogiri`.
96
+
97
+ Bundler will update `nokogiri` and any of its dependencies, but leave alone Rails and
98
+ its dependencies.
99
+
100
+ ## OVERLAPPING DEPENDENCIES
101
+
102
+ Sometimes, multiple gems declared in your Gemfile(5) are satisfied by the same
103
+ second-level dependency. For instance, consider the case of `thin` and
104
+ `rack-perftools-profiler`.
105
+
106
+ source "http://rubygems.org"
107
+
108
+ gem "thin"
109
+ gem "rack-perftools-profiler"
110
+
111
+ The `thin` gem depends on `rack >= 1.0`, while `rack-perftools-profiler` depends
112
+ on `rack ~> 1.0`. If you run bundle install, you get:
113
+
114
+ Fetching source index for http://rubygems.org/
115
+ Installing daemons (1.1.0)
116
+ Installing eventmachine (0.12.10) with native extensions
117
+ Installing open4 (1.0.1)
118
+ Installing perftools.rb (0.4.7) with native extensions
119
+ Installing rack (1.2.1)
120
+ Installing rack-perftools_profiler (0.0.2)
121
+ Installing thin (1.2.7) with native extensions
122
+ Using bundler (1.0.0.rc.3)
123
+
124
+ In this case, the two gems have their own set of dependencies, but they share
125
+ `rack` in common. If you run `bundle update thin`, bundler will update `daemons`,
126
+ `eventmachine` and `rack`, which are dependencies of `thin`, but not `open4` or
127
+ `perftools.rb`, which are dependencies of `rack-perftools_profiler`. Note that
128
+ `bundle update thin` will update `rack` even though it's _also_ a dependency of
129
+ `rack-perftools_profiler`.
130
+
131
+ `In short`, when you update a gem using `bundle update`, bundler will update all
132
+ dependencies of that gem, including those that are also dependencies of another gem.
133
+
134
+ In this scenario, updating the `thin` version manually in the Gemfile(5),
135
+ and then running [bundle install(1)][bundle-install] will only update `daemons` and `eventmachine`,
136
+ but not `rack`. For more information, see the `CONSERVATIVE UPDATING` section
137
+ of [bundle install(1)][bundle-install].
138
+
139
+ ## RECOMMENDED WORKFLOW
140
+
141
+ In general, when working with an application managed with bundler, you should
142
+ use the following workflow:
143
+
144
+ * After you create your Gemfile(5) for the first time, run
145
+
146
+ $ bundle install
147
+
148
+ * Check the resulting `Gemfile.lock` into version control
149
+
150
+ $ git add Gemfile.lock
151
+
152
+ * When checking out this repository on another development machine, run
153
+
154
+ $ bundle install
155
+
156
+ * When checking out this repository on a deployment machine, run
157
+
158
+ $ bundle install --deployment
159
+
160
+ * After changing the Gemfile(5) to reflect a new or update dependency, run
161
+
162
+ $ bundle install
163
+
164
+ * Make sure to check the updated `Gemfile.lock` into version control
165
+
166
+ $ git add Gemfile.lock
167
+
168
+ * If [bundle install(1)][bundle-install] reports a conflict, manually update the specific
169
+ gems that you changed in the Gemfile(5)
170
+
171
+ $ bundle update rails thin
172
+
173
+ * If you want to update all the gems to the latest possible versions that
174
+ still match the gems listed in the Gemfile(5), run
175
+
176
+ $ bundle update
@@ -0,0 +1,80 @@
1
+ bundle(1) -- Ruby Dependency Management
2
+ =======================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bundle` COMMAND [--no-color] [--verbose] [ARGS]
7
+
8
+ ## DESCRIPTION
9
+
10
+ Bundler manages an `application's dependencies` through its entire life
11
+ across many machines systematically and repeatably.
12
+
13
+ See [the bundler website](http://gembundler.com) for information on getting
14
+ started, and Gemfile(5) for more information on the `Gemfile` format.
15
+
16
+ ## OPTIONS
17
+
18
+ * `--no-color`:
19
+ Prints all output without color
20
+
21
+ * `--verbose`:
22
+ Prints out additional logging information
23
+
24
+ ## BUNDLE COMMANDS
25
+
26
+ We divide `bundle` subcommands into primary commands and utilities.
27
+
28
+ ## PRIMARY COMMANDS
29
+
30
+ * [bundle install(1)][bundle-install]:
31
+ Install the gems specified by the `Gemfile` or `Gemfile.lock`
32
+
33
+ * [bundle update(1)][bundle-update]:
34
+ Update dependencies to their latest versions
35
+
36
+ * [bundle package(1)][bundle-package]:
37
+ Package the .gem files required by your application into the
38
+ `vendor/cache` directory
39
+
40
+ * [bundle exec(1)][bundle-exec]:
41
+ Execute a script in the context of the current bundle
42
+
43
+ * [bundle config(1)][bundle-config]:
44
+ Specify and read configuration options for bundler
45
+
46
+ ## UTILITIES
47
+
48
+ * `bundle check(1)`:
49
+ Determine whether the requirements for your application are installed
50
+ and available to bundler
51
+
52
+ * `bundle list(1)`:
53
+ Show all of the gems in the current bundle
54
+
55
+ * `bundle show(1)`:
56
+ Show the source location of a particular gem in the bundle
57
+
58
+ * `bundle console(1)`:
59
+ Start an IRB session in the context of the current bundle
60
+
61
+ * `bundle open(1)`:
62
+ Open an installed gem in the editor
63
+
64
+ * `bundle viz(1)`:
65
+ Generate a visual representation of your dependencies
66
+
67
+ * `bundle init(1)`:
68
+ Generate a simple `Gemfile`, placed in the current directory
69
+
70
+ * `bundle gem(1)`:
71
+ Create a simple gem, suitable for development with bundler
72
+
73
+ ## OBSOLETE
74
+
75
+ These commands are obsolete and should no longer be used
76
+
77
+ * `bundle lock(1)`
78
+ * `bundle unlock(1)`
79
+ * `bundle cache(1)`
80
+
@@ -0,0 +1,279 @@
1
+ Gemfile(5) -- A format for describing gem dependencies for Ruby programs
2
+ ========================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ A `Gemfile` describes the gem dependencies required to execute associated
7
+ Ruby code.
8
+
9
+ Place the `Gemfile` in the root of the directory containing the associated
10
+ code. For instance, in a Rails application, place the `Gemfile` in the same
11
+ directory as the `Rakefile`.
12
+
13
+ ## SYNTAX
14
+
15
+ A `Gemfile` is evaluated as Ruby code, in a context which makes available
16
+ a number of methods used to describe the gem requirements.
17
+
18
+ ## SOURCES (#source)
19
+
20
+ At the top of the `Gemfile`, add one line for each `Rubygems` source that
21
+ might contain the gems listed in the `Gemfile`.
22
+
23
+ source "http://rubygems.org"
24
+ source "http://gems.github.com"
25
+
26
+ Each of these _source_s `MUST` be a valid Rubygems repository.
27
+
28
+ ## GEMS (#gem)
29
+
30
+ Specify gem requirements using the `gem` method, with the following arguments.
31
+ All parameters are `OPTIONAL` unless otherwise specified.
32
+
33
+ ### NAME (required)
34
+
35
+ For each gem requirement, list a single _gem_ line.
36
+
37
+ gem "nokogiri"
38
+
39
+ ### VERSION
40
+
41
+ Each _gem_ `MAY` have one or more version specifiers.
42
+
43
+ gem "nokogiri", ">= 1.4.2"
44
+ gem "RedCloth", ">= 4.1.0", "< 4.2.0"
45
+
46
+ ### REQUIRE AS (:require)
47
+
48
+ Each _gem_ `MAY` specify its main file, which should be used when autorequiring
49
+ (`Bundler.require`).
50
+
51
+ gem "sqlite3-ruby", :require => "sqlite3"
52
+
53
+ This defaults to the name of the gem itself. For instance, these are identical:
54
+
55
+ gem "nokogiri"
56
+ gem "nokogiri", :require => "nokogiri"
57
+
58
+ ### GROUPS (:group or :groups)
59
+
60
+ Each _gem_ `MAY` specify membership in one or more groups. Any _gem_ that does
61
+ not specify membership in any group is placed in the `default` group.
62
+
63
+ gem "rspec", :group => :test
64
+ gem "wirble", :groups => [:development, :test]
65
+
66
+ The Bundler runtime allows its two main methods, `Bundler.setup` and
67
+ `Bundler.require`, to limit their impact to particular groups.
68
+
69
+ # setup adds gems to Ruby's load path
70
+ Bundler.setup # defaults to all groups
71
+ require "bundler/setup" # same as Bundler.setup
72
+ Bundler.setup(:default) # only set up the _default_ group
73
+ Bundler.setup(:test) # only set up the _test_ group (but `not` _default_)
74
+ Bundler.setup(:default, :test) # set up the _default_ and _test_ groups, but no others
75
+
76
+ # require requires all of the gems in the specified groups
77
+ Bundler.require # defaults to just the _default_ group
78
+ Bundler.require(:default) # identical
79
+ Bundler.require(:default, :test) # requires the _default_ and _test_ groups
80
+ Bundler.require(:test) # requires just the _test_ group
81
+
82
+ The Bundler CLI allows you to specify a list of groups whose gems `bundle install` should
83
+ not install with the `--without` option. To specify multiple groups to ignore, specify a
84
+ list of groups separated by spaces.
85
+
86
+ bundle install --without test
87
+ bundle install --without development test
88
+
89
+ After running `bundle install --without test`, bundler will remember that you excluded
90
+ the test group in the last installation. The next time you run `bundle install`,
91
+ without any `--without option`, bundler will recall it.
92
+
93
+ Also, calling `Bundler.setup` with no parameters, or calling `require "bundler/setup"`
94
+ will setup all groups except for the ones you excluded via `--without` (since they
95
+ are obviously not available).
96
+
97
+ Note that on `bundle install`, bundler downloads and evaluates all gems, in order to
98
+ create a single canonical list of all of the required gems and their dependencies.
99
+ This means that you cannot list different versions of the same gems in different
100
+ groups. For more details, see [Understanding Bundler](http://gembundler.com/rationale.html).
101
+
102
+ ### PLATFORMS (:platforms)
103
+
104
+ If a gem should only be used in a particular platform or set of platforms, you can
105
+ specify them. Platforms are essentially identical to groups, except that you do not
106
+ need to use the `--without` install-time flag to exclude groups of gems for other
107
+ platforms.
108
+
109
+ There are a number of `Gemfile` platforms:
110
+
111
+ * `ruby`:
112
+ C Ruby (MRI) or Rubinius, but `NOT` Windows
113
+ * `ruby_18`:
114
+ _ruby_ `AND` version 1.8
115
+ * `ruby_19`:
116
+ _ruby_ `AND` version 1.9
117
+ * `mri`:
118
+ Same as _ruby_, but not Rubinius
119
+ * `mri_18`:
120
+ _mri_ `AND` version 1.8
121
+ * `mri_19`:
122
+ _mri_ `AND` version 1.9
123
+ * `jruby`:
124
+ JRuby
125
+ * `mswin`:
126
+ Windows
127
+ * `mingw`:
128
+ Windows 'mingw32' platform (aka RubyInstaller)
129
+ * `mingw_18`:
130
+ _mingw_ `AND` version 1.8
131
+ * `mingw_19`:
132
+ _mingw_ `AND` version 1.9
133
+
134
+ As with groups, you can specify one or more platforms:
135
+
136
+ gem "weakling", :platforms => :jruby
137
+ gem "ruby-debug", :platforms => :mri_18
138
+ gem "nokogiri", :platforms => [:mri_18, :jruby]
139
+
140
+ All operations involving groups (`bundle install`, `Bundler.setup`,
141
+ `Bundler.require`) behave exactly the same as if any groups not
142
+ matching the current platform were explicitly excluded.
143
+
144
+ ### GIT (:git)
145
+
146
+ If necessary, you can specify that a gem is located at a particular
147
+ git repository. The repository can be public (`http://github.com/rails/rails.git`)
148
+ or private (`git@github.com:rails/rails.git`). If the repository is private,
149
+ the user that you use to run `bundle install` `MUST` have the appropriate
150
+ keys available in their `$HOME/.ssh`.
151
+
152
+ Git repositories are specified using the `:git` parameter. The `group`,
153
+ `platforms`, and `require` options are available and behave exactly the same
154
+ as they would for a normal gem.
155
+
156
+ gem "rails", :git => "git://github.com/rails/rails.git"
157
+
158
+ A git repository `SHOULD` have at least one file, at the root of the
159
+ directory containing the gem, with the extension `.gemspec`. This file
160
+ `MUST` contain a valid gem specification, as expected by the `gem build`
161
+ command. It `MUST NOT` have any dependencies, other than on the files in
162
+ the git repository itself and any built-in functionality of Ruby or Rubygems.
163
+
164
+ If a git repository does not have a `.gemspec`, bundler will attempt to
165
+ create one, but it will not contain any dependencies, executables, or
166
+ C extension compilation instructions. As a result, it may fail to properly
167
+ integrate into your application.
168
+
169
+ If a git repository does have a `.gemspec` for the gem you attached it
170
+ to, a version specifier, if provided, means that the git repository is
171
+ only valid if the `.gemspec` specifies a version matching the version
172
+ specifier. If not, bundler will print a warning.
173
+
174
+ gem "rails", "2.3.8", :git => "git://github.com/rails/rails.git"
175
+ # bundle install will fail, because the .gemspec in the rails
176
+ # repository's master branch specifies version 3.0.0
177
+
178
+ If a git repository does `not` have a `.gemspec` for the gem you attached
179
+ it to, a version specifier `MUST` be provided. Bundler will use this
180
+ version in the simple `.gemspec` it creates.
181
+
182
+ Git repositories support a number of additional options.
183
+
184
+ * `branch`, `tag`, and `ref`:
185
+ You `MUST` only specify at most one of these options. The default
186
+ is `:branch => "master"`
187
+ * `submodules`:
188
+ Specify `:submodules => true` to cause bundler to expand any
189
+ submodules included in the git repository
190
+
191
+ If a git repository contains multiple `.gemspecs`, each `.gemspec`
192
+ represents a gem located at the same place in the file system as
193
+ the `.gemspec`.
194
+
195
+ |~rails [git root]
196
+ | |-rails.gemspec [rails gem located here]
197
+ |~actionpack
198
+ | |-actionpack.gemspec [actionpack gem located here]
199
+ |~activesupport
200
+ | |-activesupport.gemspec [activesupport gem located here]
201
+ ...
202
+
203
+ To install a gem located in a git repository, bundler changes to
204
+ the directory containing the gemspec, runs `gem build name.gemspec`
205
+ and then installs the resulting gem. The `gem build` command,
206
+ which comes standard with Rubygems, evaluates the `.gemspec` in
207
+ the context of the directory in which it is located.
208
+
209
+ ### PATH (:path)
210
+
211
+ You can specify that a gem is located in a particular location
212
+ on the file system. Relative paths are resolved relative to the
213
+ directory containing the `Gemfile`.
214
+
215
+ Similar to the semantics of the `:git` option, the `:path`
216
+ option requires that the directory in question either contains
217
+ a `.gemspec` for the gem, or that you specify an explicit
218
+ version that bundler should use.
219
+
220
+ Unlike `:git`, bundler does not compile C extensions for
221
+ gems specified as paths.
222
+
223
+ gem "rails", :path => "vendor/rails"
224
+
225
+ ## BLOCK FORM OF GIT, PATH, GROUP and PLATFORMS
226
+
227
+ The `:git`, `:path`, `:group`, and `:platforms` options may be
228
+ applied to a group of gems by using block form.
229
+
230
+ git "git://github.com/rails/rails.git" do
231
+ gem "activesupport"
232
+ gem "actionpack"
233
+ end
234
+
235
+ platforms :ruby do
236
+ gem "ruby-debug"
237
+ gem "sqlite3-ruby"
238
+ end
239
+
240
+ group :development do
241
+ gem "wirble"
242
+ gem "faker"
243
+ end
244
+
245
+ In the case of the `git` block form, the `:ref`, `:branch`, `:tag`,
246
+ and `:submodules` options may be passed to the `git` method, and
247
+ all gems in the block will inherit those options.
248
+
249
+ ## GEMSPEC (#gemspec)
250
+
251
+ If you wish to use Bundler to help install dependencies for a gem while it is
252
+ being developed, use the `gemspec` method to pull in the dependencies listed in
253
+ the `.gemspec` file.
254
+
255
+ The `gemspec` method adds any runtime dependencies as gem requirements in the
256
+ default group. It also adds development dependencies as gem requirements in the
257
+ `development` group. Finally, it adds a gem requirement on your project (`:path
258
+ => '.'`). In conjunction with `Bundler.setup`, this allows you to require project
259
+ files in your test code as you would if the project were installed as a gem; you
260
+ need not manipulate the load path manually or require project files via relative
261
+ paths.
262
+
263
+ The `gemspec` method supports optional `:path`, `:name`, and `:development_group`
264
+ options, which control where bundler looks for the `.gemspec`, what named
265
+ `.gemspec` it uses (if more than one is present), and which group development
266
+ dependencies are included in.
267
+
268
+ ## SOURCE PRIORITY
269
+
270
+ When attempting to locate a gem to satisfy a gem requirement,
271
+ bundler uses the following priority order:
272
+
273
+ 1. The source explicitly attached to the gem (using `:path` or `:git`)
274
+ 2. For implicit gems (dependencies of explicit gems), any git or path
275
+ repository otherwise declared. This results in bundler prioritizing the
276
+ ActiveSupport gem from the Rails git repository over ones from
277
+ `rubygems.org`
278
+ 3. The sources specified via `source`, in the order in which they were
279
+ declared in the `Gemfile`.