bundler-maglev- 1.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. data/.gitignore +22 -0
  2. data/.travis.yml +32 -0
  3. data/CHANGELOG.md +805 -0
  4. data/ISSUES.md +62 -0
  5. data/LICENSE +23 -0
  6. data/README.md +29 -0
  7. data/Rakefile +212 -0
  8. data/UPGRADING.md +103 -0
  9. data/bin/bundle +22 -0
  10. data/bundler.gemspec +30 -0
  11. data/lib/bundler.rb +286 -0
  12. data/lib/bundler/capistrano.rb +11 -0
  13. data/lib/bundler/cli.rb +520 -0
  14. data/lib/bundler/definition.rb +438 -0
  15. data/lib/bundler/dependency.rb +134 -0
  16. data/lib/bundler/deployment.rb +58 -0
  17. data/lib/bundler/dsl.rb +257 -0
  18. data/lib/bundler/environment.rb +47 -0
  19. data/lib/bundler/gem_helper.rb +151 -0
  20. data/lib/bundler/gem_installer.rb +9 -0
  21. data/lib/bundler/gem_tasks.rb +2 -0
  22. data/lib/bundler/graph.rb +130 -0
  23. data/lib/bundler/index.rb +138 -0
  24. data/lib/bundler/installer.rb +97 -0
  25. data/lib/bundler/lazy_specification.rb +74 -0
  26. data/lib/bundler/lockfile_parser.rb +108 -0
  27. data/lib/bundler/remote_specification.rb +59 -0
  28. data/lib/bundler/resolver.rb +464 -0
  29. data/lib/bundler/rubygems_ext.rb +237 -0
  30. data/lib/bundler/rubygems_integration.rb +349 -0
  31. data/lib/bundler/runtime.rb +152 -0
  32. data/lib/bundler/settings.rb +115 -0
  33. data/lib/bundler/setup.rb +23 -0
  34. data/lib/bundler/shared_helpers.rb +71 -0
  35. data/lib/bundler/source.rb +708 -0
  36. data/lib/bundler/spec_set.rb +135 -0
  37. data/lib/bundler/templates/Executable +16 -0
  38. data/lib/bundler/templates/Gemfile +4 -0
  39. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  40. data/lib/bundler/templates/newgem/Rakefile.tt +1 -0
  41. data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
  42. data/lib/bundler/templates/newgem/gitignore.tt +4 -0
  43. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -0
  44. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  45. data/lib/bundler/templates/newgem/newgem.gemspec.tt +24 -0
  46. data/lib/bundler/ui.rb +73 -0
  47. data/lib/bundler/vendor/thor.rb +358 -0
  48. data/lib/bundler/vendor/thor/actions.rb +314 -0
  49. data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
  50. data/lib/bundler/vendor/thor/actions/create_link.rb +57 -0
  51. data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
  52. data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
  53. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +270 -0
  54. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +109 -0
  55. data/lib/bundler/vendor/thor/base.rb +576 -0
  56. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
  57. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
  58. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
  59. data/lib/bundler/vendor/thor/error.rb +30 -0
  60. data/lib/bundler/vendor/thor/group.rb +273 -0
  61. data/lib/bundler/vendor/thor/invocation.rb +168 -0
  62. data/lib/bundler/vendor/thor/parser.rb +4 -0
  63. data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
  64. data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
  65. data/lib/bundler/vendor/thor/parser/option.rb +120 -0
  66. data/lib/bundler/vendor/thor/parser/options.rb +175 -0
  67. data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
  68. data/lib/bundler/vendor/thor/runner.rb +309 -0
  69. data/lib/bundler/vendor/thor/shell.rb +88 -0
  70. data/lib/bundler/vendor/thor/shell/basic.rb +302 -0
  71. data/lib/bundler/vendor/thor/shell/color.rb +108 -0
  72. data/lib/bundler/vendor/thor/shell/html.rb +121 -0
  73. data/lib/bundler/vendor/thor/task.rb +113 -0
  74. data/lib/bundler/vendor/thor/util.rb +229 -0
  75. data/lib/bundler/vendor/thor/version.rb +3 -0
  76. data/lib/bundler/vendored_thor.rb +7 -0
  77. data/lib/bundler/version.rb +6 -0
  78. data/lib/bundler/vlad.rb +11 -0
  79. data/man/bundle-config.ronn +90 -0
  80. data/man/bundle-exec.ronn +111 -0
  81. data/man/bundle-install.ronn +317 -0
  82. data/man/bundle-package.ronn +59 -0
  83. data/man/bundle-update.ronn +176 -0
  84. data/man/bundle.ronn +80 -0
  85. data/man/gemfile.5.ronn +284 -0
  86. data/man/index.txt +6 -0
  87. data/spec/bundler/gem_helper_spec.rb +143 -0
  88. data/spec/cache/gems_spec.rb +230 -0
  89. data/spec/cache/git_spec.rb +12 -0
  90. data/spec/cache/path_spec.rb +27 -0
  91. data/spec/cache/platform_spec.rb +57 -0
  92. data/spec/install/deploy_spec.rb +197 -0
  93. data/spec/install/deprecated_spec.rb +37 -0
  94. data/spec/install/gems/c_ext_spec.rb +48 -0
  95. data/spec/install/gems/env_spec.rb +107 -0
  96. data/spec/install/gems/flex_spec.rb +313 -0
  97. data/spec/install/gems/groups_spec.rb +259 -0
  98. data/spec/install/gems/packed_spec.rb +84 -0
  99. data/spec/install/gems/platform_spec.rb +192 -0
  100. data/spec/install/gems/resolving_spec.rb +72 -0
  101. data/spec/install/gems/simple_case_spec.rb +770 -0
  102. data/spec/install/gems/sudo_spec.rb +74 -0
  103. data/spec/install/gems/win32_spec.rb +26 -0
  104. data/spec/install/gemspec_spec.rb +125 -0
  105. data/spec/install/git_spec.rb +570 -0
  106. data/spec/install/invalid_spec.rb +35 -0
  107. data/spec/install/path_spec.rb +405 -0
  108. data/spec/install/upgrade_spec.rb +26 -0
  109. data/spec/lock/git_spec.rb +35 -0
  110. data/spec/lock/lockfile_spec.rb +739 -0
  111. data/spec/other/check_spec.rb +221 -0
  112. data/spec/other/config_spec.rb +40 -0
  113. data/spec/other/console_spec.rb +54 -0
  114. data/spec/other/exec_spec.rb +248 -0
  115. data/spec/other/ext_spec.rb +37 -0
  116. data/spec/other/help_spec.rb +39 -0
  117. data/spec/other/init_spec.rb +40 -0
  118. data/spec/other/newgem_spec.rb +46 -0
  119. data/spec/other/open_spec.rb +35 -0
  120. data/spec/other/show_spec.rb +82 -0
  121. data/spec/quality_spec.rb +62 -0
  122. data/spec/resolver/basic_spec.rb +20 -0
  123. data/spec/resolver/platform_spec.rb +82 -0
  124. data/spec/runtime/executable_spec.rb +110 -0
  125. data/spec/runtime/load_spec.rb +107 -0
  126. data/spec/runtime/platform_spec.rb +90 -0
  127. data/spec/runtime/require_spec.rb +231 -0
  128. data/spec/runtime/setup_spec.rb +730 -0
  129. data/spec/runtime/with_clean_env_spec.rb +15 -0
  130. data/spec/spec_helper.rb +92 -0
  131. data/spec/support/builders.rb +597 -0
  132. data/spec/support/helpers.rb +239 -0
  133. data/spec/support/indexes.rb +112 -0
  134. data/spec/support/matchers.rb +77 -0
  135. data/spec/support/path.rb +71 -0
  136. data/spec/support/platforms.rb +53 -0
  137. data/spec/support/ruby_ext.rb +20 -0
  138. data/spec/support/rubygems_ext.rb +37 -0
  139. data/spec/support/rubygems_hax/platform.rb +11 -0
  140. data/spec/support/sudo.rb +21 -0
  141. data/spec/update/gems_spec.rb +122 -0
  142. data/spec/update/git_spec.rb +196 -0
  143. data/spec/update/source_spec.rb +51 -0
  144. metadata +296 -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
