bundler 1.0.0.beta.2 → 1.0.0.beta.3

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.

@@ -32,9 +32,8 @@ module Bundler
32
32
  end
33
33
 
34
34
  Gem.loaded_specs[spec.name] = spec
35
- spec.load_paths.each do |path|
36
- $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
37
- end
35
+ load_paths = spec.load_paths.reject {|path| $LOAD_PATH.include?(path)}
36
+ $LOAD_PATH.unshift(*load_paths)
38
37
  end
39
38
  self
40
39
  end
@@ -78,6 +77,7 @@ module Bundler
78
77
 
79
78
  Bundler.ui.info "Updating .gem files in vendor/cache"
80
79
  specs.each do |spec|
80
+ next if spec.name == 'bundler'
81
81
  spec.source.cache(spec) if spec.source.respond_to?(:cache)
82
82
  end
83
83
  end
@@ -6,12 +6,12 @@ module Bundler
6
6
  end
7
7
 
8
8
  def [](key)
9
- key = "BUNDLE_#{key.to_s.upcase}"
9
+ key = key_for(key)
10
10
  @config[key] || ENV[key]
11
11
  end
12
12
 
13
13
  def []=(key, value)
14
- key = "BUNDLE_#{key.to_s.upcase}"
14
+ key = key_for(key)
15
15
  unless @config[key] == value
16
16
  @config[key] = value
17
17
  FileUtils.mkdir_p(config_file.dirname)
@@ -32,8 +32,24 @@ module Bundler
32
32
  self[:without] ? self[:without].split(":").map { |w| w.to_sym } : []
33
33
  end
34
34
 
35
+ def path
36
+ path = ENV[key_for(:path)]
37
+
38
+ return path if path
39
+
40
+ if path = self[:path]
41
+ "#{path}/#{Bundler.ruby_scope}"
42
+ else
43
+ Gem.dir
44
+ end
45
+ end
46
+
35
47
  private
36
48
 
49
+ def key_for(key)
50
+ "BUNDLE_#{key.to_s.upcase}"
51
+ end
52
+
37
53
  def config_file
38
54
  Pathname.new("#{@root}/.bundle/config")
39
55
  end
@@ -97,15 +97,15 @@ module Bundler
97
97
  # SUDO HAX
98
98
  if Bundler.requires_sudo?
99
99
  sudo "mkdir -p #{Gem.dir}/gems #{Gem.dir}/specifications"
100
- sudo "mv #{Bundler.tmp}/gems/#{spec.full_name} #{Gem.dir}/gems/"
101
- sudo "mv #{Bundler.tmp}/specifications/#{spec.full_name}.gemspec #{Gem.dir}/specifications/"
100
+ sudo "cp -R #{Bundler.tmp}/gems/#{spec.full_name} #{Gem.dir}/gems/"
101
+ sudo "cp -R #{Bundler.tmp}/specifications/#{spec.full_name}.gemspec #{Gem.dir}/specifications/"
102
102
  end
103
103
 
104
104
  spec.loaded_from = "#{Gem.dir}/specifications/#{spec.full_name}.gemspec"
105
105
  end
106
106
 
107
107
  def sudo(str)
108
- `sudo -E #{str}`
108
+ Bundler.sudo(str)
109
109
  end
110
110
 
111
111
  def cache(spec)
@@ -146,21 +146,29 @@ module Bundler
146
146
  def installed_specs
147
147
  @installed_specs ||= begin
148
148
  idx = Index.new
149
- Gem::SourceIndex.from_installed_gems.to_a.reverse.each do |name, spec|
150
- next if name == 'bundler'
149
+ have_bundler = false
150
+ Gem::SourceIndex.from_installed_gems.to_a.reverse.each do |dont_use_this_var, spec|
151
+ next if spec.name == 'bundler' && spec.version.to_s != VERSION
152
+ have_bundler = true if spec.name == 'bundler'
151
153
  spec.source = self
152
154
  idx << spec
153
155
  end
156
+
154
157
  # Always have bundler locally
