bundler 0.8.0 → 0.8.1
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.
- data/lib/bundler.rb +16 -2
- data/lib/bundler/bundle.rb +2 -11
- data/lib/bundler/cli.rb +2 -0
- data/lib/bundler/environment.rb +3 -5
- data/lib/bundler/source.rb +13 -17
- metadata +2 -2
data/lib/bundler.rb
CHANGED
@@ -19,10 +19,10 @@ require "bundler/dependency"
|
|
19
19
|
require "bundler/remote_specification"
|
20
20
|
|
21
21
|
module Bundler
|
22
|
-
VERSION = "0.8.
|
22
|
+
VERSION = "0.8.1"
|
23
23
|
|
24
24
|
class << self
|
25
|
-
attr_writer :logger
|
25
|
+
attr_writer :logger, :mode
|
26
26
|
|
27
27
|
def logger
|
28
28
|
@logger ||= begin
|
@@ -31,5 +31,19 @@ module Bundler
|
|
31
31
|
logger
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
def local?
|
36
|
+
@mode == :local
|
37
|
+
end
|
38
|
+
|
39
|
+
def writable?
|
40
|
+
@mode != :readonly
|
41
|
+
end
|
42
|
+
|
43
|
+
def remote?
|
44
|
+
@mode == :readwrite
|
45
|
+
end
|
34
46
|
end
|
47
|
+
|
48
|
+
self.mode = :readonly
|
35
49
|
end
|
data/lib/bundler/bundle.rb
CHANGED
@@ -77,11 +77,6 @@ module Bundler
|
|
77
77
|
end
|
78
78
|
# ==========
|
79
79
|
|
80
|
-
# TODO: clean this up
|
81
|
-
sources.each do |s|
|
82
|
-
s.local = options[:cached]
|
83
|
-
end
|
84
|
-
|
85
80
|
# Check to see whether the existing cache meets all the requirements
|
86
81
|
begin
|
87
82
|
valid = nil
|
@@ -130,11 +125,7 @@ module Bundler
|
|
130
125
|
end
|
131
126
|
|
132
127
|
def prune(options = {})
|
133
|
-
dependencies, sources = @environment.
|
134
|
-
|
135
|
-
sources.each do |s|
|
136
|
-
s.local = true
|
137
|
-
end
|
128
|
+
dependencies, sources = @environment.dependencies, @environment.sources
|
138
129
|
|
139
130
|
sources = only_local(sources)
|
140
131
|
bundle = Resolver.resolve(dependencies, [@cache] + sources)
|
@@ -181,7 +172,7 @@ module Bundler
|
|
181
172
|
private
|
182
173
|
|
183
174
|
def only_local(sources)
|
184
|
-
sources.select { |s| s.
|
175
|
+
sources.select { |s| s.local? }
|
185
176
|
end
|
186
177
|
|
187
178
|
def download(bundle, options)
|
data/lib/bundler/cli.rb
CHANGED
@@ -31,6 +31,7 @@ module Bundler
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def initialize(options)
|
34
|
+
Bundler.mode = options[:cached] ? :local : :readwrite
|
34
35
|
@options = options
|
35
36
|
@bundle = Bundle.load(@options[:manifest])
|
36
37
|
end
|
@@ -62,6 +63,7 @@ module Bundler
|
|
62
63
|
end
|
63
64
|
|
64
65
|
def prune
|
66
|
+
Bundler.mode = :local
|
65
67
|
@bundle.prune(@options)
|
66
68
|
end
|
67
69
|
|
data/lib/bundler/environment.rb
CHANGED
@@ -33,7 +33,9 @@ module Bundler
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def sources
|
36
|
-
@priority_sources + [SystemGemSource.new(@bundle)] + @sources + @default_sources
|
36
|
+
sources = @priority_sources + [SystemGemSource.new(@bundle)] + @sources + @default_sources
|
37
|
+
sources.reject! {|s| !s.local? } if Bundler.local?
|
38
|
+
sources
|
37
39
|
end
|
38
40
|
|
39
41
|
def add_source(source)
|
@@ -49,10 +51,6 @@ module Bundler
|
|
49
51
|
@default_sources.clear
|
50
52
|
end
|
51
53
|
|
52
|
-
def gem_dependencies
|
53
|
-
@gem_dependencies ||= dependencies.map { |d| d.to_gem_dependency }
|
54
|
-
end
|
55
|
-
|
56
54
|
alias rubygems? rubygems
|
57
55
|
alias system_gems? system_gems
|
58
56
|
|
data/lib/bundler/source.rb
CHANGED
@@ -4,7 +4,6 @@ module Bundler
|
|
4
4
|
# Represents a source of rubygems. Initially, this is only gem repositories, but
|
5
5
|
# eventually, this will be git, svn, HTTP
|
6
6
|
class Source
|
7
|
-
attr_accessor :local
|
8
7
|
attr_reader :bundle
|
9
8
|
|
10
9
|
def initialize(bundle, options)
|
@@ -33,7 +32,7 @@ module Bundler
|
|
33
32
|
raise ArgumentError, "The source must be an absolute URI" unless @uri.absolute?
|
34
33
|
end
|
35
34
|
|
36
|
-
def
|
35
|
+
def local?
|
37
36
|
false
|
38
37
|
end
|
39
38
|
|
@@ -115,7 +114,7 @@ module Bundler
|
|
115
114
|
@source = Gem::SourceIndex.from_installed_gems
|
116
115
|
end
|
117
116
|
|
118
|
-
def
|
117
|
+
def local?
|
119
118
|
false
|
120
119
|
end
|
121
120
|
|
@@ -149,7 +148,7 @@ module Bundler
|
|
149
148
|
@location = options[:location]
|
150
149
|
end
|
151
150
|
|
152
|
-
def
|
151
|
+
def local?
|
153
152
|
true
|
154
153
|
end
|
155
154
|
|
@@ -205,7 +204,7 @@ module Bundler
|
|
205
204
|
end
|
206
205
|
end
|
207
206
|
|
208
|
-
def
|
207
|
+
def local?
|
209
208
|
true
|
210
209
|
end
|
211
210
|
|
@@ -307,14 +306,19 @@ module Bundler
|
|
307
306
|
@ref = options[:ref] || "origin/#{@branch}"
|
308
307
|
end
|
309
308
|
|
309
|
+
def local?
|
310
|
+
raise SourceNotCached, "Git repository '#{@uri}' has not been cloned yet" unless location.directory?
|
311
|
+
super
|
312
|
+
end
|
313
|
+
|
310
314
|
def location
|
311
315
|
# TMP HAX to get the *.gemspec reading to work
|
312
316
|
bundle.gem_path.join('dirs', File.basename(@uri, '.git'))
|
313
317
|
end
|
314
318
|
|
315
319
|
def gems
|
316
|
-
update
|
317
|
-
checkout
|
320
|
+
update if Bundler.remote?
|
321
|
+
checkout if Bundler.writable?
|
318
322
|
super
|
319
323
|
end
|
320
324
|
|
@@ -336,19 +340,11 @@ module Bundler
|
|
336
340
|
end
|
337
341
|
|
338
342
|
def fetch
|
339
|
-
|
340
|
-
|
341
|
-
Dir.chdir(location) { `git fetch origin` }
|
342
|
-
end
|
343
|
+
Bundler.logger.info "Fetching git repository at: #{@uri}"
|
344
|
+
Dir.chdir(location) { `git fetch origin` }
|
343
345
|
end
|
344
346
|
|
345
347
|
def clone
|
346
|
-
# Raise an error if the source should run in local mode,
|
347
|
-
# but it has not been cached yet.
|
348
|
-
if local
|
349
|
-
raise SourceNotCached, "Git repository '#{@uri}' has not been cloned yet"
|
350
|
-
end
|
351
|
-
|
352
348
|
Bundler.logger.info "Cloning git repository at: #{@uri}"
|
353
349
|
FileUtils.mkdir_p(location.dirname)
|
354
350
|
`git clone #{@uri} #{location} --no-hardlinks`
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yehuda Katz
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-01-
|
13
|
+
date: 2010-01-05 00:00:00 -08:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|