bundler 1.0.0.rc.5 → 1.0.0.rc.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (81) hide show
  1. data/CHANGELOG.md +18 -0
  2. data/ISSUES.md +30 -0
  3. data/README.md +3 -64
  4. data/lib/bundler.rb +33 -5
  5. data/lib/bundler/capistrano.rb +26 -5
  6. data/lib/bundler/cli.rb +41 -1
  7. data/lib/bundler/dsl.rb +1 -0
  8. data/lib/bundler/gem_helper.rb +18 -26
  9. data/lib/bundler/man/bundle +96 -0
  10. data/lib/bundler/man/bundle-config +92 -0
  11. data/lib/bundler/man/bundle-config.txt +108 -0
  12. data/lib/bundler/man/bundle-exec +107 -0
  13. data/lib/bundler/man/bundle-exec.txt +115 -0
  14. data/lib/bundler/man/bundle-install +280 -0
  15. data/lib/bundler/man/bundle-install.txt +331 -0
  16. data/lib/bundler/man/bundle-package +49 -0
  17. data/lib/bundler/man/bundle-package.txt +66 -0
  18. data/lib/bundler/man/bundle-update +202 -0
  19. data/lib/bundler/man/bundle-update.txt +207 -0
  20. data/lib/bundler/man/bundle.txt +83 -0
  21. data/lib/bundler/man/gemfile.5 +343 -0
  22. data/lib/bundler/man/gemfile.5.txt +317 -0
  23. data/lib/bundler/source.rb +4 -25
  24. data/lib/bundler/templates/Executable +1 -1
  25. data/lib/bundler/templates/Gemfile +2 -2
  26. data/lib/bundler/templates/newgem/Gemfile.tt +1 -1
  27. data/lib/bundler/templates/newgem/Rakefile.tt +1 -1
  28. data/lib/bundler/templates/newgem/gitignore.tt +2 -1
  29. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -3
  30. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -3
  31. data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -4
  32. data/lib/bundler/vendor/thor/parser/options.rb +9 -1
  33. data/lib/bundler/vendor/thor/shell.rb +1 -1
  34. data/lib/bundler/vendor/thor/util.rb +2 -2
  35. data/lib/bundler/version.rb +1 -1
  36. metadata +22 -48
  37. data/TODO.md +0 -13
  38. data/bin/bundle.compiled.rbc +0 -486
  39. data/lib/bundler.rbc +0 -5691
  40. data/lib/bundler/cli.rbc +0 -10105
  41. data/lib/bundler/definition.rbc +0 -9423
  42. data/lib/bundler/dependency.rbc +0 -2650
  43. data/lib/bundler/dsl.rbc +0 -5861
  44. data/lib/bundler/environment.rbc +0 -923
  45. data/lib/bundler/index.rbc +0 -0
  46. data/lib/bundler/installer.rbc +0 -1634
  47. data/lib/bundler/lazy_specification.rbc +0 -1721
  48. data/lib/bundler/lockfile_parser.rbc +0 -2524
  49. data/lib/bundler/remote_specification.rbc +0 -1058
  50. data/lib/bundler/resolver.rbc +0 -9067
  51. data/lib/bundler/rubygems_ext.rbc +0 -4490
  52. data/lib/bundler/runtime.rbc +0 -3350
  53. data/lib/bundler/settings.rbc +0 -2951
  54. data/lib/bundler/shared_helpers.rbc +0 -3614
  55. data/lib/bundler/source.rbc +0 -15697
  56. data/lib/bundler/spec_set.rbc +0 -3394
  57. data/lib/bundler/ui.rbc +0 -1407
  58. data/lib/bundler/vendor/thor.rbc +0 -5037
  59. data/lib/bundler/vendor/thor/actions.rbc +0 -4782
  60. data/lib/bundler/vendor/thor/actions/create_file.rbc +0 -1672
  61. data/lib/bundler/vendor/thor/actions/directory.rbc +0 -1477
  62. data/lib/bundler/vendor/thor/actions/empty_directory.rbc +0 -1773
  63. data/lib/bundler/vendor/thor/actions/file_manipulation.rbc +0 -2877
  64. data/lib/bundler/vendor/thor/actions/inject_into_file.rbc +0 -1764
  65. data/lib/bundler/vendor/thor/base.rbc +0 -7795
  66. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rbc +0 -271
  67. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rbc +0 -1395
  68. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rbc +0 -1862
  69. data/lib/bundler/vendor/thor/error.rbc +0 -240
  70. data/lib/bundler/vendor/thor/invocation.rbc +0 -2050
  71. data/lib/bundler/vendor/thor/parser.rbc +0 -101
  72. data/lib/bundler/vendor/thor/parser/argument.rbc +0 -1445
  73. data/lib/bundler/vendor/thor/parser/arguments.rbc +0 -2661
  74. data/lib/bundler/vendor/thor/parser/option.rbc +0 -2007
  75. data/lib/bundler/vendor/thor/parser/options.rbc +0 -3429
  76. data/lib/bundler/vendor/thor/shell.rbc +0 -1486
  77. data/lib/bundler/vendor/thor/shell/basic.rbc +0 -4872
  78. data/lib/bundler/vendor/thor/shell/color.rbc +0 -1659
  79. data/lib/bundler/vendor/thor/task.rbc +0 -2900
  80. data/lib/bundler/vendor/thor/util.rbc +0 -3196
  81. data/lib/bundler/version.rbc +0 -175
