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.
- data/CHANGELOG.md +18 -0
- data/ISSUES.md +30 -0
- data/README.md +3 -64
- data/lib/bundler.rb +33 -5
- data/lib/bundler/capistrano.rb +26 -5
- data/lib/bundler/cli.rb +41 -1
- data/lib/bundler/dsl.rb +1 -0
- data/lib/bundler/gem_helper.rb +18 -26
- data/lib/bundler/man/bundle +96 -0
- data/lib/bundler/man/bundle-config +92 -0
- data/lib/bundler/man/bundle-config.txt +108 -0
- data/lib/bundler/man/bundle-exec +107 -0
- data/lib/bundler/man/bundle-exec.txt +115 -0
- data/lib/bundler/man/bundle-install +280 -0
- data/lib/bundler/man/bundle-install.txt +331 -0
- data/lib/bundler/man/bundle-package +49 -0
- data/lib/bundler/man/bundle-package.txt +66 -0
- data/lib/bundler/man/bundle-update +202 -0
- data/lib/bundler/man/bundle-update.txt +207 -0
- data/lib/bundler/man/bundle.txt +83 -0
- data/lib/bundler/man/gemfile.5 +343 -0
- data/lib/bundler/man/gemfile.5.txt +317 -0
- data/lib/bundler/source.rb +4 -25
- data/lib/bundler/templates/Executable +1 -1
- data/lib/bundler/templates/Gemfile +2 -2
- data/lib/bundler/templates/newgem/Gemfile.tt +1 -1
- data/lib/bundler/templates/newgem/Rakefile.tt +1 -1
- data/lib/bundler/templates/newgem/gitignore.tt +2 -1
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -3
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -3
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -4
- data/lib/bundler/vendor/thor/parser/options.rb +9 -1
- data/lib/bundler/vendor/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/util.rb +2 -2
- data/lib/bundler/version.rb +1 -1
- metadata +22 -48
- data/TODO.md +0 -13
- data/bin/bundle.compiled.rbc +0 -486
- data/lib/bundler.rbc +0 -5691
- data/lib/bundler/cli.rbc +0 -10105
- data/lib/bundler/definition.rbc +0 -9423
- data/lib/bundler/dependency.rbc +0 -2650
- data/lib/bundler/dsl.rbc +0 -5861
- data/lib/bundler/environment.rbc +0 -923
- data/lib/bundler/index.rbc +0 -0
- data/lib/bundler/installer.rbc +0 -1634
- data/lib/bundler/lazy_specification.rbc +0 -1721
- data/lib/bundler/lockfile_parser.rbc +0 -2524
- data/lib/bundler/remote_specification.rbc +0 -1058
- data/lib/bundler/resolver.rbc +0 -9067
- data/lib/bundler/rubygems_ext.rbc +0 -4490
- data/lib/bundler/runtime.rbc +0 -3350
- data/lib/bundler/settings.rbc +0 -2951
- data/lib/bundler/shared_helpers.rbc +0 -3614
- data/lib/bundler/source.rbc +0 -15697
- data/lib/bundler/spec_set.rbc +0 -3394
- data/lib/bundler/ui.rbc +0 -1407
- data/lib/bundler/vendor/thor.rbc +0 -5037
- data/lib/bundler/vendor/thor/actions.rbc +0 -4782
- data/lib/bundler/vendor/thor/actions/create_file.rbc +0 -1672
- data/lib/bundler/vendor/thor/actions/directory.rbc +0 -1477
- data/lib/bundler/vendor/thor/actions/empty_directory.rbc +0 -1773
- data/lib/bundler/vendor/thor/actions/file_manipulation.rbc +0 -2877
- data/lib/bundler/vendor/thor/actions/inject_into_file.rbc +0 -1764
- data/lib/bundler/vendor/thor/base.rbc +0 -7795
- data/lib/bundler/vendor/thor/core_ext/file_binary_read.rbc +0 -271
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rbc +0 -1395
- data/lib/bundler/vendor/thor/core_ext/ordered_hash.rbc +0 -1862
- data/lib/bundler/vendor/thor/error.rbc +0 -240
- data/lib/bundler/vendor/thor/invocation.rbc +0 -2050
- data/lib/bundler/vendor/thor/parser.rbc +0 -101
- data/lib/bundler/vendor/thor/parser/argument.rbc +0 -1445
- data/lib/bundler/vendor/thor/parser/arguments.rbc +0 -2661
- data/lib/bundler/vendor/thor/parser/option.rbc +0 -2007
- data/lib/bundler/vendor/thor/parser/options.rbc +0 -3429
- data/lib/bundler/vendor/thor/shell.rbc +0 -1486
- data/lib/bundler/vendor/thor/shell/basic.rbc +0 -4872
- data/lib/bundler/vendor/thor/shell/color.rbc +0 -1659
- data/lib/bundler/vendor/thor/task.rbc +0 -2900
- data/lib/bundler/vendor/thor/util.rbc +0 -3196
- data/lib/bundler/version.rbc +0 -175
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## 1.0.0.rc.6
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Much better documentation for most of the commands and Gemfile
|
6
|
+
format
|
7
|
+
|
8
|
+
Bugfixe:
|
9
|
+
|
10
|
+
- Don't attempt to create directories if they already exist
|
11
|
+
- Fix the capistrano task so that it actually runs
|
12
|
+
- Update the Gemfile template to reference rubygems.org instead
|
13
|
+
of :gemcutter
|
14
|
+
- bundle exec should exit with a non zero exit code when the gem
|
15
|
+
binary does not exist or the file is not executable.
|
16
|
+
- Expand paths in Gemfile relative to the Gemfile and not the current
|
17
|
+
working directory.
|
18
|
+
|
1
19
|
## 1.0.0.rc.5
|
2
20
|
|
3
21
|
Features:
|
data/ISSUES.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Bundler Issues
|
2
|
+
|
3
|
+
## Troubleshooting
|
4
|
+
|
5
|
+
Before reporting a bug, try these troubleshooting steps:
|
6
|
+
|
7
|
+
rm -rf ~/.bundle/ ~/.gem/ .bundle/ Gemfile.lock
|
8
|
+
bundle install
|
9
|
+
|
10
|
+
## Reporting bugs
|
11
|
+
|
12
|
+
If you are still having problems, please report bugs to the [Bundler issue tracker](http://github.com/carlhuda/bundler/issues/).
|
13
|
+
|
14
|
+
Instructions that allow the Bundler team to reproduce your issue are vitally important. When you report a bug, please create a gist of the following information and include a link in your ticket:
|
15
|
+
|
16
|
+
- What version of bundler you are using
|
17
|
+
- What version of Ruby you are using
|
18
|
+
- Whether you are using RVM, and if so what version
|
19
|
+
- Your Gemfile
|
20
|
+
- Your Gemfile.lock
|
21
|
+
- If you are on 0.9, whether you have locked or not
|
22
|
+
- If you are on 1.0, the result of `bundle config`
|
23
|
+
- The command you ran to generate exception(s)
|
24
|
+
- The exception backtrace(s)
|
25
|
+
|
26
|
+
If you are using Rails 2.3, please also include:
|
27
|
+
|
28
|
+
- Your boot.rb file
|
29
|
+
- Your preinitializer.rb file
|
30
|
+
- Your environment.rb file
|
data/README.md
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
### Note: the master branch is currently unstable while 1.0 is in beta.<br>The current stable version of bundler is in the branch named `v0.9`.
|
2
|
-
|
3
1
|
## Bundler : A gem to bundle gems
|
4
2
|
|
5
3
|
Bundler is a tool that manages gem dependencies for your ruby application. It
|
@@ -12,38 +10,6 @@ you run any ruby code in context of the bundle's gem environment.
|
|
12
10
|
|
13
11
|
See [gembundler.com](http://gembundler.com) for up-to-date installation and usage instructions
|
14
12
|
|
15
|
-
## Gem dependency resolution
|
16
|
-
|
17
|
-
One of the most important things that the bundler does is do a
|
18
|
-
dependency resolution on the full list of gems that you specify, all
|
19
|
-
at once. This differs from the one-at-a-time dependency resolution that
|
20
|
-
Rubygems does, which can result in the following problem:
|
21
|
-
|
22
|
-
# On my system:
|
23
|
-
# activesupport 3.0.pre
|
24
|
-
# activesupport 2.3.4
|
25
|
-
# activemerchant 1.4.2
|
26
|
-
# rails 2.3.4
|
27
|
-
#
|
28
|
-
# activemerchant 1.4.2 depends on activesupport >= 2.3.2
|
29
|
-
|
30
|
-
gem "activemerchant", "1.4.2"
|
31
|
-
# results in activating activemerchant, as well as
|
32
|
-
# activesupport 3.0.pre, since it is >= 2.3.2
|
33
|
-
|
34
|
-
gem "rails", "2.3.4"
|
35
|
-
# results in:
|
36
|
-
# can't activate activesupport (= 2.3.4, runtime)
|
37
|
-
# for ["rails-2.3.4"], already activated
|
38
|
-
# activesupport-3.0.pre for ["activemerchant-1.4.2"]
|
39
|
-
|
40
|
-
This is because activemerchant has a broader dependency, which results
|
41
|
-
in the activation of a version of activesupport that does not satisfy
|
42
|
-
a more narrow dependency.
|
43
|
-
|
44
|
-
Bundler solves this problem by evaluating all dependencies at once,
|
45
|
-
so it can detect that all gems *together* require activesupport "2.3.4".
|
46
|
-
|
47
13
|
## Upgrading from Bundler 0.8 to 0.9 and above
|
48
14
|
|
49
15
|
Upgrading to Bundler 0.9 from Bundler 0.8 requires upgrading several
|
@@ -114,39 +80,12 @@ Bundler 0.9 changes the following Bundler 0.8 Gemfile APIs:
|
|
114
80
|
|
115
81
|
### Development
|
116
82
|
|
117
|
-
For information about future plans and changes that will happen
|
118
|
-
|
119
|
-
### Deploying to memory-constrained servers
|
120
|
-
|
121
|
-
When deploying to a server that is memory-constrained, like Dreamhost, you should run `bundle package` on your local development machine, and then check in the resulting `Gemfile.lock` file and `vendor/cache` directory. The lockfile and cached gems will mean bundler can just install the gems immediately, without contacting any gem servers or using a lot of memory to resolve the dependency tree. On the server, you only need to run `bundle install` after you update your deployed code.
|
83
|
+
For information about future plans and changes that will happen in the future, see the [ROADMAP](http://github.com/carlhuda/bundler/blob/master/ROADMAP.md). To see what has changed in each version of bundler, starting with 0.9.5, see the [CHANGELOG](http://github.com/carlhuda/bundler/blob/master/CHANGELOG.md).
|
122
84
|
|
123
85
|
### Other questions
|
124
86
|
|
125
87
|
Any remaining questions may be asked via IRC in [#bundler](irc://irc.freenode.net/bundler) on Freenode, or via email on the [Bundler mailing list](http://groups.google.com/group/ruby-bundler).
|
126
88
|
|
127
|
-
|
128
|
-
|
129
|
-
Before reporting a bug, try these troubleshooting steps:
|
130
|
-
|
131
|
-
rm -rf ~/.bundle/ ~/.gem/ .bundle/ Gemfile.lock
|
132
|
-
bundle install
|
133
|
-
|
134
|
-
If you are still having problems, please report bugs to the github issue tracker for the project, located at [http://github.com/carlhuda/bundler/issues/](http://github.com/carlhuda/bundler/issues/).
|
135
|
-
|
136
|
-
The best possible scenario is a ticket with a fix for the bug and a test for the fix. If that's not possible, instructions to reproduce the issue are vitally important. If you're not sure exactly how to reproduce the issue that you are seeing, create a gist of the following information and include it in your ticket:
|
137
|
-
|
138
|
-
- What version of bundler you are using
|
139
|
-
- What version of Ruby you are using
|
140
|
-
- Whether you are using RVM, and if so what version
|
141
|
-
- Your Gemfile
|
142
|
-
- Your Gemfile.lock
|
143
|
-
- If you are on 0.9, whether you have locked or not
|
144
|
-
- If you are on 1.0, the result of `bundle config`
|
145
|
-
- The command you ran to generate exception(s)
|
146
|
-
- The exception backtrace(s)
|
147
|
-
|
148
|
-
If you are using Rails 2.3, please also include:
|
89
|
+
### Issues
|
149
90
|
|
150
|
-
|
151
|
-
- Your preinitializer.rb file
|
152
|
-
- Your environment.rb file
|
91
|
+
See [ISSUES](http://github.com/carlhuda/bundler/blob/master/ISSUES.md).
|
data/lib/bundler.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'rbconfig'
|
1
2
|
require 'fileutils'
|
2
3
|
require 'pathname'
|
3
4
|
require 'yaml'
|
@@ -38,13 +39,17 @@ module Bundler
|
|
38
39
|
class GemfileError < BundlerError; status_code(4) ; end
|
39
40
|
class PathError < BundlerError; status_code(13) ; end
|
40
41
|
class GitError < BundlerError; status_code(11) ; end
|
41
|
-
class GemspecError < BundlerError; status_code(14) ; end
|
42
42
|
class DeprecatedError < BundlerError; status_code(12) ; end
|
43
43
|
class GemspecError < BundlerError; status_code(14) ; end
|
44
44
|
class DslError < BundlerError; status_code(15) ; end
|
45
45
|
class ProductionError < BundlerError; status_code(16) ; end
|
46
46
|
class InvalidOption < DslError ; end
|
47
47
|
|
48
|
+
|
49
|
+
WINDOWS = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
|
50
|
+
NULL = WINDOWS ? "NUL" : "/dev/null"
|
51
|
+
|
52
|
+
|
48
53
|
class VersionConflict < BundlerError
|
49
54
|
attr_reader :conflicts
|
50
55
|
|
@@ -186,9 +191,6 @@ module Bundler
|
|
186
191
|
SharedHelpers.default_lockfile
|
187
192
|
end
|
188
193
|
|
189
|
-
WINDOWS = Config::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
|
190
|
-
NULL = WINDOWS ? "NUL" : "/dev/null"
|
191
|
-
|
192
194
|
def requires_sudo?
|
193
195
|
path = bundle_path
|
194
196
|
path = path.parent until path.exist?
|
@@ -199,7 +201,7 @@ module Bundler
|
|
199
201
|
|
200
202
|
def mkdir_p(path)
|
201
203
|
if requires_sudo?
|
202
|
-
sudo "mkdir -p '#{path}'"
|
204
|
+
sudo "mkdir -p '#{path}'" unless File.exist?(path)
|
203
205
|
else
|
204
206
|
FileUtils.mkdir_p(path)
|
205
207
|
end
|
@@ -209,6 +211,32 @@ module Bundler
|
|
209
211
|
`sudo -p 'Enter your password to install the bundled RubyGems to your system: ' #{str}`
|
210
212
|
end
|
211
213
|
|
214
|
+
def load_gemspec(file)
|
215
|
+
path = Pathname.new(file)
|
216
|
+
# Eval the gemspec from its parent directory
|
217
|
+
Dir.chdir(path.dirname) do
|
218
|
+
begin
|
219
|
+
Gem::Specification.from_yaml(path.basename)
|
220
|
+
# Raises ArgumentError if the file is not valid YAML
|
221
|
+
rescue ArgumentError, SyntaxError, Gem::EndOfYAMLException, Gem::Exception
|
222
|
+
begin
|
223
|
+
eval(File.read(path.basename), TOPLEVEL_BINDING, path.expand_path.to_s)
|
224
|
+
rescue LoadError => e
|
225
|
+
original_line = e.backtrace.find { |line| line.include?(path.to_s) }
|
226
|
+
msg = "There was a LoadError while evaluating #{path.basename}:\n #{e.message}"
|
227
|
+
msg << " from\n #{original_line}" if original_line
|
228
|
+
msg << "\n"
|
229
|
+
|
230
|
+
if RUBY_VERSION >= "1.9.0"
|
231
|
+
msg << "\nDoes it try to require a relative path? That doesn't work in Ruby 1.9."
|
232
|
+
end
|
233
|
+
|
234
|
+
raise GemspecError, msg
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
212
240
|
private
|
213
241
|
|
214
242
|
def configure_gem_home_and_path
|
data/lib/bundler/capistrano.rb
CHANGED
@@ -1,15 +1,36 @@
|
|
1
1
|
# Capistrano task for Bundler.
|
2
2
|
#
|
3
|
-
# Just add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and
|
4
|
-
# will be activated after each new deployment.
|
5
|
-
# Bundler will install to, set :bundle_dir before deploy:update_code runs.
|
3
|
+
# Just add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and
|
4
|
+
# Bundler will be activated after each new deployment.
|
6
5
|
|
7
6
|
Capistrano::Configuration.instance(:must_exist).load do
|
8
7
|
after "deploy:update_code", "bundle:install"
|
9
8
|
|
10
9
|
namespace :bundle do
|
11
|
-
|
12
|
-
|
10
|
+
desc <<-DESC
|
11
|
+
Install the current Bundler environment. By default, gems will be \
|
12
|
+
installed to the shared/bundle path. Gems in the development and \
|
13
|
+
test group will not be installed. The install command is executed \
|
14
|
+
with the --deployment and --quiet flags. You can override any of \
|
15
|
+
these defaults by setting the variables shown below.
|
16
|
+
|
17
|
+
set :bundle_gemfile, "Gemfile"
|
18
|
+
set :bundle_dir, fetch(:shared_path)+"/bundle"
|
19
|
+
set :bundle_flags, "--deployment --quiet"
|
20
|
+
set :bundle_without, [:development, :test]
|
21
|
+
DESC
|
22
|
+
task :install, :except => { :no_release => true } do
|
23
|
+
bundle_dir = fetch(:bundle_dir, " #{fetch(:shared_path)}/bundle")
|
24
|
+
bundle_without = [*fetch(:bundle_without, [:development, :test])].compact
|
25
|
+
bundle_flags = fetch(:bundle_flags, "--deployment --quiet")
|
26
|
+
bundle_gemfile = fetch(:bundle_gemfile, "Gemfile")
|
27
|
+
|
28
|
+
args = ["--gemfile #{fetch(:latest_release)}/#{bundle_gemfile}"]
|
29
|
+
args << "--path #{bundle_dir}" unless bundle_dir.to_s.empty?
|
30
|
+
args << bundle_flags.to_s
|
31
|
+
args << "--without #{bundle_without.join(" ")}" unless bundle_without.empty?
|
32
|
+
|
33
|
+
run "bundle install #{args.join(' ')}"
|
13
34
|
end
|
14
35
|
end
|
15
36
|
end
|
data/lib/bundler/cli.rb
CHANGED
@@ -23,6 +23,38 @@ module Bundler
|
|
23
23
|
default_task :install
|
24
24
|
class_option "no-color", :type => :boolean, :banner => "Disable colorization in output"
|
25
25
|
|
26
|
+
def help(cli = nil)
|
27
|
+
case cli
|
28
|
+
when "gemfile" then command = "gemfile.5"
|
29
|
+
when nil then command = "bundle"
|
30
|
+
else command = "bundle-#{cli}"
|
31
|
+
end
|
32
|
+
|
33
|
+
manpages = %w(
|
34
|
+
bundle
|
35
|
+
bundle-config
|
36
|
+
bundle-exec
|
37
|
+
bundle-install
|
38
|
+
bundle-package
|
39
|
+
bundle-update
|
40
|
+
gemfile.5)
|
41
|
+
|
42
|
+
if manpages.include?(command)
|
43
|
+
root = File.expand_path("../man", __FILE__)
|
44
|
+
|
45
|
+
if have_groff?
|
46
|
+
groff = "groff -Wall -mtty-char -mandoc -Tascii"
|
47
|
+
pager = ENV['MANPAGER'] || ENV['PAGER'] || 'more'
|
48
|
+
|
49
|
+
Kernel.exec "#{groff} #{root}/#{command} | #{pager}"
|
50
|
+
else
|
51
|
+
puts File.read("#{root}/#{command}.txt")
|
52
|
+
end
|
53
|
+
else
|
54
|
+
super
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
26
58
|
desc "init", "Generates a Gemfile into the current working directory"
|
27
59
|
long_desc <<-D
|
28
60
|
Init generates a default Gemfile in the current working directory. When adding a
|
@@ -296,9 +328,11 @@ module Bundler
|
|
296
328
|
Kernel.exec(*ARGV)
|
297
329
|
rescue Errno::EACCES
|
298
330
|
Bundler.ui.error "bundler: not executable: #{ARGV.first}"
|
331
|
+
exit 126
|
299
332
|
rescue Errno::ENOENT
|
300
333
|
Bundler.ui.error "bundler: command not found: #{ARGV.first}"
|
301
334
|
Bundler.ui.warn "Install missing gem binaries with `bundle install`"
|
335
|
+
exit 127
|
302
336
|
end
|
303
337
|
end
|
304
338
|
|
@@ -428,8 +462,9 @@ module Bundler
|
|
428
462
|
|
429
463
|
constant_name = name.split('_').map{|p| p.capitalize}.join
|
430
464
|
constant_name = constant_name.split('-').map{|q| q.capitalize}.join('::') if constant_name =~ /-/
|
465
|
+
constant_array = constant_name.split('::')
|
431
466
|
FileUtils.mkdir_p(File.join(target, 'lib', name))
|
432
|
-
opts = {:name => name, :constant_name => constant_name}
|
467
|
+
opts = {:name => name, :constant_name => constant_name, :constant_array => constant_array}
|
433
468
|
template(File.join('newgem', 'Gemfile.tt'), File.join(target, 'Gemfile'), opts)
|
434
469
|
template(File.join('newgem', 'Rakefile.tt'), File.join(target, 'Rakefile'), opts)
|
435
470
|
template(File.join('newgem', 'gitignore.tt'), File.join(target, '.gitignore'), opts)
|
@@ -446,6 +481,11 @@ module Bundler
|
|
446
481
|
|
447
482
|
private
|
448
483
|
|
484
|
+
def have_groff?
|
485
|
+
`which groff 2>#{NULL}`
|
486
|
+
$? == 0
|
487
|
+
end
|
488
|
+
|
449
489
|
def locate_gem(name)
|
450
490
|
spec = Bundler.load.specs.find{|s| s.name == name }
|
451
491
|
raise GemNotFound, "Could not find gem '#{name}' in the current bundle." unless spec
|
data/lib/bundler/dsl.rb
CHANGED
@@ -24,6 +24,7 @@ module Bundler
|
|
24
24
|
path = opts && opts[:path] || '.'
|
25
25
|
name = opts && opts[:name] || '*'
|
26
26
|
development_group = opts && opts[:development_group] || :development
|
27
|
+
path = File.expand_path(path, Bundler.default_gemfile.dirname)
|
27
28
|
gemspecs = Dir[File.join(path, "#{name}.gemspec")]
|
28
29
|
|
29
30
|
case gemspecs.size
|
data/lib/bundler/gem_helper.rb
CHANGED
@@ -7,26 +7,28 @@ module Bundler
|
|
7
7
|
GemHelper.new(dir, opts && opts[:name]).install
|
8
8
|
end
|
9
9
|
|
10
|
-
attr_reader :spec_path, :base, :
|
10
|
+
attr_reader :spec_path, :base, :gemspec
|
11
11
|
|
12
12
|
def initialize(base, name = nil)
|
13
13
|
@base = base
|
14
|
-
|
15
|
-
|
14
|
+
gemspecs = name ? [File.join(base, "#{name}.gemspec")] : Dir[File.join(base, "*.gemspec")]
|
15
|
+
raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1
|
16
|
+
@spec_path = gemspecs.first
|
17
|
+
@gemspec = Bundler.load_gemspec(@spec_path)
|
16
18
|
end
|
17
19
|
|
18
20
|
def install
|
19
|
-
desc "Build #{name}-#{
|
21
|
+
desc "Build #{name}-#{version}.gem into the pkg directory"
|
20
22
|
task 'build' do
|
21
23
|
build_gem
|
22
24
|
end
|
23
25
|
|
24
|
-
desc "Build and install #{name}-#{
|
26
|
+
desc "Build and install #{name}-#{version}.gem into system gems"
|
25
27
|
task 'install' do
|
26
28
|
install_gem
|
27
29
|
end
|
28
30
|
|
29
|
-
desc "Create tag #{
|
31
|
+
desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to Rubygems"
|
30
32
|
task 'push' do
|
31
33
|
push_gem
|
32
34
|
end
|
@@ -66,20 +68,13 @@ module Bundler
|
|
66
68
|
Dir[File.join(base, "#{name}-*.gem")].sort_by{|f| File.mtime(f)}.last
|
67
69
|
end
|
68
70
|
|
69
|
-
def determine_name
|
70
|
-
gemspecs = Dir[File.join(base, "*.gemspec")]
|
71
|
-
raise "Unable to determine name from existing gemspec." unless gemspecs.size == 1
|
72
|
-
|
73
|
-
Gem::Specification.load(File.join(base, File.basename(gemspecs.first)[/^.*\.gemspec$/])).name
|
74
|
-
end
|
75
|
-
|
76
71
|
def git_push
|
77
72
|
sh "git push --all"
|
78
73
|
sh "git push --tags"
|
79
74
|
end
|
80
75
|
|
81
76
|
def guard_already_tagged
|
82
|
-
if sh('git tag').split(/\n/).include?(
|
77
|
+
if sh('git tag').split(/\n/).include?(version_tag)
|
83
78
|
raise("This tag has already been committed to the repo.")
|
84
79
|
end
|
85
80
|
end
|
@@ -93,26 +88,23 @@ module Bundler
|
|
93
88
|
end
|
94
89
|
|
95
90
|
def tag_version
|
96
|
-
sh "git tag #{
|
91
|
+
sh "git tag -am 'Version #{version}' #{version_tag}"
|
97
92
|
yield if block_given?
|
98
93
|
rescue
|
99
|
-
sh "git tag -d #{
|
94
|
+
sh "git tag -d #{version_tag}"
|
100
95
|
raise
|
101
96
|
end
|
102
97
|
|
103
|
-
def
|
104
|
-
|
105
|
-
raise("Version file could not be found at #{version_file_path}")
|
106
|
-
end
|
107
|
-
File.read(version_file_path)[/V(ERSION|ersion)\s*=\s*(["'])(.*?)\2/, 3]
|
98
|
+
def version
|
99
|
+
gemspec.version
|
108
100
|
end
|
109
101
|
|
110
|
-
def
|
111
|
-
|
102
|
+
def version_tag
|
103
|
+
"v#{version}"
|
112
104
|
end
|
113
105
|
|
114
|
-
def
|
115
|
-
|
106
|
+
def name
|
107
|
+
gemspec.name
|
116
108
|
end
|
117
109
|
|
118
110
|
def sh(cmd, &block)
|
@@ -132,4 +124,4 @@ module Bundler
|
|
132
124
|
[output, $?]
|
133
125
|
end
|
134
126
|
end
|
135
|
-
end
|
127
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "BUNDLE" "1" "August 2010" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBbundle\fR \- Ruby Dependency Management
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBbundle\fR [\-\-no\-color] COMMAND [ARGS]
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
Bundler manages an \fBapplication\'s dependencies\fR through its entire life across many machines systematically and repeatably\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
See the bundler website \fIhttp://gembundler\.com\fR for information on getting started, and Gemfile(5) for more information on the \fBGemfile\fR format\.
|
17
|
+
.
|
18
|
+
.SH "OPTIONS"
|
19
|
+
.
|
20
|
+
.TP
|
21
|
+
\fB\-\-no\-color\fR
|
22
|
+
Prints all output without color
|
23
|
+
.
|
24
|
+
.SH "BUNDLE COMMANDS"
|
25
|
+
We divide \fBbundle\fR subcommands into primary commands and utilities\.
|
26
|
+
.
|
27
|
+
.SH "PRIMARY COMMANDS"
|
28
|
+
.
|
29
|
+
.TP
|
30
|
+
bundle install(1) \fIbundle\-install\.1\.html\fR
|
31
|
+
Install the gems specified by the \fBGemfile\fR or \fBGemfile\.lock\fR
|
32
|
+
.
|
33
|
+
.TP
|
34
|
+
bundle update(1) \fIbundle\-update\.1\.html\fR
|
35
|
+
Update dependencies to their latest versions
|
36
|
+
.
|
37
|
+
.TP
|
38
|
+
bundle package(1) \fIbundle\-package\.1\.html\fR
|
39
|
+
Package the \.gem files required by your application into the \fBvendor/cache\fR directory
|
40
|
+
.
|
41
|
+
.TP
|
42
|
+
bundle exec(1) \fIbundle\-exec\.1\.html\fR
|
43
|
+
Execute a script in the context of the current bundle
|
44
|
+
.
|
45
|
+
.TP
|
46
|
+
bundle config(1) \fIbundle\-config\.1\.html\fR
|
47
|
+
Specify and read configuration options for bundler
|
48
|
+
.
|
49
|
+
.SH "UTILITIES"
|
50
|
+
.
|
51
|
+
.TP
|
52
|
+
\fBbundle check(1)\fR
|
53
|
+
Determine whether the requirements for your application are installed and available to bundler
|
54
|
+
.
|
55
|
+
.TP
|
56
|
+
\fBbundle list(1)\fR
|
57
|
+
Show all of the gems in the current bundle
|
58
|
+
.
|
59
|
+
.TP
|
60
|
+
\fBbundle show(1)\fR
|
61
|
+
Show the source location of a particular gem in the bundle
|
62
|
+
.
|
63
|
+
.TP
|
64
|
+
\fBbundle console(1)\fR
|
65
|
+
Start an IRB session in the context of the current bundle
|
66
|
+
.
|
67
|
+
.TP
|
68
|
+
\fBbundle open(1)\fR
|
69
|
+
Open an installed gem in the editor
|
70
|
+
.
|
71
|
+
.TP
|
72
|
+
\fBbundle viz(1)\fR
|
73
|
+
Generate a visual representation of your dependencies
|
74
|
+
.
|
75
|
+
.TP
|
76
|
+
\fBbundle init(1)\fR
|
77
|
+
Generate a simple \fBGemfile\fR, placed in the current directory
|
78
|
+
.
|
79
|
+
.TP
|
80
|
+
\fBbundle gem(1)\fR
|
81
|
+
Create a simple gem, suitable for development with bundler
|
82
|
+
.
|
83
|
+
.SH "OBSOLETE"
|
84
|
+
These commands are obsolete and should no longer be used
|
85
|
+
.
|
86
|
+
.IP "\(bu" 4
|
87
|
+
\fBbundle lock(1)\fR
|
88
|
+
.
|
89
|
+
.IP "\(bu" 4
|
90
|
+
\fBbundle unlock(1)\fR
|
91
|
+
.
|
92
|
+
.IP "\(bu" 4
|
93
|
+
\fBbundle cache(1)\fR
|
94
|
+
.
|
95
|
+
.IP "" 0
|
96
|
+
|