bundler 1.3.3 → 1.3.4

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.

@@ -1,4 +1,11 @@
1
- ## 1.3.3
1
+ ## 1.3.4 (15 March 2103)
2
+
3
+ Bugfixes:
4
+
5
+ - load YAML on Rubygems version that define module YAML
6
+ - fix regression that broke --without on ruby 1.8.7
7
+
8
+ ## 1.3.3 (13 March 2013)
2
9
 
3
10
  Features:
4
11
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Bundler: a gem to bundle gems [![Build Status](https://secure.travis-ci.org/carlhuda/bundler.png?branch=master)](http://travis-ci.org/carlhuda/bundler)
1
+ # Bundler: a gem to bundle gems [![Build Status](https://secure.travis-ci.org/carlhuda/bundler.png?branch=1-3-stable)](http://travis-ci.org/carlhuda/bundler)
2
2
 
3
3
  Bundler keeps ruby applications running the same code on every machine.
4
4
 
@@ -264,15 +264,17 @@ module Bundler
264
264
  end
265
265
 
266
266
  clean if Bundler.settings[:clean] && Bundler.settings[:path]
267
- rescue GemNotFound => e
267
+ rescue GemNotFound, VersionConflict => e
268
268
  if opts[:local] && Bundler.app_cache.exist?
269
269
  Bundler.ui.warn "Some gems seem to be missing from your vendor/cache directory."
270
270
  end
271
271
 
272
- if Bundler.definition.no_sources?
273
- Bundler.ui.warn "Your Gemfile has no remote sources. If you need " \
274
- "gems that are not already on\nyour machine, add a line like this " \
275
- "to your Gemfile:\n source 'https://rubygems.org'"
272
+ if Bundler.definition.rubygems_remotes.empty?
273
+ Bundler.ui.warn <<-WARN, :wrap => true
274
+ Your Gemfile has no gem server sources. If you need gems that are \
275
+ not already on your machine, add a line like this to your Gemfile:
276
+ source 'https://rubygems.org'
277
+ WARN
276
278
  end
277
279
  raise e
278
280
  end
@@ -647,6 +649,8 @@ module Bundler
647
649
  method_option :requirements, :type => :boolean, :default => false, :aliases => '-r', :banner => "Set to show the version of each required dependency."
648
650
  method_option :format, :type => :string, :default => "png", :aliases => '-F', :banner => "This is output format option. Supported format is png, jpg, svg, dot ..."
649
651
  def viz
652
+ require 'graphviz'
653
+
650
654
  output_file = File.expand_path(options[:file])
651
655
  graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format])
652
656
 
@@ -863,8 +867,8 @@ module Bundler
863
867
 
864
868
  def without_groups_message
865
869
  groups = Bundler.settings.without
866
- group_list = [groups[0...-1].join(", "), groups[-1]].
867
- reject{|s| s.empty? }.join(" and ")
870
+ group_list = [groups[0...-1].join(", "), groups[-1..-1]].
871
+ reject{|s| s.to_s.empty? }.join(" and ")
868
872
  group_str = (groups.size == 1) ? "group" : "groups"
869
873
  "Gems in the #{group_str} #{group_list} were not installed."
870
874
  end
@@ -208,8 +208,8 @@ module Bundler
208
208
  end
209
209
  end
210
210
 
211
- def no_sources?
212
- @sources.length == 1 && @sources.first.remotes.empty?
211
+ def rubygems_remotes
212
+ @sources.select{|s| s.is_a?(Source::Rubygems) }.map{|s| s.remotes }.flatten
213
213
  end
214
214
 
215
215
  def groups
@@ -18,7 +18,7 @@ module Bundler
18
18
  " is a chance you are experiencing a man-in-the-middle attack, but" \
19
19
  " most likely your system doesn't have the CA certificates needed" \
20
20
  " for verification. For information about OpenSSL certificates, see" \
21
- " bit.ly/ssl-certs. To connect without using SSL, edit your Gemfile" \
21
+ " bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile" \
22
22
  " sources and change 'https' to 'http'."