@@ -0,0 +1,317 @@
1
+ GEMFILE(5) GEMFILE(5)
2
+
3
+
4
+
5
+ NAME
6
+ Gemfile - A format for describing gem dependencies for Ruby programs
7
+
8
+ SYNOPSIS
9
+ A Gemfile describes the gem dependencies required to execute associated
10
+ Ruby code.
11
+
12
+ Place the Gemfile in the root of the directory containing the associ-
13
+ ated code. For instance, in a Rails application, place the Gemfile in
14
+ the same directory as the Rakefile.
15
+
16
+ SYNTAX
17
+ A Gemfile is evaluated as Ruby code, in a context which makes available
18
+ a number of methods used to describe the gem requirements.
19
+
20
+ SOURCES (#source)
21
+ At the top of the Gemfile, add one line for each Rubygems source that
22
+ might contain the gems listed in the Gemfile.
23
+
24
+
25
+
26
+ source "http://rubygems.org"
27
+ source "http://gems.github.com"
28
+
29
+
30
+
31
+ Each of these _source_s MUST be a valid Rubygems repository.
32
+
33
+ GEMS (#gem)
34
+ Specify gem requirements using the gem method, with the following argu-
35
+ ments. All parameters are OPTIONAL unless otherwise specified.
36
+
37
+ NAME (required)
38
+ For each gem requirement, list a single gem line.
39
+
40
+
41
+
42
+ gem "nokogiri"
43
+
44
+
45
+
46
+ VERSION
47
+ Each gem MAY have one or more version specifiers.
48
+
49
+
50
+
51
+ gem "nokogiri", ">= 1.4.2"
52
+ gem "RedCloth", ">= 4.1.0", "< 4.2.0"
53
+
54
+
55
+
56
+ REQUIRE AS (:require)
57
+ Each gem MAY specify its main file, which should be used when autore-
58
+ quiring (Bundler.require).
59
+
60
+
61
+
62
+ gem "sqlite3-ruby", :require => "sqlite3"
63
+
64
+
65
+
66
+ This defaults to the name of the gem itself. For instance, these are
67
+ identical:
68
+
69
+
70
+
71
+ gem "nokogiri"
72
+ gem "nokogiri", :require => "nokogiri"
73
+
74
+
75
+
76
+ GROUPS (:group or :groups)
77
+ Each gem MAY specify membership in one or more groups. Any gem that
78
+ does not specify membership in any group is placed in the default
79
+ group.
80
+
81
+
82
+
83
+ gem "rspec", :group => :test
84
+ gem "wirble", :groups => [:development, :test]
85
+
86
+
87
+
88
+ The Bundler runtime allows its two main methods, Bundler.setup and
89
+ Bundler.require, to limit their impact to particular groups.
90
+
91
+
92
+
93
+ # setup adds gems to Ruby's load path
94
+ Bundler.setup # defaults to all groups
95
+ require "bundler/setup" # same as Bundler.setup
96
+ Bundler.setup(:default) # only set up the _default_ group
97
+ Bundler.setup(:test) # only set up the _test_ group (but `not` _default_)
98
+ Bundler.setup(:default, :test) # set up the _default_ and _test_ groups, but no others
99
+
100
+ # require requires all of the gems in the specified groups
101
+ Bundler.require # defaults to just the _default_ group
102
+ Bundler.require(:default) # identical
103
+ Bundler.require(:default, :test) # requires the _default_ and _test_ groups
104
+ Bundler.require(:test) # requires just the _test_ group
105
+
106
+
107
+
108
+ The Bundler CLI allows you to specify a list of groups whose gems bun-
109
+ dle install should not install with the --without option. To specify
110
+ multiple groups to ignore, specify a list of groups separated by spa-
111
+ ces.
112
+
113
+
114
+
115
+ bundle install --without test
116
+ bundle install --without development test
117
+
118
+
119
+
120
+ After running bundle install --without test, bundler will remember that
121
+ you excluded the test group in the last installation. The next time you
122
+ run bundle install, without any --without option, bundler will recall
123
+ it.
124
+
125
+ Also, calling Bundler.setup with no parameters, or calling require
126
+ "bundler/setup" will setup all groups except for the ones you excluded
127
+ via --without (since they are obviously not available).
128
+
129
+ Note that on bundle install, bundler downloads and evaluates all gems,
130
+ in order to create a single canonical list of all of the required gems
131
+ and their dependencies. This means that you cannot list different ver-
132
+ sions of the same gems in different groups. For more details, see
133
+ Understanding Bundler http://gembundler.com/v1.0/understanding.html.
134
+
135
+ PLATFORMS (:platforms)
136
+ If a gem should only be used in a particular platform or set of plat-
137
+ forms, you can specify them. Platforms are essentially identical to
138
+ groups, except that you do not need to use the --without install-time
139
+ flag to exclude groups of gems for other platforms.
140
+
141
+ There are a number of Gemfile platforms:
142
+
143
+ ruby C Ruby (MRI) or Rubinius, but NOT Windows
144
+
145
+ ruby_18
146
+ ruby AND version 1.8
147
+
148
+ ruby_19
149
+ ruby AND version 1.9
150
+
151
+ mri Same as ruby, but not Rubinius
152
+
153
+ mri_18 mri AND version 1.8
154
+
155
+ mri_19 mri AND version 1.9
156
+
157
+ jruby JRuby
158
+
159
+ mswin Windows
160
+
161
+ As with groups, you can specify one or more platforms:
162
+
163
+
164
+
165
+ gem "weakling", :platforms => :jruby
166
+ gem "ruby-debug", :platforms => :mri_18
167
+ gem "nokogiri", :platforms => [:mri_18, :jruby]
168
+
169
+
170
+
171
+ All operations involving groups (bundle install, Bundler.setup,
172
+ Bundler.require) behave exactly the same as if any groups not matching
173
+ the current platform were explicitly excluded.
174
+
175
+ GIT (:git)
176
+ If necessary, you can specify that a gem is located at a particular git
177
+ repository. The repository can be public
178
+ (http://github.com/rails/rails.git) or private
179
+ (git@github.com:rails/rails.git). If the repository is private, the
180
+ user that you use to run bundle install MUST have the appropriate keys
181
+ available in their $HOME/.ssh.
182
+
183
+ Git repositories are specified using the :git parameter. The group,
184
+ platforms, and require options are available and behave exactly the
185
+ same as they would for a normal gem.
186
+
187
+
188
+
189
+ gem "rails", :git => "git://github.com/rails/rails.git"
190
+
191
+
192
+
193
+ A git repository SHOULD have at least one file, at the root of the
194
+ directory containing the gem, with the extension .gemspec. This file
195
+ MUST contain a valid gem specification, as expected by the gem build
196
+ command. It MUST NOT have any dependencies, other than on the files in
197
+ the git repository itself and any built-in functionality of Ruby or
198
+ Rubygems.
199
+
200
+ If a git repository does not have a .gemspec, bundler will attempt to
201
+ create one, but it will not contain any dependencies, executables, or C
202
+ extension compilation instructions. As a result, it may fail to prop-
203
+ erly integrate into your application.
204
+
205
+ If a git repository does have a .gemspec for the gem you attached it
206
+ to, a version specifier, if provided, means that the git repository is
207
+ only valid if the .gemspec specifies a version matching the version
208
+ specifier. If not, bundler will print a warning.
209
+
210
+
211
+
212
+ gem "rails", "2.3.8", :git => "git://github.com/rails/rails.git"
213
+ # bundle install will fail, because the .gemspec in the rails
214
+ # repository's master branch specifies version 3.0.0
215
+
216
+
217
+
218
+ If a git repository does not have a .gemspec for the gem you attached
219
+ it to, a version specifier MUST be provided. Bundler will use this ver-
220
+ sion in the simple .gemspec it creates.
221
+
222
+ Git repositories support a number of additional options.
223
+
224
+ branch, tag, and ref
225
+ You MUST only specify at most one of these options. The default
226
+ is :branch => "master"
227
+
228
+ submodules
229
+ Specify :submodules => true to cause bundler to expand any sub-
230
+ modules included in the git repository
231
+
232
+ If a git repository contains multiple .gemspecs, each .gemspec repre-
233
+ sents a gem located at the same place in the file system as the .gem-
234
+ spec.
235
+
236
+
237
+
238
+ |~rails [git root]
239
+ | |-rails.gemspec [rails gem located here]
240
+ |~actionpack
241
+ | |-actionpack.gemspec [actionpack gem located here]
242
+ |~activesupport
243
+ | |-activesupport.gemspec [activesupport gem located here]
244
+
245
+
246
+
247
+ To install a gem located in a git repository, bundler changes to the
248
+ directory containing the gemspec, runs gem build name.gemspec and then
249
+ installs the resulting gem. The gem build command, which comes standard
250
+ with Rubygems, evaluates the .gemspec in the context of the directory
251
+ in which it is located.
252
+
253
+ PATH (:path)
254
+ You can specify that a gem is located in a particular location on the
255
+ file system. Relative paths are resolved relative to the directory con-
256
+ taining the Gemfile.
257
+
258
+ Similar to the semantics of the :git option, the :path option requires
259
+ that the directory in question either contains a .gemspec for the gem,
260
+ or that you specify an explicit version that bundler should use.
261
+
262
+ Unlike :git, bundler does not compile C extensions for gems specified
263
+ as paths.
264
+
265
+
266
+
267
+ gem "rails", :path => "vendor/rails"
268
+
269
+
270
+
271
+ BLOCK FORM OF GIT, PATH, GROUP and PLATFORMS
272
+ The :git, :path, :group, and :platforms options may be applied to a
273
+ group of gems by using block form.
274
+
275
+
276
+
277
+ git "git://github.com/rails/rails.git" do
278
+ gem "activesupport"
279
+ gem "actionpack"
280
+ end
281
+
282
+ platforms :ruby do
283
+ gem "ruby-debug"
284
+ gem "sqlite3-ruby"
285
+ end
286
+
287
+ group :development do
288
+ gem "wirble"
289
+ gem "faker"
290
+ end
291
+
292
+
293
+
294
+ In the case of the git block form, the :ref, :branch, :tag, and :sub-
295
+ modules options may be passed to the git method, and all gems in the
296
+ block will inherit those options.
297
+
298
+ SOURCE PRIORITY
299
+ When attempting to locate a gem to satisfy a gem requirement, bundler
300
+ uses the following priority order:
301
+
302
+ 1. The source explicitly attached to the gem (using :path or :git)
303
+
304
+ 2. For implicit gems (dependencies of explicit gems), any git or path
305
+ repository otherwise declared. This results in bundler prioritizing
306
+ the ActiveSupport gem from the Rails git repository over ones from
307
+ rubygems.org
308
+
309
+ 3. The sources specified via source, in the order in which they were
310
+ declared in the Gemfile.
311
+
312
+
313
+
314
+
315
+
316
+
317
+ August 2010 GEMFILE(5)
@@ -322,30 +322,7 @@ module Bundler
322
322
 
323
323
  if File.directory?(path)
324
324
  Dir["#{path}/#{@glob}"].each do |file|
325
- file = Pathname.new(file)
326
- # Eval the gemspec from its parent directory
327
- spec = Dir.chdir(file.dirname) do
328
- begin
329
- Gem::Specification.from_yaml(file.basename)
330
- # Raises ArgumentError if the file is not valid YAML
331
- rescue ArgumentError, SyntaxError, Gem::EndOfYAMLException, Gem::Exception
332
- begin
333
- eval(File.read(file.basename), TOPLEVEL_BINDING, file.expand_path.to_s)
334
- rescue LoadError => e
335
- original_line = e.backtrace.find { |line| line.include?(file.to_s) }
336
- msg = "There was a LoadError while evaluating #{file.basename}:\n #{e.message}"
337
- msg << " from\n #{original_line}" if original_line
338
- msg << "\n"
339
-
340
- if RUBY_VERSION >= "1.9.0"
341
- msg << "\nDoes it try to require a relative path? That doesn't work in Ruby 1.9."
342
- end
343
-
344
- raise GemspecError, msg
345
- end
346
- end
347
- end
348
-
325
+ spec = Bundler.load_gemspec(file)
349
326
  if spec
350
327
  spec.loaded_from = file.to_s
351
328
  spec.source = self
@@ -391,7 +368,9 @@ module Bundler
391
368
  def generate_bin
392
369
  return if spec.executables.nil? || spec.executables.empty?
393
370
 
394
- FileUtils.mkdir_p("#{Bundler.tmp}/bin") if Bundler.requires_sudo?
371
+ if Bundler.requires_sudo?
372
+ FileUtils.mkdir_p("#{Bundler.tmp}/bin") unless File.exist?("#{Bundler.tmp}/bin")
373
+ end
395
374
  super
396
375
  if Bundler.requires_sudo?
397
376
  Bundler.mkdir_p "#{Gem.dir}/bin"
@@ -11,4 +11,4 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../<%= relative_gemfile_path %>", __
11
11
  require 'rubygems'
12
12
  require 'bundler/setup'
13
13
 
14
- load Gem.bin_path('<%= spec.name %>', '<%= executable %>')
14
+ load Gem.bin_path('<%= spec.name %>', '<%= executable %>')
@@ -1,4 +1,4 @@
1
1
  # A sample Gemfile
2
- source :gemcutter
3
- #
2
+ source "http://rubygems.org"
3
+
4
4
  # gem "rails"
@@ -1,4 +1,4 @@
1
1
  source :gemcutter
2
2
 
3
3
  # Specify your gem's dependencies in <%=config[:name]%>.gemspec
4
- gemspec
4
+ gemspec
@@ -1,2 +1,2 @@
1
1
  require 'bundler'
2
- Bundler::GemHelper.install_tasks
2
+ Bundler::GemHelper.install_tasks
@@ -1,2 +1,3 @@
1
1
  pkg/*
2
- *.gem
2
+ *.gem
3
+ .bundle
@@ -1,3 +1,7 @@
1
- module <%=config[:constant_name]%>
2
- # Your code goes here...
3
- end
1
+ <%- config[:constant_array].each_with_index do |c,i| -%>
2
+ <%= ' '*i %>module <%= c %>
3
+ <%- end -%>
4
+ <%= ' '*config[:constant_array].size %># Your code goes here...
5
+ <%- (config[:constant_array].size-1).downto(0) do |i| -%>
6
+ <%= ' '*i %>end
7
+ <%- end -%>
@@ -1,3 +1,7 @@
1
- module <%=config[:constant_name]%>
2
- VERSION = "0.0.0"
3
- end
1
+ <%- config[:constant_array].each_with_index do |c,i| -%>
2
+ <%= ' '*i %>module <%= c %>
3
+ <%- end -%>
4
+ <%= ' '*config[:constant_array].size %>VERSION = "0.0.1"
5
+ <%- (config[:constant_array].size-1).downto(0) do |i| -%>
6
+ <%= ' '*i %>end
7
+ <%- end -%>
@@ -1,6 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
3
- require '<%=config[:name]%>/version'
2
+ require File.expand_path("../lib/<%=config[:name]%>/version", __FILE__)
4
3
 
5
4
  Gem::Specification.new do |s|
6
5
  s.name = <%=config[:name].inspect%>
@@ -18,6 +17,6 @@ Gem::Specification.new do |s|
18
17
  s.add_development_dependency "bundler", ">= <%=Bundler::VERSION%>"
19
18
 
20
19
  s.files = `git ls-files`.split("\n")
21
- s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/}
20
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
22
21
  s.require_path = 'lib'
23
- end
22
+ end
@@ -134,7 +134,15 @@ class Thor
134
134
  #
135
135
  def parse_boolean(switch)
136
136
  if current_is_value?
137
- ["true", "TRUE", "t", "T", true].include?(shift)
137
+ if ["true", "TRUE", "t", "T", true].include?(peek)
138
+ shift
139
+ true
140
+ elsif ["false", "FALSE", "f", "F", false].include?(peek)
141
+ shift
142
+ false
143
+ else
144
+ true
145
+ end
138
146
  else
139
147
  @switches.key?(switch) || !no_or_skip?(switch)
140
148
  end