Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Have the gem specification track whether or not it is a no_bundle

  • Loading branch information...
commit 2ae628748ab50c46b1a032351e623d62d7827de9 1 parent 648ac7f
Carl Lerche authored
View
13 lib/bundler/bundle.rb
@@ -20,16 +20,11 @@ def initialize(env)
def install(options = {})
dependencies = @environment.dependencies
sources = @environment.sources
- update = options[:update]
# ========== from env
if only_envs = options[:only]
dependencies.reject! { |d| !only_envs.any? {|env| d.in?(env) } }
end
-
- options[:no_bundle] = dependencies.map do |dep|
- dep.source == SystemGemSource.instance && dep.name
- end.compact
# ==========
# TODO: clean this up
@@ -49,7 +44,7 @@ def install(options = {})
# Check the remote sources if the existing cache does not meet the requirements
# or the user passed --update
- if update || !valid
+ if options[:update] || !valid
Bundler.logger.info "Calculating dependencies..."
bundle = Resolver.resolve(dependencies, [@cache] + sources)
download(bundle, options)
@@ -145,14 +140,14 @@ def only_local(sources)
def download(bundle, options)
bundle.sort_by {|s| s.full_name.downcase }.each do |spec|
- next if options[:no_bundle].include?(spec.name)
+ next if spec.no_bundle?
spec.source.download(spec)
end
end
def do_install(bundle, options)
bundle.each do |spec|
- next if options[:no_bundle].include?(spec.name)
+ next if spec.no_bundle?
spec.loaded_from = @path.join("specifications", "#{spec.full_name}.gemspec")
# Do nothing if the gem is already expanded
next if @path.join("gems", spec.full_name).directory?
@@ -168,7 +163,7 @@ def do_install(bundle, options)
def generate_bins(bundle, options)
bundle.each do |spec|
- next if options[:no_bundle].include?(spec.name)
+ next if spec.no_bundle?
# HAX -- Generate the bin
bin_dir = @bindir
path = @path
View
2  lib/bundler/environment.rb
@@ -82,7 +82,7 @@ def repository
def load_paths_for_specs(specs, options)
load_paths = []
specs.each do |spec|
- next if options[:no_bundle].include?(spec.name)
+ next if spec.no_bundle?
full_gem_path = Pathname.new(spec.full_gem_path)
load_paths << load_path_for(full_gem_path, spec.bindir) if spec.bindir
View
5 lib/bundler/gem_ext.rb
@@ -11,8 +11,9 @@ def app_script_text(bin_file_name)
end
class Specification
- attr_accessor :source
- attr_accessor :location
+ attr_accessor :source, :location, :no_bundle
+
+ alias no_bundle? no_bundle
remove_method(:specification_version) if method_defined?(:specification_version)
View
1  lib/bundler/resolver.rb
@@ -61,6 +61,7 @@ def self.resolve(requirements, sources)
# a smaller index in the array.
ordered = []
result.values.each do |spec1|
+ spec1.no_bundle = true if source_requirements[spec1.name] == SystemGemSource.instance
index = nil
place = ordered.detect do |spec2|
spec1.dependencies.any? { |d| d.name == spec2.name }
View
2  lib/bundler/templates/environment.erb
@@ -21,7 +21,7 @@ module Bundler
@bundled_specs = {}
<% specs.each do |spec| -%>
-<% if options[:no_bundle].include?(spec.name) -%>
+<% if spec.no_bundle? -%>
gem "<%= spec.name %>", "<%= spec.version %>"
<% else -%>
<% path = spec_file_for(spec) -%>
Please sign in to comment.
Something went wrong with that request. Please try again.