23
23
  end
24
24
  end
@@ -68,7 +68,7 @@ module Bundler
68
68
  @remote_uri = remote_uri
69
69
  @public_uri = remote_uri.dup
70
70
  @public_uri.user, @public_uri.password = nil, nil # don't print these
71
- if defined?(OpenSSL::SSL)
71
+ if defined?(Net::HTTP::Persistent)
72
72
  @connection = Net::HTTP::Persistent.new 'bundler', :ENV
73
73
  @connection.verify_mode = (Bundler.settings[:ssl_verify_mode] ||
74
74
  OpenSSL::SSL::VERIFY_PEER)
@@ -198,7 +198,7 @@ module Bundler
198
198
 
199
199
  begin
200
200
  Bundler.ui.debug "Fetching from: #{uri}"
201
- if @connection.is_a?(Net::HTTP::Persistent)
201
+ if defined?(Net::HTTP::Persistent)
202
202
  response = @connection.request(uri)
203
203
  else
204
204
  req = Net::HTTP::Get.new uri.request_uri
@@ -8,9 +8,11 @@ module Bundler
8
8
  rescue LoadError => e
9
9
  raise e unless e.message =~ /cannot load such file -- openssl|openssl.so|libcrypto.so/
10
10
  Bundler.ui.error "\nCould not load OpenSSL."
11
- Bundler.ui.warn "You must recompile Ruby with OpenSSL support or change the sources in your" \
12
- "\nGemfile from 'https' to 'http'. Instructions for compiling with OpenSSL" \
13
- "\nusing RVM are available at rvm.io/packages/openssl."
11
+ Bundler.ui.warn <<-WARN, :wrap => true
12
+ You must recompile Ruby with OpenSSL support or change the sources in your \
13
+ Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL \
14
+ using RVM are available at rvm.io/packages/openssl.
15
+ WARN
14
16
  Bundler.ui.trace e
15
17
  exit 1
16
18
  rescue Interrupt => e
@@ -21,9 +23,8 @@ module Bundler
21
23
  exit e.status
22
24
  rescue Exception => e
23
25
  Bundler.ui.error <<-ERR, :wrap => true
24
- Unfortunately, a fatal error has occurred. Please see the Bundler
26
+ Unfortunately, a fatal error has occurred. Please see the Bundler \
25
27
  troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
26
-
27
28
  ERR
28
29
  raise e
29
30
  end
@@ -118,7 +118,6 @@ module Bundler
118
118
  end
119
119
 
120
120
  def g
121
- require 'graphviz'
122
121
  @g ||= ::GraphViz.digraph(@graph_name, {:concentrate => true, :normalize => true, :nodesep => 0.55}) do |g|
123
122
  g.edge[:weight] = 2
124
123
  g.edge[:fontname] = g.node[:fontname] = 'Arial, Helvetica, SansSerif'
@@ -13,7 +13,7 @@ rescue LoadError
13
13
  end
14
14
 
15
15
  # At least load the YAML stdlib, whatever that may be
16
- require 'yaml' unless defined?(YAML)
16
+ require 'yaml' unless defined?(YAML.dump)
17
17
 
18
18
  module Bundler
19
19
  # On encountering invalid YAML,
@@ -3,7 +3,7 @@ require "bundler/gem_tasks"
3
3
  require "rake/testtask"
4
4
 
5
5
  Rake::TestTask.new(:test) do |t|
6
- t.libs << "lib" << "test"
6
+ t.libs << "test"
7
7
  end
8
8
 
9
9
  task :default => :test
@@ -110,8 +110,13 @@ module Bundler
110
110
  end
111
111
  end
112
112
 