155
- bundler = Gem::Specification.new do |s|
156
- s.name = 'bundler'
157
- s.version = VERSION
158
- s.platform = Gem::Platform::RUBY
159
- s.source = self
160
- # TODO: Remove this
161
- s.loaded_from = 'w0t'
158
+ unless have_bundler
159
+ # We're running bundler directly from the source
160
+ # so, let's create a fake gemspec for it (it's a path)
161
+ # gemspec
162
+ bundler = Gem::Specification.new do |s|
163
+ s.name = 'bundler'
164
+ s.version = VERSION
165
+ s.platform = Gem::Platform::RUBY
166
+ s.source = self
167
+ # TODO: Remove this
168
+ s.loaded_from = 'w0t'
169
+ end
170
+ idx << bundler
162
171
  end
163
- idx << bundler
164
172
  idx
165
173
  end
166
174
  end
@@ -446,10 +454,11 @@ module Bundler
446
454
 
447
455
  def initialize(options)
448
456
  super
449
- @uri = options["uri"]
450
- @ref = options["ref"] || options["branch"] || options["tag"] || 'master'
451
- @revision = options["revision"]
452
- @update = false
457
+ @uri = options["uri"]
458
+ @ref = options["ref"] || options["branch"] || options["tag"] || 'master'
459
+ @revision = options["revision"]
460
+ @submodules = options["submodules"]
461
+ @update = false
453
462
  end
454
463
 
455
464
  def self.from_lock(options)
@@ -460,7 +469,7 @@ module Bundler
460
469
  out = "GIT\n"
461
470
  out << " remote: #{@uri}\n"
462
471
  out << " revision: #{shortref_for(revision)}\n"
463
- %w(ref branch tag).each do |opt|
472
+ %w(ref branch tag submodules).each do |opt|
464
473
  out << " #{opt}: #{options[opt]}\n" if options[opt]
465
474
  end
466
475
  out << " glob: #{@glob}\n" unless @glob == DEFAULT_GLOB
@@ -487,7 +496,15 @@ module Bundler
487
496
  end
488
497
 
489
498
  def path
490
- Bundler.install_path.join("#{base_name}-#{shortref_for(revision)}")
499
+ @install_path ||= begin
500
+ git_scope = "#{base_name}-#{shortref_for(revision)}"
501
+
502
+ if Bundler.requires_sudo?
503
+ Bundler.user_bundle_path.join(Bundler.ruby_scope).join(git_scope)
504
+ else
505
+ Bundler.install_path.join(git_scope)
506
+ end
507
+ end
491
508
  end
492
509
 
493
510
  def unlock!
@@ -525,11 +542,7 @@ module Bundler
525
542
  private
526
543
 
527
544
  def git(command)
