Permalink
Browse files

Merge branch '1-0-stable'

Conflicts:
	CHANGELOG.md
	lib/bundler/cli.rb
	lib/bundler/index.rb
	lib/bundler/version.rb
  • Loading branch information...
2 parents 814de81 + a250f48 commit ec4eacdbba6c8df1afe01d0dffecaf51b164d311 @indirect indirect committed Apr 11, 2011
View
@@ -22,6 +22,37 @@ Removed:
- Removed bundle install --production
- Removed bundle install --disable-shared-gems
+## 1.0.12 (April 8, 2011)
+
+Features:
+
+ - Add --no-deployment option to `install` for disabling it on dev machines
+ - Better error message when git fails and cache is present (@parndt)
+ - Honor :bundle_cmd in cap `rake` command (@voidlock, @cgriego)
+
+Bugfixes:
+
+ - Compatibility with Rubygems 1.7 and Rails 2.3 and vendored gems (@evanphx)
+ - Fix changing gem order in lock (@gucki)
+ - Remove color escape sequences when displaying man pages (@bgreenlee)
+ - Fix creating GEM_HOME on both JRuby 1.5 and 1.6 (@nickseiger)
+ - Fix gems without a gemspec and directories in bin/ (@epall)
+ - Fix --no-prune option for `bundle install` (@cmeiklejohn)
+
+## 1.0.11 (April 1, 2011)
+
+Features:
+
+ - Compatibility with Rubygems 1.6 and 1.7
+ - Better error messages when a git command fails
+
+Bugfixes:
+
+ - Don't always update gemspec gems (@carllerche)
+ - Remove ivar warnings (@jackdempsey)
+ - Fix occasional git failures in zsh (@jonah-carbonfive)
+ - Consistent lock for gems with double deps like Cap (@akahn)
+
## 1.0.10 (February 1, 2011)
Bugfixes:
View
@@ -60,7 +60,7 @@ begin
namespace :rubygems do
# Rubygems 1.3.5, 1.3.6, and HEAD specs
rubyopt = ENV["RUBYOPT"]
- %w(master v1.3.6 v1.3.7 v1.4.0 v1.4.1 v1.5.0).each do |rg|
+ %w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.1 v1.7.2).each do |rg|
desc "Run specs with Rubygems #{rg}"
RSpec::Core::RakeTask.new(rg) do |t|
t.rspec_opts = %w(-fs --color)
@@ -71,8 +71,11 @@ begin
unless File.directory?("tmp/rubygems")
system("git clone git://github.com/rubygems/rubygems.git tmp/rubygems")
end
- system("cd tmp/rubygems && git checkout #{rg}")
- system("git pull") if rg == "master"
+ Dir.chdir("tmp/rubygems") do
+ system("git remote update")
+ system("git checkout #{rg}")
+ system("git pull origin master") if rg == "master"
+ end
ENV["RUBYOPT"] = "-I#{File.expand_path("tmp/rubygems/lib")} #{rubyopt}"
end
View
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
s.name = "bundler"
s.version = Bundler::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ["Carl Lerche", "Yehuda Katz", "André Arko", "Terence Lee"]
- s.email = ["carlhuda@engineyard.com"]
+ s.authors = ["André Arko", "Terence Lee", "Carl Lerche", "Yehuda Katz"]
+ s.email = ["andre@arko.net"]
s.homepage = "http://gembundler.com"
s.summary = %q{The best way to manage your application's dependencies}
s.description = %q{Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably}
@@ -25,6 +25,5 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split("\n") + man_files
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = %w(bundle)
- s.default_executable = "bundle"
s.require_paths = ["lib"]
end
View
@@ -202,7 +202,7 @@ def default_lockfile
end
def requires_sudo?
- return @requires_sudo if @checked_for_sudo
+ return @requires_sudo if defined?(@checked_for_sudo) && @checked_for_sudo
path = bundle_path
path = path.parent until path.exist?
@@ -267,7 +267,9 @@ def configure_gem_home_and_path
ENV["GEM_HOME"] = bundle_path.to_s
end
- FileUtils.mkdir_p bundle_path.to_s
+ # TODO: This mkdir_p is only needed for JRuby <= 1.5 and should go away (GH #602)
+ FileUtils.mkdir_p bundle_path.to_s rescue nil
+
Gem.clear_paths
end
@@ -7,5 +7,5 @@
Capistrano::Configuration.instance(:must_exist).load do
after "deploy:update_code", "bundle:install"
Bundler::Deployment.define_task(self, :task, :except => { :no_release => true })
- set :rake, 'bundle exec rake'
+ set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
end
View
@@ -46,7 +46,7 @@ def help(cli = nil)
if have_groff? && root !~ %r{^file:/.+!/META-INF/jruby.home/.+}
groff = "groff -Wall -mtty-char -mandoc -Tascii"
- pager = ENV['MANPAGER'] || ENV['PAGER'] || 'less'
+ pager = ENV['MANPAGER'] || ENV['PAGER'] || 'less -R'
Kernel.exec "#{groff} #{root}/#{command} | #{pager}"
else
@@ -189,12 +189,19 @@ def install
Bundler.settings[:frozen] = '1'
end
+ # When install is called with --no-deployment, disable deployment mode
+ if opts[:deployment] == false
+ Bundler.settings.delete(:frozen)
+ opts[:system] = true
+ end
+
# Can't use Bundler.settings for this because settings needs gemfile.dirname
Bundler.settings[:path] = nil if opts[:system]
Bundler.settings[:path] = "vendor/bundle" if opts[:deployment]
Bundler.settings[:path] = opts[:path] if opts[:path]
Bundler.settings[:path] ||= "bundle" if opts[:standalone]
Bundler.settings[:bin] = opts["binstubs"] if opts[:binstubs]
+ Bundler.settings[:no_prune] = true if opts["no-prune"]
Bundler.settings[:disable_shared_gems] = '1' if Bundler.settings[:path]
Bundler.settings.without = opts[:without] unless opts[:without].empty?
Bundler.ui.be_quiet! if opts[:quiet]
@@ -272,7 +279,7 @@ def show(gem_name = nil)
def cache
Bundler.definition.resolve_with_cache!
Bundler.load.cache
- Bundler.settings[:no_prune] = true if options[:no_prune]
+ Bundler.settings[:no_prune] = true if options["no-prune"]
Bundler.load.lock
rescue GemNotFound => e
Bundler.ui.error(e.message)
View
@@ -229,7 +229,7 @@ def to_lock
handled = []
dependencies.
- sort_by { |d| d.name }.
+ sort_by { |d| d.to_s }.
each do |dep|
next if handled.include?(dep.name)
out << dep.to_lock
@@ -239,11 +239,17 @@ def to_lock
out
end
- def ensure_equivalent_gemfile_and_lockfile
+ def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
changes = false
- msg = "You have modified your Gemfile in development but did not check\n" \
- "the resulting snapshot (Gemfile.lock) into version control"
+ msg = "You are trying to install in deployment mode after changing\n" \
+ "your Gemfile. Run `bundle install` elsewhere and add the\n" \
+ "updated Gemfile.lock to version control."
+
+ unless explicit_flag
+ msg += "\n\nIf this is a development machine, remove the Gemfile " \
+ "freeze \nby running `bundle install --no-deployment`."
+ end
added = []
deleted = []
@@ -291,6 +297,7 @@ def ensure_equivalent_gemfile_and_lockfile
msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any?
msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any?
+ msg << "\n"
raise ProductionError, msg if added.any? || deleted.any? || changed.any?
end
@@ -371,8 +378,10 @@ def converge_locked_specs
# If the spec is no longer in the path source, unlock it. This
# commonly happens if the version changed in the gemspec
next unless other
+
+ deps2 = other.dependencies.select { |d| d.type != :development }
# If the dependencies of the path source have changed, unlock it
- next unless s.dependencies.sort == other.dependencies.sort
+ next unless s.dependencies.sort == deps2.sort
end
converged << s
@@ -72,7 +72,8 @@ def to_lock
out = " #{name}"
unless requirement == Gem::Requirement.default
- out << " (#{requirement.to_s})"
+ reqs = requirement.requirements.map{|o,v| "#{o} #{v}" }
+ out << " (#{reqs.join(', ')})"
end
out << '!' if source
View
@@ -127,11 +127,10 @@ def spec_satisfies_dependency?(spec, dep)
def search_by_dependency(dependency)
@cache[dependency.hash] ||= begin
specs = specs_by_name(dependency.name)
+ found = specs.select { |spec| dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform) }
wants_prerelease = dependency.requirement.prerelease?
only_prerelease = specs.all? {|spec| spec.version.prerelease? }
- found = specs.select { |spec| dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform) }
-
unless wants_prerelease || only_prerelease
found.reject! { |spec| spec.version.prerelease? }
end
View
@@ -11,7 +11,7 @@ def self.install(root, definition, options = {})
def run(options)
if Bundler.settings[:frozen]
- @definition.ensure_equivalent_gemfile_and_lockfile
+ @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
end
if dependencies.empty?
@@ -36,7 +36,7 @@ def to_lock
out = " #{name} (#{version}-#{platform})\n"
end
- dependencies.sort_by {|d| d.name }.each do |dep|
+ dependencies.sort_by {|d| d.to_s }.each do |dep|
next if dep.type == :development
out << " #{dep.to_lock}\n"
end
@@ -118,11 +118,13 @@ def to_yaml_properties
def to_lock
out = " #{name}"
unless requirement == Gem::Requirement.default
- out << " (#{requirement.to_s})"
+ reqs = requirement.requirements.map{|o,v| "#{o} #{v}" }
+ out << " (#{reqs.join(', ')})"
end
out
end
+ # Backport of performance enhancement added to Rubygems 1.4
def matches_spec?(spec)
# name can be a Regexp, so use ===
return false unless name === spec.name
@@ -133,6 +135,7 @@ def matches_spec?(spec)
end
class Requirement
+ # Backport of performance enhancement added to Rubygems 1.4
def none?
@none ||= (to_s == ">= 0")
end unless allocate.respond_to?(:none?)
View
@@ -16,7 +16,7 @@ def []=(key, value)
end
def delete(key)
- @local_config
+ @local_config.delete(key_for(key))
end
def set_global(key, value)
@@ -123,13 +123,22 @@ def cripple_rubygems(specs)
# === Following hacks are to improve on the generated bin wrappers ===
# Yeah, talk about a hack
- source_index_class = (class << Gem::SourceIndex ; self ; end)
- source_index_class.send(:remove_method, :from_gems_in)
- source_index_class.send(:define_method, :from_gems_in) do |*args|
- source_index = Gem::SourceIndex.new
- source_index.spec_dirs = *args
- source_index.add_specs(*specs)
- source_index
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.7.0')
+ Gem::SourceIndex.send(:define_method, :initialize) do |*args|
+ @gems = {}
+ self.spec_dirs = *args
+ add_specs(*specs)
+ end
+ else
+ # Rubygems versions lower than 1.7 use SourceIndex#from_gems_in
+ source_index_class = (class << Gem::SourceIndex ; self ; end)
+ source_index_class.send(:remove_method, :from_gems_in)
+ source_index_class.send(:define_method, :from_gems_in) do |*args|
+ source_index = Gem::SourceIndex.new
+ source_index.spec_dirs = *args
+ source_index.add_specs(*specs)
+ source_index
+ end
end
# OMG more hacks
View
@@ -308,14 +308,13 @@ def hash
def eql?(o)
o.instance_of?(Path) &&
path.expand_path(Bundler.root) == o.path.expand_path(Bundler.root) &&
- name == o.name &&
version == o.version
end
alias == eql?
def name
- File.basename(@path.to_s)
+ File.basename(path.expand_path(Bundler.root).to_s)
end
def load_spec_files
@@ -342,8 +341,9 @@ def load_spec_files
s.summary = "Fake gemspec for #{@name}"
s.relative_loaded_from = "#{@name}.gemspec"
if expanded_path.join("bin").exist?
- binaries = expanded_path.join("bin").children.map{|c| c.basename.to_s }
- s.executables = binaries
+ binaries = expanded_path.join("bin").children
+ binaries.reject!{|p| File.directory?(p) }
+ s.executables = binaries.map{|c| c.basename.to_s }
end
end
end
@@ -551,7 +551,9 @@ def git(command)
out = %x{git #{command}}
if $?.exitstatus != 0
- raise GitError, "An error has occurred in git when running `git #{command}`. Cannot complete bundling."
+ msg = "Git error: command `git #{command}` in directory #{Dir.pwd} has failed."
+ msg << "\nIf this error persists you could try removing the cache directory '#{cache_path}'" if cached?
+ raise GitError, msg
end
out
else
@@ -602,7 +604,7 @@ def cache
return if has_revision_cached?
Bundler.ui.info "Updating #{uri}"
in_cache do
- git %|fetch --force --quiet --tags "#{uri}" refs/heads/*:refs/heads/*|
+ git %|fetch --force --quiet --tags "#{uri}" "refs/heads/*:refs/heads/*"|
end
else
Bundler.ui.info "Fetching #{uri}"
View
@@ -60,6 +60,7 @@ update process below under [CONSERVATIVE UPDATING][].
* `--deployment`:
Switches bundler's defaults into [deployment mode][DEPLOYMENT MODE].
+ Do not use this flag on development machines.
* `--binstubs[=<directory>]`:
Create a directory (defaults to `bin`) containing an executable
@@ -72,6 +73,8 @@ update process below under [CONSERVATIVE UPDATING][].
Bundler's defaults are optimized for development. To switch to
defaults optimized for deployment, use the `--deployment` flag.
+Do not activate deployment mode on development machines, as it
+will cause in an error when the Gemfile is modified.
1. A `Gemfile.lock` is required.
Oops, something went wrong.

0 comments on commit ec4eacd

Please sign in to comment.