summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/dsl.rb4
-rw-r--r--lib/bundler/env.rb11
-rw-r--r--lib/bundler/friendly_errors.rb2
3 files changed, 15 insertions, 2 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 8ed5cd6a93..d26bd1b375 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -13,6 +13,7 @@ module Bundler
VALID_PLATFORMS = Bundler::Dependency::PLATFORM_MAP.keys.freeze
+ attr_reader :gemspecs
attr_accessor :dependencies
def initialize
@@ -26,6 +27,7 @@ module Bundler
@platforms = []
@env = nil
@ruby_version = nil
+ @gemspecs = []
add_git_sources
end
@@ -65,6 +67,8 @@ module Bundler
gem dep.name, *(dep.requirement.as_list + [:type => :development])
end
end
+
+ @gemspecs << gemspecs.first
when 0
raise InvalidOption, "There are no gemspecs at #{expanded_path}."
else
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index ea82088f39..c6ecdd0f69 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -4,11 +4,12 @@ require "bundler/source/git/git_proxy"
module Bundler
class Env
def write(io)
- io.write report(:print_gemfile => true)
+ io.write report(:print_gemfile => true, :print_gemspecs => true)
end
def report(options = {})
print_gemfile = options.delete(:print_gemfile)
+ print_gemspecs = options.delete(:print_gemspecs)
out = "Environment\n\n"
out << " Bundler #{Bundler::VERSION}\n"
@@ -39,6 +40,14 @@ module Bundler
out << " " << read_file(Bundler.default_lockfile).gsub(/\n/, "\n ") << "\n"
end
+ if print_gemspecs
+ dsl = Dsl.new.tap {|d| d.eval_gemfile(Bundler.default_gemfile) }
+ dsl.gemspecs.each do |gs|
+ out << "\n#{Pathname.new(gs).basename}:"
+ out << "\n\n " << read_file(gs).gsub(/\n/, "\n ") << "\n"
+ end
+ end
+
out
end
diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb
index 53125fd99c..e60f73f7df 100644
--- a/lib/bundler/friendly_errors.rb
+++ b/lib/bundler/friendly_errors.rb
@@ -67,7 +67,7 @@ module Bundler
#{e.class}: #{e.message}
#{e.backtrace.join("\n ")}
- #{Bundler::Env.new.report(:print_gemfile => false).gsub(/\n/, "\n ").strip}
+ #{Bundler::Env.new.report(:print_gemfile => false, :print_gemspecs => false).gsub(/\n/, "\n ").strip}
--- TEMPLATE END ----------------------------------------------------------------
EOS