528
- if Bundler.requires_sudo?
529
- out = %x{sudo -E git #{command}}
530
- else
531
- out = %x{git #{command}}
532
- end
545
+ out = %x{git #{command}}
533
546
 
534
547
  if $? != 0
535
548
  raise GitError, "An error has occurred in git. Cannot complete bundling."
@@ -558,7 +571,15 @@ module Bundler
558
571
  end
559
572
 
560
573
  def cache_path
561
- @cache_path ||= Bundler.cache.join("git", "#{base_name}-#{uri_hash}")
574
+ @cache_path ||= begin
575
+ git_scope = "#{base_name}-#{uri_hash}"
576
+
577
+ if Bundler.requires_sudo?
578
+ Bundler.user_bundle_path.join("cache/git", git_scope)
579
+ else
580
+ Bundler.cache.join("git", git_scope)
581
+ end
582
+ end
562
583
  end
563
584
 
564
585
  def cache
@@ -567,7 +588,7 @@ module Bundler
567
588
  in_cache { git %|fetch --force --quiet "#{uri}" refs/heads/*:refs/heads/*| }
568
589
  else
569
590
  Bundler.ui.info "Fetching #{uri}"
570
- FileUtils.mkdir_p(cache_path.dirname)
591
+ Bundler.mkdir_p(cache_path.dirname)
571
592
  git %|clone "#{uri}" "#{cache_path}" --bare --no-hardlinks|
572
593
  end
573
594
  end
@@ -580,8 +601,11 @@ module Bundler
580
601
  Dir.chdir(path) do
581
602
  git "fetch --force --quiet"
582
603
  git "reset --hard #{revision}"
583
- git "submodule init"
584
- git "submodule update"
604
+
605
+ if @submodules
606
+ git "submodule init"
607
+ git "submodule update"
608
+ end
585
609
  end
586
610
  end
587
611
 
@@ -18,6 +18,7 @@ module Bundler
18
18
 
19
19
  def for(dependencies, skip = [], check = false, match_current_platform = false)
20
20
  handled, deps, specs = {}, dependencies.dup, []
21
+ skip << 'bundler'
21
22
 
22
23
  until deps.empty?
23
24
  dep = deps.shift
@@ -44,6 +45,10 @@ module Bundler
44
45
  end
45
46
  end
46
47
 
48
+ if spec = lookup['bundler'].first
49
+ specs << spec
50
+ end
51
+
47
52
  check ? true : SpecSet.new(specs)
48
53
  end
49
54
 
@@ -56,6 +61,13 @@ module Bundler
56
61
  lookup[key].reverse
57
62
  end
58
63
 
64
+ def []=(key, value)
65
+ @specs << value
66
+ @lookup = nil
67
+ @sorted = nil
68
+ value
69
+ end
70
+
59
71
  def to_a
60
72
  sorted.dup
61
73
  end
@@ -80,7 +92,12 @@ module Bundler
80
92
  end
81
93
 
82
94
  def merge(set)
83
- SpecSet.new(sorted + set.to_a)
95
+ arr = sorted.dup
96
+ set.each do |s|
97
+ next if arr.any? { |s2| s2.name == s.name && s2.version == s.version && s2.platform == s.platform }
98
+ arr << s
99
+ end
100
+ SpecSet.new(arr)
84
101
  end
85
102
 
86
103
  private
@@ -114,4 +131,4 @@ module Bundler
114
131
  end
115
132
  end
116
133
  end
117
- end
134
+ end
@@ -1,28 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
- # This is not actually required by the actual library
3
- # loads the bundled environment
4
- require 'rubygems'
5
-
6
- begin
7
- require 'bundler/setup'
8
- rescue LoadError
9
- # Let's not complain if bundler isn't around
10
- end
11
-
12
- base = File.basename($0)
13
- paths = ENV['PATH'].split(File::PATH_SEPARATOR)
14
- here = File.expand_path(File.dirname(__FILE__))
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application '<%= executable %>' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
15
8
 
16
- gem_stub = paths.find do |path|
17
- path = File.expand_path(path)
9
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../<%= relative_gemfile_path %>", __FILE__)
18
10
 
19
- next if path == here
20
-
21
- File.exist?("#{path}/#{base}")
22
- end
11
+ require 'rubygems'
12
+ require 'bundler/setup'
23
13
 
24
- if gem_stub
25
- load "#{gem_stub}/#{base}"
26
- else
27
- abort "The gem stub #{base} could not be found"
28
- end
14
+ load Gem.bin_path('<%= spec.name %>', '<%= executable %>')
@@ -2,5 +2,5 @@ module Bundler
2
2
  # We're doing this because we might write tests that deal
3
3
  # with other versions of bundler and we are unsure how to
4
4
  # handle this better.
5
- VERSION = "1.0.0.beta.2" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.0.0.beta.3" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -0,0 +1,130 @@
1
+ !RBIX
2
+ 1993355899764403924
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 28
13
+ 99
14
+ 7
15
+ 0
16
+ 65
17
+ 49
18
+ 1
19
+ 2
20
+ 13
21
+ 99
22
+ 12
23
+ 7
24
+ 2
25
+ 12
26
+ 7
27
+ 3
28
+ 12
29
+ 65
30
+ 12
31
+ 49
32
+ 4
33
+ 4
34
+ 15
35
+ 49
36
+ 2
37
+ 0
38
+ 15
39
+ 2
40
+ 11
41
+ I
42
+ 6
43
+ I
44
+ 0
45
+ I
46
+ 0
47
+ I
48
+ 0
49
+ n
50
+ p
51
+ 5
52
+ x
53
+ 7
54
+ Bundler
55
+ x
56
+ 11
57
+ open_module
58
+ x
59
+ 15
60
+ __module_init__
61
+ M
62
+ 1
63
+ n
64
+ n
65
+ x
66
+ 7
67
+ Bundler
68
+ i
69
+ 12
70
+ 5
71
+ 66
72
+ 65
73
+ 7
74
+ 0
75
+ 7
76
+ 1
77
+ 64
78
+ 49
79
+ 2
80
+ 2
81
+ 11
82
+ I
83
+ 3
84
+ I
85
+ 0
86
+ I
87
+ 0
88
+ I
89
+ 0
90
+ n
91
+ p
92
+ 3
93
+ x
94
+ 7
95
+ VERSION
96
+ s
97
+ 8
98
+ 0.10.pre
99
+ x
100
+ 9
101
+ const_set
102
+ p
103
+ 3
104
+ I
105
+ 2
106
+ I
107
+ 2
108
+ I
109
+ c
110
+ x
111
+ 49
112
+ /Users/wycats/Code/bundler/lib/bundler/version.rb
113
+ p
114
+ 0
115
+ x
116
+ 13
117
+ attach_method
118
+ p
119
+ 3
120
+ I
121
+ 0
122
+ I
123
+ 1
124
+ I
125
+ 1c
126
+ x
127
+ 49
128
+ /Users/wycats/Code/bundler/lib/bundler/version.rb
129
+ p
130
+ 0
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 0
8
8
  - 0
9
9
  - beta
10
- - 2
11
- version: 1.0.0.beta.2
10
+ - 3
11
+ version: 1.0.0.beta.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Carl Lerche
@@ -18,13 +18,14 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2010-06-28 00:00:00 -07:00
21
+ date: 2010-07-09 00:00:00 -07:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: rspec
26
26
  prerelease: false
27
27
  requirement: &id001 !ruby/object:Gem::Requirement
28
+ none: false
28
29
  requirements:
29
30
  - - ">="
30
31
  - !ruby/object:Gem::Version
@@ -44,6 +45,7 @@ extra_rdoc_files: []
44
45
 
45
46
  files:
46
47
  - bin/bundle
48
+ - bin/rake
47
49
  - lib/bundler/cli.rb
48
50
  - lib/bundler/definition.rb
49
51
  - lib/bundler/dependency.rb
@@ -57,6 +59,7 @@ files:
57
59
  - lib/bundler/remote_specification.rb
58
60
  - lib/bundler/resolver.rb
59
61
  - lib/bundler/rubygems_ext.rb
62
+ - lib/bundler/rubygems_ext.rbc
60
63
  - lib/bundler/runtime.rb
61
64
  - lib/bundler/settings.rb
62
65
  - lib/bundler/setup.rb
@@ -85,14 +88,16 @@ files:
85
88
  - lib/bundler/vendor/thor/version.rb
86
89
  - lib/bundler/vendor/thor.rb
87
90
  - lib/bundler/version.rb
91
+ - lib/bundler/version.rbc
88
92
  - lib/bundler.rb
93
+ - lib/bundler.rbc
89
94
  - LICENSE
90
95
  - README.md
91
96
  - ROADMAP.md
92
97
  - CHANGELOG.md
93
98
  - TODO.md
94
99
  has_rdoc: true
95
- homepage: http://github.com/carlhuda/bundler
100
+ homepage: http://gembundler.com
96
101
  licenses: []
97
102
 
98
103
  post_install_message:
@@ -101,6 +106,7 @@ rdoc_options: []
101
106
  require_paths:
102
107
  - lib
103
108
  required_ruby_version: !ruby/object:Gem::Requirement
109
+ none: false
104
110
  requirements:
105
111
  - - ">="
106
112
  - !ruby/object:Gem::Version
@@ -108,6 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
114
  - 0
109
115
  version: "0"
110
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
+ none: false
111
118
  requirements:
112
119
  - - ">="
113
120
  - !ruby/object:Gem::Version
@@ -119,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
126
  requirements: []
120
127
 
121
128
  rubyforge_project: bundler
122
- rubygems_version: 1.3.6
129
+ rubygems_version: 1.3.7
123
130
  signing_key:
124
131
  specification_version: 3
125
132
  summary: The best way to manage your application's dependencies