bundler 1.3.0.pre.4 → 1.3.0.pre.5
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/.travis.yml +6 -0
- data/CHANGELOG.md +13 -0
- data/CONTRIBUTE.md +1 -1
- data/lib/bundler/cli.rb +4 -1
- data/lib/bundler/dependency.rb +21 -9
- data/lib/bundler/installer.rb +6 -2
- data/lib/bundler/runtime.rb +18 -10
- data/lib/bundler/version.rb +1 -1
- data/spec/other/clean_spec.rb +28 -0
- data/spec/runtime/executable_spec.rb +17 -0
- metadata +4 -4
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,22 @@
|
|
1
|
+
## 1.3.0.pre.5 (Jan 9, 2013)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- make `--standalone` require lines ruby engine/version agnostic
|
6
|
+
- add `--dry-run` to `bundle clean` (@wfarr, #2237)
|
7
|
+
|
8
|
+
Bugfixes:
|
9
|
+
|
10
|
+
- don't skip writing binstubs when doing `bundle install`
|
11
|
+
- distinguish between ruby 1.9/2.0 when using :platforms (@spastorino)
|
12
|
+
|
1
13
|
## 1.3.0.pre.4 (Jan 3, 2013)
|
2
14
|
|
3
15
|
Features:
|
4
16
|
|
5
17
|
- `bundle binstubs <gem>` to setup individual binstubs
|
6
18
|
- `bundle install --binstubs ""` will remove binstubs option
|
19
|
+
- `bundle clean --dry-run` will print out gems instead of removing them
|
7
20
|
|
8
21
|
Bugfixes:
|
9
22
|
|
data/CONTRIBUTE.md
CHANGED
@@ -14,7 +14,7 @@ The Bundler core team consists of André Arko ([@indirect](http://github.com/ind
|
|
14
14
|
When adding a new feature to Bundler, please follow these steps:
|
15
15
|
|
16
16
|
1. [Create an issue](https://github.com/carlhuda/bundler/issues/new) to discuss your feature.
|
17
|
-
2. Base your commits on the master branch, since we follow [SemVer](http://semver.
|
17
|
+
2. Base your commits on the master branch, since we follow [SemVer](http://semver.org) and don't add new features to old releases.
|
18
18
|
3. Commit the code and at least one test covering your changes to a feature branch in your fork.
|
19
19
|
4. Put a line in the [CHANGELOG](https://github.com/carlhuda/bundler/blob/master/CHANGELOG.md) summarizing your changes under the next release under the "Features" heading.
|
20
20
|
5. Send us a [pull request](https://help.github.com/articles/using-pull-requests) from your feature branch.
|
data/lib/bundler/cli.rb
CHANGED
@@ -351,7 +351,7 @@ module Bundler
|
|
351
351
|
if spec.name == "bundler"
|
352
352
|
Bundler.ui.warn "Skipping bundler since can't bundle bundler."
|
353
353
|
else
|
354
|
-
installer.generate_bundler_executable_stubs(spec, :force => options[:force])
|
354
|
+
installer.generate_bundler_executable_stubs(spec, :force => options[:force], :binstubs_cmd => true)
|
355
355
|
end
|
356
356
|
end
|
357
357
|
|
@@ -672,10 +672,13 @@ module Bundler
|
|
672
672
|
end
|
673
673
|
|
674
674
|
desc "clean", "Cleans up unused gems in your bundler directory"
|
675
|
+
method_option "dry-run", :type => :boolean, :default => false, :banner =>
|
676
|
+
"only print out changes, do not actually clean gems"
|
675
677
|
method_option "force", :type => :boolean, :default => false, :banner =>
|
676
678
|
"forces clean even if --path is not set"
|
677
679
|
def clean
|
678
680
|
if Bundler.settings[:path] || options[:force]
|
681
|
+
Bundler.settings[:dry_run] = options[:"dry-run"]
|
679
682
|
Bundler.load.clean
|
680
683
|
else
|
681
684
|
Bundler.ui.error "Can only use bundle clean when --path is set or --force is set"
|
data/lib/bundler/dependency.rb
CHANGED
@@ -81,20 +81,32 @@ module Bundler
|
|
81
81
|
|
82
82
|
private
|
83
83
|
|
84
|
+
def on_18?
|
85
|
+
RUBY_VERSION =~ /^1\.8/
|
86
|
+
end
|
87
|
+
|
88
|
+
def on_19?
|
89
|
+
RUBY_VERSION =~ /^1\.9/
|
90
|
+
end
|
91
|
+
|
92
|
+
def on_20?
|
93
|
+
RUBY_VERSION =~ /^2\.0/
|
94
|
+
end
|
95
|
+
|
84
96
|
def ruby?
|
85
97
|
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev")
|
86
98
|
end
|
87
99
|
|
88
100
|
def ruby_18?
|
89
|
-
ruby? &&
|
101
|
+
ruby? && on_18?
|
90
102
|
end
|
91
103
|
|
92
104
|
def ruby_19?
|
93
|
-
ruby? &&
|
105
|
+
ruby? && on_19?
|
94
106
|
end
|
95
107
|
|
96
108
|
def ruby_20?
|
97
|
-
ruby? &&
|
109
|
+
ruby? && on_20?
|
98
110
|
end
|
99
111
|
|
100
112
|
def mri?
|
@@ -102,16 +114,16 @@ module Bundler
|
|
102
114
|
end
|
103
115
|
|
104
116
|
def mri_18?
|
105
|
-
mri? &&
|
117
|
+
mri? && on_18?
|
106
118
|
end
|
107
119
|
|
108
120
|
def mri_19?
|
109
|
-
mri? &&
|
121
|
+
mri? && on_19?
|
110
122
|
end
|
111
123
|
|
112
124
|
|
113
125
|
def mri_20?
|
114
|
-
mri? &&
|
126
|
+
mri? && on_20?
|
115
127
|
end
|
116
128
|
|
117
129
|
def rbx?
|
@@ -135,15 +147,15 @@ module Bundler
|
|
135
147
|
end
|
136
148
|
|
137
149
|
def mingw_18?
|
138
|
-
mingw? &&
|
150
|
+
mingw? && on_18?
|
139
151
|
end
|
140
152
|
|
141
153
|
def mingw_19?
|
142
|
-
mingw? &&
|
154
|
+
mingw? && on_19?
|
143
155
|
end
|
144
156
|
|
145
157
|
def mingw_20?
|
146
|
-
mingw? &&
|
158
|
+
mingw? && on_20?
|
147
159
|
end
|
148
160
|
|
149
161
|
end
|
data/lib/bundler/installer.rb
CHANGED
@@ -137,7 +137,7 @@ module Bundler
|
|
137
137
|
write = true
|
138
138
|
binstub_path = "#{bin_path}/#{executable}"
|
139
139
|
next if executable == "bundle"
|
140
|
-
if File.exists?(binstub_path) && !options[:force]
|
140
|
+
if File.exists?(binstub_path) && !options[:force] && options[:binstubs_cmd]
|
141
141
|
write = false
|
142
142
|
Bundler.ui.warn <<-MSG
|
143
143
|
Skipping #{executable} since it already exists. Pass --force to overwrite.
|
@@ -188,12 +188,16 @@ module Bundler
|
|
188
188
|
|
189
189
|
spec.require_paths.each do |path|
|
190
190
|
full_path = File.join(spec.full_gem_path, path)
|
191
|
-
|
191
|
+
gem_path = Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path))
|
192
|
+
paths << gem_path.to_s.sub("#{SystemRubyVersion.new.engine}/#{RbConfig::CONFIG['ruby_version']}", '#{ruby_engine}/#{ruby_version}')
|
192
193
|
end
|
193
194
|
end
|
194
195
|
|
195
196
|
|
196
197
|
File.open File.join(bundler_path, "setup.rb"), "w" do |file|
|
198
|
+
file.puts "# ruby 1.8.7 doesn't define RUBY_ENGINE"
|
199
|
+
file.puts "ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'"
|
200
|
+
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
|
197
201
|
file.puts "path = File.expand_path('..', __FILE__)"
|
198
202
|
paths.each do |path|
|
199
203
|
file.puts %{$:.unshift File.expand_path("\#{path}/#{path}")}
|
data/lib/bundler/runtime.rb
CHANGED
@@ -156,38 +156,46 @@ module Bundler
|
|
156
156
|
stale_gem_files = gem_files - spec_cache_paths
|
157
157
|
stale_gemspec_files = gemspec_files - spec_gemspec_paths
|
158
158
|
|
159
|
-
stale_gem_bins.each {|bin| FileUtils.rm(bin) }
|
160
159
|
output = stale_gem_dirs.collect do |gem_dir|
|
161
160
|
full_name = Pathname.new(gem_dir).basename.to_s
|
162
161
|
|
163
|
-
FileUtils.rm_rf(gem_dir)
|
164
|
-
|
165
162
|
parts = full_name.split('-')
|
166
163
|
name = parts[0..-2].join('-')
|
167
164
|
version = parts.last
|
168
165
|
output = "#{name} (#{version})"
|
169
166
|
|
170
|
-
Bundler.
|
167
|
+
if Bundler.settings[:dry_run]
|
168
|
+
Bundler.ui.info "Would have removed #{output}"
|
169
|
+
else
|
170
|
+
Bundler.ui.info "Removing #{output}"
|
171
|
+
FileUtils.rm_rf(gem_dir)
|
172
|
+
end
|
171
173
|
|
172
174
|
output
|
173
175
|
end + stale_git_dirs.collect do |gem_dir|
|
174
176
|
full_name = Pathname.new(gem_dir).basename.to_s
|
175
177
|
|
176
|
-
FileUtils.rm_rf(gem_dir)
|
177
|
-
|
178
178
|
parts = full_name.split('-')
|
179
179
|
name = parts[0..-2].join('-')
|
180
180
|
revision = parts[-1]
|
181
181
|
output = "#{name} (#{revision})"
|
182
182
|
|
183
|
-
Bundler.
|
183
|
+
if Bundler.settings[:dry_run]
|
184
|
+
Bundler.ui.info "Would have removed #{output}"
|
185
|
+
else
|
186
|
+
Bundler.ui.info "Removing #{output}"
|
187
|
+
FileUtils.rm_rf(gem_dir)
|
188
|
+
end
|
184
189
|
|
185
190
|
output
|
186
191
|
end
|
187
192
|
|
188
|
-
|
189
|
-
|
190
|
-
|
193
|
+
unless Bundler.settings[:dry_run]
|
194
|
+
stale_gem_bins.each { |bin| FileUtils.rm(bin) if File.exists?(bin) }
|
195
|
+
stale_gem_files.each { |file| FileUtils.rm(file) if File.exists?(file) }
|
196
|
+
stale_gemspec_files.each { |file| FileUtils.rm(file) if File.exists?(file) }
|
197
|
+
stale_git_cache_dirs.each { |dir| FileUtils.rm_rf(dir) if File.exists?(dir) }
|
198
|
+
end
|
191
199
|
|
192
200
|
output
|
193
201
|
end
|
data/lib/bundler/version.rb
CHANGED
@@ -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.3.0.pre.
|
5
|
+
VERSION = "1.3.0.pre.5" unless defined?(::Bundler::VERSION)
|
6
6
|
end
|
data/spec/other/clean_spec.rb
CHANGED
@@ -531,4 +531,32 @@ describe "bundle clean" do
|
|
531
531
|
|
532
532
|
expect(exitstatus).to eq(0)
|
533
533
|
end
|
534
|
+
|
535
|
+
it "doesn't remove gems in dry-run mode" do
|
536
|
+
gemfile <<-G
|
537
|
+
source "file://#{gem_repo1}"
|
538
|
+
|
539
|
+
gem "thin"
|
540
|
+
gem "foo"
|
541
|
+
G
|
542
|
+
|
543
|
+
bundle "install --path vendor/bundle --no-clean"
|
544
|
+
|
545
|
+
gemfile <<-G
|
546
|
+
source "file://#{gem_repo1}"
|
547
|
+
|
548
|
+
gem "thin"
|
549
|
+
G
|
550
|
+
|
551
|
+
bundle :install
|
552
|
+
|
553
|
+
bundle "clean --dry-run"
|
554
|
+
|
555
|
+
expect(out).not_to eq("Removing foo (1.0)")
|
556
|
+
expect(out).to eq("Would have removed foo (1.0)")
|
557
|
+
|
558
|
+
should_have_gems 'thin-1.0', 'rack-1.0.0', 'foo-1.0'
|
559
|
+
|
560
|
+
expect(vendored_gems("bin/rackup")).to exist
|
561
|
+
end
|
534
562
|
end
|
@@ -129,4 +129,21 @@ describe "Running bin/* commands" do
|
|
129
129
|
|
130
130
|
expect(bundled_app("bin/rackup")).to exist
|
131
131
|
end
|
132
|
+
|
133
|
+
it "always reinstalls the binstub" do
|
134
|
+
gemfile <<-G
|
135
|
+
source "file://#{gem_repo1}"
|
136
|
+
gem "rack"
|
137
|
+
G
|
138
|
+
|
139
|
+
bundle "install --binstubs bin/"
|
140
|
+
|
141
|
+
File.open(bundled_app("bin/rackup"), 'wb') do |file|
|
142
|
+
file.print "OMG"
|
143
|
+
end
|
144
|
+
|
145
|
+
bundle "install"
|
146
|
+
|
147
|
+
expect(File.read(bundled_app("bin/rackup"))).not_to eq("OMG")
|
148
|
+
end
|
132
149
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: -
|
4
|
+
hash: -3803691018
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
9
|
- 0
|
10
10
|
- pre
|
11
|
-
-
|
12
|
-
version: 1.3.0.pre.
|
11
|
+
- 5
|
12
|
+
version: 1.3.0.pre.5
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- "Andr\xC3\xA9 Arko"
|
@@ -20,7 +20,7 @@ autorequire:
|
|
20
20
|
bindir: bin
|
21
21
|
cert_chain: []
|
22
22
|
|
23
|
-
date: 2013-01-
|
23
|
+
date: 2013-01-10 00:00:00 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: ronn
|