summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-02-03 15:30:12 -0800
committerCarlhuda <carlhuda@engineyard.com>2010-02-03 15:30:12 -0800
commiteec57fbd360866323a63226b5d24efc9d94c3268 (patch)
tree7406ebffe46eecbe7595f39bab517e85f032e6af
parent93cda9ad74975b8d4930cfe0591f64bd237e9237 (diff)
downloadbundler-eec57fbd360866323a63226b5d24efc9d94c3268.tar.gz
Updated the bundle install output
-rw-r--r--lib/bundler/installer.rb14
-rw-r--r--lib/bundler/source.rb47
-rw-r--r--lib/bundler/ui.rb8
3 files changed, 45 insertions, 24 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index be712195c6..37707fc16f 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -20,15 +20,19 @@ module Bundler
end
specs.sort_by { |s| s.name }.each do |spec|
- Bundler.ui.info "* #{spec.name} (#{spec.version})"
+ # unless spec.source.is_a?(Source::SystemGems)
+ Bundler.ui.info "Installing #{spec.name} (#{spec.version}) from #{spec.source} "
+ # end
+
if (spec.groups & options[:without]).any?
- Bundler.ui.info " * Not in requested group... skipping."
+ Bundler.ui.debug " * Not in requested group... skipping."
next
end
spec.source.install(spec)
+ Bundler.ui.info ""
end
- Bundler.ui.confirm "You have bundles. Now, go have fun."
+ Bundler.ui.confirm "Your bundle is complete!"
end
def dependencies
@@ -112,9 +116,9 @@ module Bundler
sources.each do |source|
i = source.specs
- Bundler.ui.info "Source: Processing index... "
+ Bundler.ui.debug "Source: Processing index... "
index = i.merge(index).freeze
- Bundler.ui.info "Done."
+ Bundler.ui.debug "Done."
end
index
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index 4556322d5d..9df58eb60d 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -15,6 +15,10 @@ module Bundler
raise ArgumentError, "The source must be an absolute URI" unless @uri.absolute?
end
+ def to_s
+ "rubygems repository at `#{uri}`"
+ end
+
def specs
@specs ||= fetch_specs
end
@@ -22,9 +26,9 @@ module Bundler
def install(spec)
destination = Gem.dir
- Bundler.ui.info " * Downloading..."
+ Bundler.ui.debug " * Downloading..."
gem_path = Gem::RemoteFetcher.fetcher.download(spec, uri, destination)
- Bundler.ui.info " * Installing..."
+ Bundler.ui.debug " * Installing..."
installer = Gem::Installer.new gem_path,
:install_dir => Gem.dir,
:ignore_dependencies => true
@@ -36,14 +40,14 @@ module Bundler
def fetch_specs
index = Index.new
- Bundler.ui.info "Source: Fetching remote index for `#{uri}`... "
+ Bundler.ui.info "Fetching source index from `#{uri}`... "
(main_specs + prerelease_specs).each do |name, version, platform|
next unless Gem::Platform.match(platform)
spec = RemoteSpecification.new(name, version, platform, @uri)
spec.source = self
index << spec
end
- Bundler.ui.info "done."
+ Bundler.ui.info "Done."
index.freeze
end
@@ -76,11 +80,11 @@ module Bundler
end
def to_s
- "System gem source"
+ "system gems"
end
def install(spec)
- Bundler.ui.info " * already installed... skipping"
+ Bundler.ui.debug " * already installed... skipping"
end
end
@@ -89,6 +93,10 @@ module Bundler
@path = options["path"]
end
+ def to_s
+ ".gem files at #{@path}"
+ end
+
def specs
@specs ||= begin
index = Index.new
@@ -106,7 +114,7 @@ module Bundler
def install(spec)
destination = Gem.dir
- Bundler.ui.info " * Installing from pack..."
+ Bundler.ui.debug " * Installing from pack..."
installer = Gem::Installer.new "#{@path}/#{spec.full_name}.gem",
:install_dir => Gem.dir,
:ignore_dependencies => true
@@ -125,6 +133,10 @@ module Bundler
@default_spec = nil
end
+ def to_s
+ "source code at #{@path}"
+ end
+
def default_spec(*args)
return @default_spec if args.empty?
name, version = *args
@@ -161,7 +173,7 @@ module Bundler
end
def install(spec)
- Bundler.ui.info " * Using path `#{path}`..."
+ Bundler.ui.debug " * Using path `#{path}`..."
end
alias specs local_specs
@@ -178,6 +190,11 @@ module Bundler
@ref = options["ref"] || options["branch"] || 'master'
end
+ def to_s
+ ref = @options["ref"] ? @options["ref"][0..6] : @ref
+ "#{@uri} (at #{ref})"
+ end
+
def options
@options.merge("ref" => revision)
end
@@ -186,10 +203,6 @@ module Bundler
Bundler.install_path.join("#{base_name}-#{uri_hash}-#{ref}")
end
- def to_s
- @uri
- end
-
def specs
@specs ||= begin
index = Index.new
@@ -221,12 +234,12 @@ module Bundler
end
def install(spec)
- Bundler.ui.info " * Using git `#{uri}`..."
+ Bundler.ui.debug " * Using git `#{uri}`..."
if @installed
- Bundler.ui.info " * Already checked out revision: #{ref}..."
+ Bundler.ui.debug " * Already checked out revision: #{ref}..."
else
- Bundler.ui.info " * Checking out revision: #{ref}..."
+ Bundler.ui.debug " * Checking out revision: #{ref}..."
FileUtils.mkdir_p(path)
Dir.chdir(path) do
unless File.exist?(".git")
@@ -265,10 +278,10 @@ module Bundler
def cache
if cache_path.exist?
- Bundler.ui.info "Source: Updating `#{uri}`... "
+ Bundler.ui.info "Updating `#{uri}`... "
in_cache { git "fetch --quiet #{uri} master:master" }
else
- Bundler.ui.info "Source: Cloning `#{uri}`... "
+ Bundler.ui.info "Fetching `#{uri}`... "
FileUtils.mkdir_p(cache_path.dirname)
git "clone #{uri} #{cache_path} --bare --no-hardlinks"
end
diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb
index 21f05f10ae..c86fd39b08 100644
--- a/lib/bundler/ui.rb
+++ b/lib/bundler/ui.rb
@@ -17,6 +17,10 @@ module Bundler
@shell = shell
end
+ # TODO: Add debug mode
+ def debug(msg)
+ end
+
def info(msg)
@shell.say(msg)
end
@@ -41,9 +45,9 @@ module Bundler
def say(message)
if message =~ /native extensions/
- @ui.info " * #{message}"
+ @ui.info "with native extensions "
else
- @ui.info(message)
+ @ui.debug(message)
end
end
end