data/man/bundle.ronn ADDED
@@ -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,284 @@
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
+ Specify `:require => false` to prevent bundler from requiring the gem, but still
59
+ install it and maintain dependencies.
60
+
61
+ ### GROUPS (:group or :groups)
62
+
63
+ Each _gem_ `MAY` specify membership in one or more groups. Any _gem_ that does
64
+ not specify membership in any group is placed in the `default` group.
65
+
66
+ gem "rspec", :group => :test
67
+ gem "wirble", :groups => [:development, :test]
68
+
69
+ The Bundler runtime allows its two main methods, `Bundler.setup` and
70
+ `Bundler.require`, to limit their impact to particular groups.
71
+
72
+ # setup adds gems to Ruby's load path
73
+ Bundler.setup # defaults to all groups
74
+ require "bundler/setup" # same as Bundler.setup
75
+ Bundler.setup(:default) # only set up the _default_ group
76
+ Bundler.setup(:test) # only set up the _test_ group (but `not` _default_)
77
+ Bundler.setup(:default, :test) # set up the _default_ and _test_ groups, but no others
78
+
79
+ # require requires all of the gems in the specified groups
80
+ Bundler.require # defaults to just the _default_ group
81
+ Bundler.require(:default) # identical
82
+ Bundler.require(:default, :test) # requires the _default_ and _test_ groups
83
+ Bundler.require(:test) # requires just the _test_ group
84
+
85
+ The Bundler CLI allows you to specify a list of groups whose gems `bundle install` should
86
+ not install with the `--without` option. To specify multiple groups to ignore, specify a
87
+ list of groups separated by spaces.
88
+
89
+ bundle install --without test
90
+ bundle install --without development test
91
+
92
+ After running `bundle install --without test`, bundler will remember that you excluded
93
+ the test group in the last installation. The next time you run `bundle install`,
94
+ without any `--without option`, bundler will recall it.
95
+
96
+ Also, calling `Bundler.setup` with no parameters, or calling `require "bundler/setup"`
97
+ will setup all groups except for the ones you excluded via `--without` (since they
98
+ are obviously not available).
99
+
100
+ Note that on `bundle install`, bundler downloads and evaluates all gems, in order to
101
+ create a single canonical list of all of the required gems and their dependencies.
102
+ This means that you cannot list different versions of the same gems in different
103
+ groups. For more details, see [Understanding Bundler](http://gembundler.com/rationale.html).
104
+
105
+ ### PLATFORMS (:platforms)
106
+
107
+ If a gem should only be used in a particular platform or set of platforms, you can
108
+ specify them. Platforms are essentially identical to groups, except that you do not
109
+ need to use the `--without` install-time flag to exclude groups of gems for other
110
+ platforms.
111
+
112
+ There are a number of `Gemfile` platforms:
113
+
114
+ * `ruby`:
115
+ C Ruby (MRI) or Rubinius, but `NOT` Windows
116
+ * `ruby_18`:
117
+ _ruby_ `AND` version 1.8
118
+ * `ruby_19`:
119
+ _ruby_ `AND` version 1.9
120
+ * `mri`:
121
+ Same as _ruby_, but not Rubinius
122
+ * `mri_18`:
123
+ _mri_ `AND` version 1.8
124
+ * `mri_19`:
125
+ _mri_ `AND` version 1.9
126
+ * `rbx`:
127
+ Same as _ruby_, but only Rubinius (not MRI)
128
+ * `jruby`:
129
+ JRuby
130
+ * `mswin`:
131
+ Windows
132
+ * `mingw`:
133
+ Windows 'mingw32' platform (aka RubyInstaller)
134
+ * `mingw_18`:
135
+ _mingw_ `AND` version 1.8
136
+ * `mingw_19`:
137
+ _mingw_ `AND` version 1.9
138
+
139
+ As with groups, you can specify one or more platforms:
140
+
141
+ gem "weakling", :platforms => :jruby
142
+ gem "ruby-debug", :platforms => :mri_18
143
+ gem "nokogiri", :platforms => [:mri_18, :jruby]
144
+
145
+ All operations involving groups (`bundle install`, `Bundler.setup`,
146
+ `Bundler.require`) behave exactly the same as if any groups not
147
+ matching the current platform were explicitly excluded.
148
+
149
+ ### GIT (:git)
150
+
151
+ If necessary, you can specify that a gem is located at a particular
152
+ git repository. The repository can be public (`http://github.com/rails/rails.git`)
153
+ or private (`git@github.com:rails/rails.git`). If the repository is private,
154
+ the user that you use to run `bundle install` `MUST` have the appropriate
155
+ keys available in their `$HOME/.ssh`.
156
+
157
+ Git repositories are specified using the `:git` parameter. The `group`,
158
+ `platforms`, and `require` options are available and behave exactly the same
159
+ as they would for a normal gem.
160
+
161
+ gem "rails", :git => "git://github.com/rails/rails.git"
162
+
163
+ A git repository `SHOULD` have at least one file, at the root of the
164
+ directory containing the gem, with the extension `.gemspec`. This file
165
+ `MUST` contain a valid gem specification, as expected by the `gem build`
166
+ command. It `MUST NOT` have any dependencies, other than on the files in
167
+ the git repository itself and any built-in functionality of Ruby or Rubygems.
168
+
169
+ If a git repository does not have a `.gemspec`, bundler will attempt to
170
+ create one, but it will not contain any dependencies, executables, or
171
+ C extension compilation instructions. As a result, it may fail to properly
172
+ integrate into your application.
173
+
174
+ If a git repository does have a `.gemspec` for the gem you attached it
175
+ to, a version specifier, if provided, means that the git repository is
176
+ only valid if the `.gemspec` specifies a version matching the version
177
+ specifier. If not, bundler will print a warning.
178
+
179
+ gem "rails", "2.3.8", :git => "git://github.com/rails/rails.git"
180
+ # bundle install will fail, because the .gemspec in the rails
181
+ # repository's master branch specifies version 3.0.0
182
+
183
+ If a git repository does `not` have a `.gemspec` for the gem you attached
184
+ it to, a version specifier `MUST` be provided. Bundler will use this
185
+ version in the simple `.gemspec` it creates.
186
+
187
+ Git repositories support a number of additional options.
188
+
189
+ * `branch`, `tag`, and `ref`:
190
+ You `MUST` only specify at most one of these options. The default
191
+ is `:branch => "master"`
192
+ * `submodules`:
193
+ Specify `:submodules => true` to cause bundler to expand any
194
+ submodules included in the git repository
195
+
196
+ If a git repository contains multiple `.gemspecs`, each `.gemspec`
197
+ represents a gem located at the same place in the file system as
198
+ the `.gemspec`.
199
+
200
+ |~rails [git root]
201
+ | |-rails.gemspec [rails gem located here]
202
+ |~actionpack
203
+ | |-actionpack.gemspec [actionpack gem located here]
204
+ |~activesupport
205
+ | |-activesupport.gemspec [activesupport gem located here]
206
+ ...
207
+
208
+ To install a gem located in a git repository, bundler changes to
209
+ the directory containing the gemspec, runs `gem build name.gemspec`
210
+ and then installs the resulting gem. The `gem build` command,
211
+ which comes standard with Rubygems, evaluates the `.gemspec` in
212
+ the context of the directory in which it is located.
213
+
214
+ ### PATH (:path)
215
+
216
+ You can specify that a gem is located in a particular location
217
+ on the file system. Relative paths are resolved relative to the
218
+ directory containing the `Gemfile`.
219
+
220
+ Similar to the semantics of the `:git` option, the `:path`
221
+ option requires that the directory in question either contains
222
+ a `.gemspec` for the gem, or that you specify an explicit
223
+ version that bundler should use.
224
+
225
+ Unlike `:git`, bundler does not compile C extensions for
226
+ gems specified as paths.
227
+
228
+ gem "rails", :path => "vendor/rails"
229
+
230
+ ## BLOCK FORM OF GIT, PATH, GROUP and PLATFORMS
231
+
232
+ The `:git`, `:path`, `:group`, and `:platforms` options may be
233
+ applied to a group of gems by using block form.
234
+
235
+ git "git://github.com/rails/rails.git" do
236
+ gem "activesupport"
237
+ gem "actionpack"
238
+ end
239
+
240
+ platforms :ruby do
241
+ gem "ruby-debug"
242
+ gem "sqlite3-ruby"
243
+ end
244
+
245
+ group :development do
246
+ gem "wirble"
247
+ gem "faker"
248
+ end
249
+
250
+ In the case of the `git` block form, the `:ref`, `:branch`, `:tag`,
251
+ and `:submodules` options may be passed to the `git` method, and
252
+ all gems in the block will inherit those options.
253
+
254
+ ## GEMSPEC (#gemspec)
255
+
256
+ If you wish to use Bundler to help install dependencies for a gem while it is
257
+ being developed, use the `gemspec` method to pull in the dependencies listed in
258
+ the `.gemspec` file.
259
+
260
+ The `gemspec` method adds any runtime dependencies as gem requirements in the
261
+ default group. It also adds development dependencies as gem requirements in the
262
+ `development` group. Finally, it adds a gem requirement on your project (`:path
263
+ => '.'`). In conjunction with `Bundler.setup`, this allows you to require project
264
+ files in your test code as you would if the project were installed as a gem; you
265
+ need not manipulate the load path manually or require project files via relative
266
+ paths.
267
+
268
+ The `gemspec` method supports optional `:path`, `:name`, and `:development_group`
269
+ options, which control where bundler looks for the `.gemspec`, what named
270
+ `.gemspec` it uses (if more than one is present), and which group development
271
+ dependencies are included in.
272
+
273
+ ## SOURCE PRIORITY
274
+
275
+ When attempting to locate a gem to satisfy a gem requirement,
276
+ bundler uses the following priority order:
277
+
278
+ 1. The source explicitly attached to the gem (using `:path` or `:git`)
279
+ 2. For implicit gems (dependencies of explicit gems), any git or path
280
+ repository otherwise declared. This results in bundler prioritizing the
281
+ ActiveSupport gem from the Rails git repository over ones from
282
+ `rubygems.org`
283
+ 3. The sources specified via `source`, searching each source in your `Gemfile`
284
+ from last added to first added.