bundler 1.6.0.rc → 1.6.0.rc2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +3 -3
- data/Rakefile +18 -7
- data/lib/bundler.rb +2 -2
- data/lib/bundler/cli.rb +15 -14
- data/lib/bundler/cli/gem.rb +23 -7
- data/lib/bundler/cli/show.rb +6 -2
- data/lib/bundler/fetcher.rb +15 -1
- data/lib/bundler/rubygems_integration.rb +1 -1
- data/lib/bundler/source/git/git_proxy.rb +15 -11
- data/lib/bundler/templates/newgem/Rakefile.tt +8 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
- data/lib/bundler/templates/newgem/gitignore.tt +5 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +3 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -0
- data/lib/bundler/vendor/net/http/persistent.rb +18 -7
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-config.ronn +12 -6
- data/spec/commands/newgem_spec.rb +20 -0
- data/spec/commands/show_spec.rb +7 -0
- metadata +22 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7909274a9b9a99eda0647f03f88cc32e9cdc02c2
|
4
|
+
data.tar.gz: 9f3d0fe8471bab816bb6332bf36e45acc807236d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c670d2553f073f0cab99ee3fb038eeb94e7f0707a264fceb8b36f0c84e94a99bc9d93c7a6f702bcd7fedc0e3e4514e5ea0bac1d86eb65c49a9df7c988847d95
|
7
|
+
data.tar.gz: 20696ca89ad28274c8fbe26200a45432c70eb08e7c9dae5cdf43847a7ee374d12fa51808d8990a18680f0341c2ad074ed866dc1d756c49976723850bfacbf4ef
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,10 @@ Bugfixes:
|
|
10
10
|
- allow long config values (#2823, @kgrz)
|
11
11
|
- cache successfully even locked to gems shipped with Ruby (#2869, @aughr)
|
12
12
|
- respect NO_PROXY even if a proxy is configured (#2878, @stlay)
|
13
|
+
- only retry git commands that hit the network (#2899, @timmoore)
|
14
|
+
- fix NameError regression when OpenSSL is not available (#2898, @timmoore)
|
15
|
+
- handle exception installing when build_info owned by root (@Who828)
|
16
|
+
- skip HTTP redirects from rubygems.org, huge speed boost (@Who828)
|
13
17
|
|
14
18
|
Features:
|
15
19
|
|
@@ -21,6 +25,8 @@ Features:
|
|
21
25
|
- highlight installed or updated gems (#2722, #2741, @yaotti, @simi)
|
22
26
|
- display the `post_install_message` for gems installed via :git (@phallstrom)
|
23
27
|
- `bundle outdated --strict` now only reports allowed updates (@davidblondeau)
|
28
|
+
- `bundle show --verbose` Add gem summary to the output (@lardcanoe)
|
29
|
+
- `bundle gem GEM --ext` now generates a skeleton for a C extension (@superdealloc)
|
24
30
|
|
25
31
|
## 1.5.3 (2014-02-06)
|
26
32
|
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
[![Code Climate](https://
|
2
|
-
[![Build Status](https://
|
3
|
-
|
1
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/bundler/bundler.svg)](https://codeclimate.com/github/bundler/bundler)
|
2
|
+
[![Build Status](https://img.shields.io/travis/bundler/bundler/master.svg)](https://travis-ci.org/bundler/bundler)
|
3
|
+
[![Version ](https://img.shields.io/gem/v/bundler.svg)](https://rubygems.org/gems/bundler)
|
4
4
|
|
5
5
|
# Bundler: a gem to bundle gems
|
6
6
|
Bundler keeps ruby applications running the same code on every machine.
|
data/Rakefile
CHANGED
@@ -30,7 +30,19 @@ end
|
|
30
30
|
namespace :spec do
|
31
31
|
desc "Ensure spec dependencies are installed"
|
32
32
|
task :deps do
|
33
|
-
|
33
|
+
deps = {
|
34
|
+
"rdiscount" => "~> 1.6",
|
35
|
+
"ronn" => "~> 0.7.3",
|
36
|
+
"rspec" => "~> 3.0.beta"
|
37
|
+
}
|
38
|
+
|
39
|
+
# JRuby can't build ronn or rdiscount, so we skip that
|
40
|
+
if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
|
41
|
+
deps.delete("ronn")
|
42
|
+
deps.delete("rdiscount")
|
43
|
+
end
|
44
|
+
|
45
|
+
deps.each do |name, version|
|
34
46
|
sh "#{Gem.ruby} -S gem list -i '^#{name}$' -v '#{version}' || " \
|
35
47
|
"#{Gem.ruby} -S gem install #{name} -v '#{version}' --no-ri --no-rdoc"
|
36
48
|
end
|
@@ -62,11 +74,10 @@ end
|
|
62
74
|
begin
|
63
75
|
# running the specs needs both rspec and ronn
|
64
76
|
require 'rspec/core/rake_task'
|
65
|
-
require 'ronn'
|
66
77
|
|
67
78
|
desc "Run specs"
|
68
79
|
RSpec::Core::RakeTask.new do |t|
|
69
|
-
t.rspec_opts = %w(
|
80
|
+
t.rspec_opts = %w(--format documentation --color)
|
70
81
|
t.ruby_opts = %w(-w)
|
71
82
|
end
|
72
83
|
task :spec => "man:build"
|
@@ -104,7 +115,7 @@ begin
|
|
104
115
|
(branches + releases).each do |rg|
|
105
116
|
desc "Run specs with Rubygems #{rg}"
|
106
117
|
RSpec::Core::RakeTask.new(rg) do |t|
|
107
|
-
t.rspec_opts = %w(
|
118
|
+
t.rspec_opts = %w(--format documentation --color)
|
108
119
|
t.ruby_opts = %w(-w)
|
109
120
|
end
|
110
121
|
|
@@ -141,7 +152,7 @@ begin
|
|
141
152
|
|
142
153
|
desc "Run specs under a Rubygems checkout (set RG=path)"
|
143
154
|
RSpec::Core::RakeTask.new("co") do |t|
|
144
|
-
t.rspec_opts = %w(
|
155
|
+
t.rspec_opts = %w(--format documentation --color)
|
145
156
|
t.ruby_opts = %w(-w)
|
146
157
|
end
|
147
158
|
|
@@ -224,8 +235,8 @@ begin
|
|
224
235
|
|
225
236
|
rescue LoadError
|
226
237
|
namespace :man do
|
227
|
-
task(:build) {
|
228
|
-
task(:clean) {
|
238
|
+
task(:build) { warn "Install the ronn gem to be able to release!" }
|
239
|
+
task(:clean) { warn "Install the ronn gem to be able to release!" }
|
229
240
|
end
|
230
241
|
end
|
231
242
|
|
data/lib/bundler.rb
CHANGED
@@ -278,8 +278,8 @@ module Bundler
|
|
278
278
|
bin_dir = bin_dir.parent until bin_dir.exist?
|
279
279
|
|
280
280
|
# if any directory is not writable, we need sudo
|
281
|
-
|
282
|
-
sudo_needed =
|
281
|
+
files = [path, bin_dir] | Dir[path.join('build_info/*').to_s] | Dir[path.join('*').to_s]
|
282
|
+
sudo_needed = files.any?{|f| !File.writable?(f) }
|
283
283
|
end
|
284
284
|
|
285
285
|
@requires_sudo_ran = true
|
data/lib/bundler/cli.rb
CHANGED
@@ -64,7 +64,7 @@ module Bundler
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
desc "init", "Generates a Gemfile into the current working directory"
|
67
|
+
desc "init [OPTIONS]", "Generates a Gemfile into the current working directory"
|
68
68
|
long_desc <<-D
|
69
69
|
Init generates a default Gemfile in the current working directory. When adding a
|
70
70
|
Gemfile to a gem with a gemspec, the --gemspec option will automatically add each
|
@@ -76,7 +76,7 @@ module Bundler
|
|
76
76
|
Init.new(options.dup).run
|
77
77
|
end
|
78
78
|
|
79
|
-
desc "check", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems"
|
79
|
+
desc "check [OPTIONS]", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems"
|
80
80
|
long_desc <<-D
|
81
81
|
Check searches the local machine for each of the gems requested in the Gemfile. If
|
82
82
|
all gems are found, Bundler prints a success message and exits with a status of 0.
|
@@ -93,7 +93,7 @@ module Bundler
|
|
93
93
|
Check.new(options).run
|
94
94
|
end
|
95
95
|
|
96
|
-
desc "install", "Install the current environment to the system"
|
96
|
+
desc "install [OPTIONS]", "Install the current environment to the system"
|
97
97
|
long_desc <<-D
|
98
98
|
Install will install all of the gems in the current bundle, making them available
|
99
99
|
for use. In a freshly checked out repository, this command will give you the same
|
@@ -146,7 +146,7 @@ module Bundler
|
|
146
146
|
Install.new(options.dup).run
|
147
147
|
end
|
148
148
|
|
149
|
-
desc "update", "update the current environment"
|
149
|
+
desc "update [OPTIONS]", "update the current environment"
|
150
150
|
long_desc <<-D
|
151
151
|
Update will install the newest versions of the gems listed in the Gemfile. Use
|
152
152
|
update when you have changed the Gemfile, or if you want to get the newest
|
@@ -168,7 +168,7 @@ module Bundler
|
|
168
168
|
Update.new(options, gems).run
|
169
169
|
end
|
170
170
|
|
171
|
-
desc "show [
|
171
|
+
desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
|
172
172
|
long_desc <<-D
|
173
173
|
Show lists the names and versions of all gems that are required by your Gemfile.
|
174
174
|
Calling show with [GEM] will list the exact location of that gem on your machine.
|
@@ -181,7 +181,7 @@ module Bundler
|
|
181
181
|
end
|
182
182
|
map %w(list) => "show"
|
183
183
|
|
184
|
-
desc "binstubs [
|
184
|
+
desc "binstubs GEM [OPTIONS]", "install the binstubs of the listed gem"
|
185
185
|
long_desc <<-D
|
186
186
|
Generate binstubs for executables in [GEM]. Binstubs are put into bin,
|
187
187
|
or the --binstubs directory if one has been set.
|
@@ -195,7 +195,7 @@ module Bundler
|
|
195
195
|
Binstubs.new(options, gems).run
|
196
196
|
end
|
197
197
|
|
198
|
-
desc "outdated [
|
198
|
+
desc "outdated GEM [OPTIONS]", "list installed gems with newer versions available"
|
199
199
|
long_desc <<-D
|
200
200
|
Outdated lists the names and versions of gems that have a newer version available
|
201
201
|
in the given source. Calling outdated with [GEM [GEM]] will only check for newer
|
@@ -213,7 +213,7 @@ module Bundler
|
|
213
213
|
Outdated.new(options, gems).run
|
214
214
|
end
|
215
215
|
|
216
|
-
desc "cache", "Cache all the gems to vendor/cache", :hide => true
|
216
|
+
desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true
|
217
217
|
method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
|
218
218
|
method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)."
|
219
219
|
def cache
|
@@ -221,7 +221,7 @@ module Bundler
|
|
221
221
|
Cache.new(options).run
|
222
222
|
end
|
223
223
|
|
224
|
-
desc "package", "Locks and then caches all of the gems into vendor/cache"
|
224
|
+
desc "package [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
|
225
225
|
method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
|
226
226
|
method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)."
|
227
227
|
method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
|
@@ -240,7 +240,7 @@ module Bundler
|
|
240
240
|
end
|
241
241
|
map %w(pack) => :package
|
242
242
|
|
243
|
-
desc "exec", "Run the command in context of the bundle"
|
243
|
+
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
244
244
|
method_option :keep_file_descriptors, :type => :boolean, :default => false
|
245
245
|
long_desc <<-D
|
246
246
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
@@ -307,7 +307,7 @@ module Bundler
|
|
307
307
|
end
|
308
308
|
end
|
309
309
|
|
310
|
-
desc 'viz', "Generates a visual dependency graph"
|
310
|
+
desc 'viz [OPTIONS]', "Generates a visual dependency graph"
|
311
311
|
long_desc <<-D
|
312
312
|
Viz generates a PNG file of the current Gemfile as a dependency graph.
|
313
313
|
Viz requires the ruby-graphviz gem (and its dependencies).
|
@@ -322,13 +322,14 @@ module Bundler
|
|
322
322
|
Viz.new(options).run
|
323
323
|
end
|
324
324
|
|
325
|
-
desc "gem GEM", "Creates a skeleton for creating a rubygem"
|
325
|
+
desc "gem GEM [OPTIONS]", "Creates a skeleton for creating a rubygem"
|
326
326
|
method_option :bin, :type => :boolean, :default => false, :aliases => '-b', :banner => "Generate a binary for your library."
|
327
327
|
method_option :test, :type => :string, :lazy_default => 'rspec', :aliases => '-t', :banner => "Generate a test directory for your library: 'rspec' is the default, but 'minitest' is also supported."
|
328
328
|
method_option :edit, :type => :string, :aliases => "-e",
|
329
329
|
:lazy_default => [ENV['BUNDLER_EDITOR'], ENV['VISUAL'], ENV['EDITOR']].find{|e| !e.nil? && !e.empty? },
|
330
330
|
:required => false, :banner => "/path/to/your/editor",
|
331
331
|
:desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
|
332
|
+
method_option :ext, :type => :boolean, :detailt => false, :banner => "Generate the boilerplate for C extension code"
|
332
333
|
|
333
334
|
def gem(name)
|
334
335
|
require 'bundler/cli/gem'
|
@@ -339,7 +340,7 @@ module Bundler
|
|
339
340
|
File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
340
341
|
end
|
341
342
|
|
342
|
-
desc "clean", "Cleans up unused gems in your bundler directory"
|
343
|
+
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory"
|
343
344
|
method_option "dry-run", :type => :boolean, :default => false, :banner =>
|
344
345
|
"only print out changes, do not actually clean gems"
|
345
346
|
method_option "force", :type => :boolean, :default => false, :banner =>
|
@@ -349,7 +350,7 @@ module Bundler
|
|
349
350
|
Clean.new(options.dup).run
|
350
351
|
end
|
351
352
|
|
352
|
-
desc "platform", "Displays platform compatibility information"
|
353
|
+
desc "platform [OPTIONS]", "Displays platform compatibility information"
|
353
354
|
method_option "ruby", :type => :boolean, :default => false, :banner =>
|
354
355
|
"only display ruby related platform information"
|
355
356
|
def platform
|
data/lib/bundler/cli/gem.rb
CHANGED
@@ -8,7 +8,16 @@ module Bundler
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def run
|
11
|
+
if options[:ext] && gem_name.index('-')
|
12
|
+
Bundler.ui.error "You have specified a gem name which does not conform to the \n" \
|
13
|
+
"naming guidelines for C extensions. For more information, \n" \
|
14
|
+
"see the 'Extension Naming' section at the following URL:\n" \
|
15
|
+
"http://guides.rubygems.org/gems-with-extensions/\n"
|
16
|
+
exit 1
|
17
|
+
end
|
18
|
+
|
11
19
|
name = gem_name.chomp("/") # remove trailing slash if present
|
20
|
+
underscored_name = name.tr('-', '_')
|
12
21
|
namespaced_path = name.tr('-', '/')
|
13
22
|
target = File.join(Dir.pwd, name)
|
14
23
|
constant_name = name.split('_').map{|p| p[0..0].upcase + p[1..-1] }.join
|
@@ -17,13 +26,15 @@ module Bundler
|
|
17
26
|
git_user_name = `git config user.name`.chomp
|
18
27
|
git_user_email = `git config user.email`.chomp
|
19
28
|
opts = {
|
20
|
-
:name
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
29
|
+
:name => name,
|
30
|
+
:underscored_name => underscored_name,
|
31
|
+
:namespaced_path => namespaced_path,
|
32
|
+
:constant_name => constant_name,
|
33
|
+
:constant_array => constant_array,
|
34
|
+
:author => git_user_name.empty? ? "TODO: Write your name" : git_user_name,
|
35
|
+
:email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
|
36
|
+
:test => options[:test],
|
37
|
+
:ext => options[:ext]
|
27
38
|
}
|
28
39
|
gemspec_dest = File.join(target, "#{name}.gemspec")
|
29
40
|
thor.template(File.join("newgem/Gemfile.tt"), File.join(target, "Gemfile"), opts)
|
@@ -49,6 +60,11 @@ module Bundler
|
|
49
60
|
if options[:test]
|
50
61
|
thor.template(File.join("newgem/.travis.yml.tt"), File.join(target, ".travis.yml"), opts)
|
51
62
|
end
|
63
|
+
if options[:ext]
|
64
|
+
thor.template(File.join("newgem/ext/newgem/extconf.rb.tt"), File.join(target, "ext/#{name}/extconf.rb"), opts)
|
65
|
+
thor.template(File.join("newgem/ext/newgem/newgem.h.tt"), File.join(target, "ext/#{name}/#{underscored_name}.h"), opts)
|
66
|
+
thor.template(File.join("newgem/ext/newgem/newgem.c.tt"), File.join(target, "ext/#{name}/#{underscored_name}.c"), opts)
|
67
|
+
end
|
52
68
|
Bundler.ui.info "Initializing git repo in #{target}"
|
53
69
|
Dir.chdir(target) { `git init`; `git add .` }
|
54
70
|
|
data/lib/bundler/cli/show.rb
CHANGED
@@ -35,10 +35,14 @@ module Bundler
|
|
35
35
|
else
|
36
36
|
Bundler.ui.info "Gems included by the bundle:"
|
37
37
|
Bundler.load.specs.sort_by { |s| s.name }.each do |s|
|
38
|
-
|
38
|
+
desc = " * #{s.name} (#{s.version}#{s.git_version})"
|
39
|
+
if @options[:verbose]
|
40
|
+
Bundler.ui.info "#{desc} - #{s.summary || 'No description available.'}"
|
41
|
+
else
|
42
|
+
Bundler.ui.info desc
|
43
|
+
end
|
39
44
|
end
|
40
45
|
end
|
41
46
|
end
|
42
|
-
|
43
47
|
end
|
44
48
|
end
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -292,7 +292,7 @@ module Bundler
|
|
292
292
|
end
|
293
293
|
|
294
294
|
def dependency_api_uri(gem_names = [])
|
295
|
-
url = "#{
|
295
|
+
url = "#{redirected_uri}api/v1/dependencies"
|
296
296
|
url << "?gems=#{URI.encode(gem_names.join(","))}" if gem_names.any?
|
297
297
|
URI.parse(url)
|
298
298
|
end
|
@@ -378,5 +378,19 @@ module Bundler
|
|
378
378
|
yield
|
379
379
|
end
|
380
380
|
|
381
|
+
private
|
382
|
+
def redirected_uri
|
383
|
+
return bundler_uri if rubygems?
|
384
|
+
return @remote_uri
|
385
|
+
end
|
386
|
+
|
387
|
+
def rubygems?
|
388
|
+
@remote_uri.host == "rubygems.org"
|
389
|
+
end
|
390
|
+
|
391
|
+
def bundler_uri
|
392
|
+
URI.parse("#{@remote_uri.scheme}://bundler.#{@remote_uri.host}/")
|
393
|
+
end
|
394
|
+
|
381
395
|
end
|
382
396
|
end
|
@@ -160,7 +160,7 @@ module Bundler
|
|
160
160
|
|
161
161
|
def spec_from_gem(path, policy = nil)
|
162
162
|
require 'rubygems/security'
|
163
|
-
gem_from_path(path,
|
163
|
+
gem_from_path(path, security_policies[policy]).spec
|
164
164
|
rescue Gem::Package::FormatError
|
165
165
|
raise GemspecError, "Could not read gem at #{path}. It may be corrupted."
|
166
166
|
rescue Exception, Gem::Exception, Gem::Security::Exception => e
|
@@ -40,6 +40,7 @@ module Bundler
|
|
40
40
|
@ref = ref
|
41
41
|
@revision = revision
|
42
42
|
@allow = allow || Proc.new { true }
|
43
|
+
raise GitNotInstalledError.new unless Bundler.git_present?
|
43
44
|
end
|
44
45
|
|
45
46
|
def revision
|
@@ -64,12 +65,12 @@ module Bundler
|
|
64
65
|
return if has_revision_cached?
|
65
66
|
Bundler.ui.confirm "Updating #{uri}"
|
66
67
|
in_path do
|
67
|
-
|
68
|
+
git_retry %|fetch --force --quiet --tags #{uri_escaped} "refs/heads/*:refs/heads/*"|
|
68
69
|
end
|
69
70
|
else
|
70
71
|
Bundler.ui.info "Fetching #{uri}"
|
71
72
|
FileUtils.mkdir_p(path.dirname)
|
72
|
-
|
73
|
+
git_retry %|clone #{uri_escaped} "#{path}" --bare --no-hardlinks --quiet|
|
73
74
|
end
|
74
75
|
end
|
75
76
|
|
@@ -77,16 +78,16 @@ module Bundler
|
|
77
78
|
unless File.exist?(destination.join(".git"))
|
78
79
|
FileUtils.mkdir_p(destination.dirname)
|
79
80
|
FileUtils.rm_rf(destination)
|
80
|
-
|
81
|
+
git_retry %|clone --no-checkout --quiet "#{path}" "#{destination}"|
|
81
82
|
File.chmod((0777 & ~File.umask), destination)
|
82
83
|
end
|
83
84
|
|
84
85
|
SharedHelpers.chdir(destination) do
|
85
|
-
|
86
|
+
git_retry %|fetch --force --quiet --tags "#{path}"|
|
86
87
|
git "reset --hard #{@revision}"
|
87
88
|
|
88
89
|
if submodules
|
89
|
-
|
90
|
+
git_retry "submodule update --init --recursive"
|
90
91
|
end
|
91
92
|
end
|
92
93
|
end
|
@@ -102,14 +103,17 @@ module Bundler
|
|
102
103
|
git("#{command} 2>#{Bundler::NULL}", false)
|
103
104
|
end
|
104
105
|
|
106
|
+
def git_retry(command)
|
107
|
+
Bundler::Retry.new("git #{command}", GitNotAllowedError).attempts do
|
108
|
+
git(command)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
105
112
|
def git(command, check_errors=true)
|
106
113
|
raise GitNotAllowedError.new(command) unless allow?
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
raise GitCommandError.new(command, path) if check_errors && !$?.success?
|
111
|
-
out
|
112
|
-
end
|
114
|
+
out = SharedHelpers.with_clean_git_env { %x{git #{command}} }
|
115
|
+
raise GitCommandError.new(command, path) if check_errors && !$?.success?
|
116
|
+
out
|
113
117
|
end
|
114
118
|
|
115
119
|
def has_revision_cached?
|
@@ -14,3 +14,11 @@ RSpec::Core::RakeTask.new(:spec)
|
|
14
14
|
|
15
15
|
task :default => :spec
|
16
16
|
<% end -%>
|
17
|
+
|
18
|
+
<% if config[:ext] -%>
|
19
|
+
require "rake/extensiontask"
|
20
|
+
|
21
|
+
Rake::ExtensionTask.new("<%=config[:underscored_name]%>") do |ext|
|
22
|
+
ext.lib_dir = "lib/<%=config[:namespaced_path]%>"
|
23
|
+
end
|
24
|
+
<% end -%>
|
@@ -8,6 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = <%=config[:constant_name]%>::VERSION
|
9
9
|
spec.authors = [<%=config[:author].inspect%>]
|
10
10
|
spec.email = [<%=config[:email].inspect%>]
|
11
|
+
<% if config[:ext] -%>
|
12
|
+
spec.extensions = ["ext/<%=config[:underscored_name]%>/extconf.rb"]
|
13
|
+
<% end -%>
|
11
14
|
spec.summary = %q{TODO: Write a short summary. Required.}
|
12
15
|
spec.description = %q{TODO: Write a longer description. Optional.}
|
13
16
|
spec.homepage = ""
|
@@ -20,6 +23,9 @@ Gem::Specification.new do |spec|
|
|
20
23
|
|
21
24
|
spec.add_development_dependency "bundler", "~> <%= Bundler::VERSION.split(".")[0..1].join(".") %>"
|
22
25
|
spec.add_development_dependency "rake"
|
26
|
+
<% if config[:ext] -%>
|
27
|
+
spec.add_development_dependency "rake-compiler"
|
28
|
+
<% end -%>
|
23
29
|
<% if config[:test] -%>
|
24
30
|
spec.add_development_dependency "<%=config[:test]%>"
|
25
31
|
<% end -%>
|
@@ -203,7 +203,7 @@ class Net::HTTP::Persistent
|
|
203
203
|
##
|
204
204
|
# The version of Net::HTTP::Persistent you are using
|
205
205
|
|
206
|
-
VERSION = '2.9'
|
206
|
+
VERSION = '2.9.3'
|
207
207
|
|
208
208
|
##
|
209
209
|
# Exceptions rescued for automatic retry on ruby 2.0.0. This overlaps with
|
@@ -616,8 +616,6 @@ class Net::HTTP::Persistent
|
|
616
616
|
if @proxy_uri and not proxy_bypass? uri.host, uri.port then
|
617
617
|
connection_id << @proxy_connection_id
|
618
618
|
net_http_args.concat @proxy_args
|
619
|
-
elsif proxy_bypass? uri.host, uri.port then
|
620
|
-
net_http_args.concat [nil, nil]
|
621
619
|
end
|
622
620
|
|
623
621
|
connection = connections[connection_id]
|
@@ -633,6 +631,7 @@ class Net::HTTP::Persistent
|
|
633
631
|
start connection unless connection.started?
|
634
632
|
|
635
633
|
connection.read_timeout = @read_timeout if @read_timeout
|
634
|
+
connection.keep_alive_timeout = @idle_timeout if @idle_timeout && connection.respond_to?(:keep_alive_timeout=)
|
636
635
|
|
637
636
|
connection
|
638
637
|
rescue Errno::ECONNREFUSED
|
@@ -668,6 +667,14 @@ class Net::HTTP::Persistent
|
|
668
667
|
CGI.escape str if str
|
669
668
|
end
|
670
669
|
|
670
|
+
##
|
671
|
+
# URI::unescape wrapper
|
672
|
+
|
673
|
+
def unescape str
|
674
|
+
CGI.unescape str if str
|
675
|
+
end
|
676
|
+
|
677
|
+
|
671
678
|
##
|
672
679
|
# Returns true if the connection should be reset due to an idle timeout, or
|
673
680
|
# maximum request count, false otherwise.
|
@@ -860,8 +867,8 @@ class Net::HTTP::Persistent
|
|
860
867
|
@proxy_args = [
|
861
868
|
@proxy_uri.host,
|
862
869
|
@proxy_uri.port,
|
863
|
-
@proxy_uri.user,
|
864
|
-
@proxy_uri.password,
|
870
|
+
unescape(@proxy_uri.user),
|
871
|
+
unescape(@proxy_uri.password),
|
865
872
|
]
|
866
873
|
|
867
874
|
@proxy_connection_id = [nil, *@proxy_args].join ':'
|
@@ -957,9 +964,13 @@ class Net::HTTP::Persistent
|
|
957
964
|
|
958
965
|
start connection
|
959
966
|
rescue Errno::ECONNREFUSED
|
960
|
-
|
967
|
+
e = Error.new "connection refused: #{connection.address}:#{connection.port}"
|
968
|
+
e.set_backtrace $@
|
969
|
+
raise e
|
961
970
|
rescue Errno::EHOSTDOWN
|
962
|
-
|
971
|
+
e = Error.new "host down: #{connection.address}:#{connection.port}"
|
972
|
+
e.set_backtrace $@
|
973
|
+
raise e
|
963
974
|
end
|
964
975
|
|
965
976
|
##
|
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.6.0.
|
5
|
+
VERSION = "1.6.0.rc2" unless defined?(::Bundler::VERSION)
|
6
6
|
end
|
data/man/bundle-config.ronn
CHANGED
@@ -86,12 +86,6 @@ learn more about their operation in [bundle install(1)][bundle-install].
|
|
86
86
|
* `bin` (`BUNDLE_BIN`):
|
87
87
|
Install executables from gems in the bundle to the specified directory.
|
88
88
|
Defaults to `false`.
|
89
|
-
* `gemfile` (`BUNDLE_GEMFILE`):
|
90
|
-
The name of the file that bundler should use as the `Gemfile`. This location
|
91
|
-
of this file also sets the root of the project, which is used to resolve
|
92
|
-
relative paths in the `Gemfile`, among other things. By default, bundler
|
93
|
-
will search up from the current working directory until it finds a
|
94
|
-
`Gemfile`.
|
95
89
|
* `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
|
96
90
|
Path to a designated CA certificate file or folder containing multiple
|
97
91
|
certificates for trusted CAs in PEM format.
|
@@ -106,6 +100,18 @@ You can set them globally either via environment variables or `bundle config`,
|
|
106
100
|
whichever is preferable for your setup. If you use both, environment variables
|
107
101
|
will take preference over global settings.
|
108
102
|
|
103
|
+
An additional setting is available only as an environment variable:
|
104
|
+
|
105
|
+
* `BUNDLE_GEMFILE`:
|
106
|
+
The name of the file that bundler should use as the `Gemfile`. This location
|
107
|
+
of this file also sets the root of the project, which is used to resolve
|
108
|
+
relative paths in the `Gemfile`, among other things. By default, bundler
|
109
|
+
will search up from the current working directory until it finds a
|
110
|
+
`Gemfile`.
|
111
|
+
|
112
|
+
Bundler will ignore any `BUNDLE_GEMFILE` entries in local or global
|
113
|
+
configuration files.
|
114
|
+
|
109
115
|
## LOCAL GIT REPOS
|
110
116
|
|
111
117
|
Bundler also allows you to work against a git repository locally
|
@@ -341,6 +341,7 @@ describe "bundle gem" do
|
|
341
341
|
RSpec::Core::RakeTask.new(:spec)
|
342
342
|
|
343
343
|
task :default => :spec
|
344
|
+
|
344
345
|
RAKEFILE
|
345
346
|
|
346
347
|
expect(bundled_app("test-gem/Rakefile").read).to eq(rakefile)
|
@@ -381,6 +382,7 @@ describe "bundle gem" do
|
|
381
382
|
end
|
382
383
|
|
383
384
|
task :default => :test
|
385
|
+
|
384
386
|
RAKEFILE
|
385
387
|
|
386
388
|
expect(bundled_app("test-gem/Rakefile").read).to eq(rakefile)
|
@@ -399,5 +401,23 @@ describe "bundle gem" do
|
|
399
401
|
expect(bundled_app("test-gem/test/minitest_helper.rb")).to_not exist
|
400
402
|
end
|
401
403
|
end
|
404
|
+
|
405
|
+
context "--ext parameter set" do
|
406
|
+
before do
|
407
|
+
reset!
|
408
|
+
in_app_root
|
409
|
+
bundle "gem test_gem --ext"
|
410
|
+
end
|
411
|
+
|
412
|
+
it "builds ext skeleton" do
|
413
|
+
expect(bundled_app("test_gem/ext/test_gem/extconf.rb")).to exist
|
414
|
+
expect(bundled_app("test_gem/ext/test_gem/test_gem.h")).to exist
|
415
|
+
expect(bundled_app("test_gem/ext/test_gem/test_gem.c")).to exist
|
416
|
+
end
|
417
|
+
|
418
|
+
it "includes rake-compiler" do
|
419
|
+
expect(bundled_app("test_gem/test_gem.gemspec").read).to include('spec.add_development_dependency "rake-compiler"')
|
420
|
+
end
|
421
|
+
end
|
402
422
|
end
|
403
423
|
end
|
data/spec/commands/show_spec.rb
CHANGED
@@ -59,6 +59,13 @@ describe "bundle show" do
|
|
59
59
|
gem_list = out.split.map { |p| p.split('/').last }
|
60
60
|
expect(gem_list).to eq(gem_list.sort)
|
61
61
|
end
|
62
|
+
|
63
|
+
it "prints summary of gems" do
|
64
|
+
bundle "show --verbose"
|
65
|
+
|
66
|
+
expect(out).to include(' - This is just a fake gem for testing')
|
67
|
+
expect(out).to include(' - Ruby based make-like utility.')
|
68
|
+
end
|
62
69
|
end
|
63
70
|
|
64
71
|
context "with a git repo in the Gemfile" do
|
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: 1.6.0.
|
4
|
+
version: 1.6.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Arko
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-03-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: ronn
|
@@ -112,22 +112,6 @@ files:
|
|
112
112
|
- lib/bundler/installer.rb
|
113
113
|
- lib/bundler/lazy_specification.rb
|
114
114
|
- lib/bundler/lockfile_parser.rb
|
115
|
-
- lib/bundler/man/bundle
|
116
|
-
- lib/bundler/man/bundle-config
|
117
|
-
- lib/bundler/man/bundle-config.txt
|
118
|
-
- lib/bundler/man/bundle-exec
|
119
|
-
- lib/bundler/man/bundle-exec.txt
|
120
|
-
- lib/bundler/man/bundle-install
|
121
|
-
- lib/bundler/man/bundle-install.txt
|
122
|
-
- lib/bundler/man/bundle-package
|
123
|
-
- lib/bundler/man/bundle-package.txt
|
124
|
-
- lib/bundler/man/bundle-platform
|
125
|
-
- lib/bundler/man/bundle-platform.txt
|
126
|
-
- lib/bundler/man/bundle-update
|
127
|
-
- lib/bundler/man/bundle-update.txt
|
128
|
-
- lib/bundler/man/bundle.txt
|
129
|
-
- lib/bundler/man/gemfile.5
|
130
|
-
- lib/bundler/man/gemfile.5.txt
|
131
115
|
- lib/bundler/match_platform.rb
|
132
116
|
- lib/bundler/parallel_workers.rb
|
133
117
|
- lib/bundler/parallel_workers/thread_worker.rb
|
@@ -168,6 +152,9 @@ files:
|
|
168
152
|
- lib/bundler/templates/newgem/README.md.tt
|
169
153
|
- lib/bundler/templates/newgem/Rakefile.tt
|
170
154
|
- lib/bundler/templates/newgem/bin/newgem.tt
|
155
|
+
- lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt
|
156
|
+
- lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
|
157
|
+
- lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
|
171
158
|
- lib/bundler/templates/newgem/gitignore.tt
|
172
159
|
- lib/bundler/templates/newgem/lib/newgem.rb.tt
|
173
160
|
- lib/bundler/templates/newgem/lib/newgem/version.rb.tt
|
@@ -336,6 +323,22 @@ files:
|
|
336
323
|
- spec/update/gems_spec.rb
|
337
324
|
- spec/update/git_spec.rb
|
338
325
|
- spec/update/source_spec.rb
|
326
|
+
- lib/bundler/man/bundle
|
327
|
+
- lib/bundler/man/bundle-config
|
328
|
+
- lib/bundler/man/bundle-config.txt
|
329
|
+
- lib/bundler/man/bundle-exec
|
330
|
+
- lib/bundler/man/bundle-exec.txt
|
331
|
+
- lib/bundler/man/bundle-install
|
332
|
+
- lib/bundler/man/bundle-install.txt
|
333
|
+
- lib/bundler/man/bundle-package
|
334
|
+
- lib/bundler/man/bundle-package.txt
|
335
|
+
- lib/bundler/man/bundle-platform
|
336
|
+
- lib/bundler/man/bundle-platform.txt
|
337
|
+
- lib/bundler/man/bundle-update
|
338
|
+
- lib/bundler/man/bundle-update.txt
|
339
|
+
- lib/bundler/man/bundle.txt
|
340
|
+
- lib/bundler/man/gemfile.5
|
341
|
+
- lib/bundler/man/gemfile.5.txt
|
339
342
|
homepage: http://bundler.io
|
340
343
|
licenses:
|
341
344
|
- MIT
|
@@ -356,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
356
359
|
version: 1.3.6
|
357
360
|
requirements: []
|
358
361
|
rubyforge_project:
|
359
|
-
rubygems_version: 2.
|
362
|
+
rubygems_version: 2.1.11
|
360
363
|
signing_key:
|
361
364
|
specification_version: 4
|
362
365
|
summary: The best way to manage your application's dependencies
|