113
+ def strip_leading_spaces(text)
114
+ spaces = text[/\A\s+/, 0]
115
+ spaces ? text.gsub(/#{spaces}/, '') : text
116
+ end
117
+
113
118
  def word_wrap(text, line_width = @shell.terminal_width)
114
- text.split("\n").collect do |line|
119
+ strip_leading_spaces(text).split("\n").collect do |line|
115
120
  line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip : line
116
121
  end * "\n"
117
122
  end
@@ -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.3" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.3.4" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -291,7 +291,7 @@ describe "bundle install with gem sources" do
291
291
  G
292
292
 
293
293
  bundle :install, :expect_err => true
294
- expect(out).to match(/Your Gemfile has no remote sources/i)
294
+ expect(out).to match(/Your Gemfile has no gem server sources/i)
295
295
  end
296
296
 
297
297
  it "creates a Gemfile.lock on a blank Gemfile" do
@@ -509,7 +509,7 @@ describe "bundle install with gem sources" do
509
509
  G
510
510
 
511
511
  bundle :install, :quiet => true
512
- expect(out).to match(/Your Gemfile has no remote sources/)
512
+ expect(out).to match(/Your Gemfile has no gem server sources/)
513
513
  end
514
514
  end
515
515
 
@@ -89,11 +89,11 @@ describe "bundle gem" do
89
89
  it "runs rake without problems" do
90
90
  system_gems ["rake-10.0.2"]
91
91
 
92
- rakefile = <<-RAKEFILE
92
+ rakefile = strip_whitespace <<-RAKEFILE
93
93
  task :default do
94
94
  puts 'SUCCESS'
95
95
  end
96
- RAKEFILE
96
+ RAKEFILE
97
97
  File.open(bundled_app("test_gem/Rakefile"), 'w') do |file|
98
98
  file.puts rakefile
99
99
  end
@@ -265,11 +265,11 @@ RAKEFILE
265
265
  it "runs rake without problems" do
266
266
  system_gems ["rake-10.0.2"]
267
267
 
268
- rakefile = <<-RAKEFILE
268
+ rakefile = strip_whitespace <<-RAKEFILE
269
269
  task :default do
270
270
  puts 'SUCCESS'
271
271
  end
272
- RAKEFILE
272
+ RAKEFILE
273
273
  File.open(bundled_app("test-gem/Rakefile"), 'w') do |file|
274
274
  file.puts rakefile
275
275
  end
@@ -332,6 +332,19 @@ RAKEFILE
332
332
  it "creates a default test which fails" do
333
333
  expect(bundled_app("test-gem/spec/test/gem_spec.rb").read).to match(/false.should be_true/)
334
334
  end
335
+
336
+ it "creates a default rake task to run the specs" do
337
+ rakefile = strip_whitespace <<-RAKEFILE
338
+ require "bundler/gem_tasks"
339
+ require "rspec/core/rake_task"
340
+
341
+ RSpec::Core::RakeTask.new(:spec)
342
+
343
+ task :default => :spec
344
+ RAKEFILE
345
+
346
+ expect(bundled_app("test-gem/Rakefile").read).to eq(rakefile)
347
+ end
335
348
  end
336
349
 
337
350
  context "--test parameter set to minitest" do
@@ -358,17 +371,17 @@ RAKEFILE
358
371
  expect(bundled_app("test-gem/test/test_test/gem.rb").read).to match(/assert false/)
359
372
  end
360
373
 
361
- it "creates a default rake task to run test suite" do
362
- rakefile = <<-RAKEFILE
363
- require "bundler/gem_tasks"
364
- require "rake/testtask"
374
+ it "creates a default rake task to run the test suite" do
375
+ rakefile = strip_whitespace <<-RAKEFILE
376
+ require "bundler/gem_tasks"
377
+ require "rake/testtask"
365
378
 
366
- Rake::TestTask.new :test do |t|
367
- t.libs << 'test'
368
- end
379
+ Rake::TestTask.new(:test) do |t|
380
+ t.libs << "test"
381
+ end
369
382
 
370
- task default: :test
371
- RAKEFILE
383
+ task :default => :test
384
+ RAKEFILE
372
385
 
373
386
  expect(bundled_app("test-gem/Rakefile").read).to eq(rakefile)
374
387
  end
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.3.3
4
+ version: 1.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-03-13 00:00:00.000000000 Z
15
+ date: 2013-03-15 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: ronn