bundler 1.7.15 → 1.8.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +5 -14
- data/.rspec +1 -0
- data/.travis.yml +22 -15
- data/CHANGELOG.md +43 -13
- data/CODE_OF_CONDUCT.md +40 -0
- data/CONTRIBUTING.md +14 -12
- data/DEVELOPMENT.md +4 -2
- data/ISSUES.md +1 -1
- data/README.md +10 -14
- data/Rakefile +10 -10
- data/bin/bundle +1 -1
- data/bundler.gemspec +5 -4
- data/lib/bundler.rb +22 -3
- data/lib/bundler/anonymizable_uri.rb +24 -8
- data/lib/bundler/cli.rb +103 -66
- data/lib/bundler/cli/cache.rb +1 -0
- data/lib/bundler/cli/clean.rb +11 -4
- data/lib/bundler/cli/common.rb +2 -0
- data/lib/bundler/cli/console.rb +22 -26
- data/lib/bundler/cli/exec.rb +29 -22
- data/lib/bundler/cli/gem.rb +125 -37
- data/lib/bundler/cli/install.rb +22 -9
- data/lib/bundler/cli/outdated.rb +1 -1
- data/lib/bundler/cli/package.rb +8 -1
- data/lib/bundler/cli/show.rb +29 -3
- data/lib/bundler/cli/update.rb +2 -2
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/definition.rb +14 -22
- data/lib/bundler/dependency.rb +8 -1
- data/lib/bundler/dsl.rb +17 -4
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +44 -25
- data/lib/bundler/fetcher.rb +33 -25
- data/lib/bundler/friendly_errors.rb +38 -5
- data/lib/bundler/gem_helper.rb +16 -10
- data/lib/bundler/gem_helpers.rb +1 -0
- data/lib/bundler/graph.rb +4 -1
- data/lib/bundler/index.rb +15 -25
- data/lib/bundler/installer.rb +6 -6
- data/lib/bundler/lockfile_parser.rb +7 -7
- data/lib/bundler/resolver.rb +2 -1
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +1 -0
- data/lib/bundler/rubygems_integration.rb +1 -1
- data/lib/bundler/runtime.rb +22 -40
- data/lib/bundler/settings.rb +14 -5
- data/lib/bundler/setup.rb +2 -1
- data/lib/bundler/shared_helpers.rb +56 -4
- data/lib/bundler/source.rb +8 -9
- data/lib/bundler/source/git.rb +5 -1
- data/lib/bundler/source/git/git_proxy.rb +4 -0
- data/lib/bundler/source/path.rb +8 -11
- data/lib/bundler/source/path/installer.rb +0 -2
- data/lib/bundler/source/rubygems.rb +58 -72
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +13 -0
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +17 -18
- data/lib/bundler/templates/newgem/README.md.tt +9 -1
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
- data/lib/bundler/templates/newgem/bin/console.tt +14 -0
- data/lib/bundler/templates/newgem/bin/setup.tt +7 -0
- data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/gitignore.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -13
- data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +1 -1
- data/lib/bundler/ui/shell.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +73 -0
- data/man/bundle-config.ronn +17 -15
- data/man/bundle-install.ronn +102 -93
- data/man/bundle-update.ronn +39 -30
- data/man/bundle.ronn +6 -0
- data/man/gemfile.5.ronn +74 -13
- metadata +10 -231
- data/lib/bundler/parallel_workers.rb +0 -18
- data/lib/bundler/parallel_workers/thread_worker.rb +0 -30
- data/lib/bundler/parallel_workers/unix_worker.rb +0 -101
- data/lib/bundler/parallel_workers/worker.rb +0 -69
- data/lib/bundler/templates/newgem/bin/newgem.tt +0 -3
- data/spec/bundler/anonymizable_uri_spec.rb +0 -32
- data/spec/bundler/bundler_spec.rb +0 -72
- data/spec/bundler/cli_spec.rb +0 -16
- data/spec/bundler/definition_spec.rb +0 -22
- data/spec/bundler/dsl_spec.rb +0 -82
- data/spec/bundler/friendly_errors_spec.rb +0 -13
- data/spec/bundler/gem_helper_spec.rb +0 -226
- data/spec/bundler/psyched_yaml_spec.rb +0 -8
- data/spec/bundler/retry_spec.rb +0 -59
- data/spec/bundler/settings_spec.rb +0 -13
- data/spec/bundler/source/rubygems_spec.rb +0 -25
- data/spec/bundler/source_list_spec.rb +0 -361
- data/spec/cache/gems_spec.rb +0 -284
- data/spec/cache/git_spec.rb +0 -188
- data/spec/cache/path_spec.rb +0 -121
- data/spec/cache/platform_spec.rb +0 -57
- data/spec/commands/binstubs_spec.rb +0 -219
- data/spec/commands/check_spec.rb +0 -278
- data/spec/commands/clean_spec.rb +0 -592
- data/spec/commands/config_spec.rb +0 -263
- data/spec/commands/console_spec.rb +0 -76
- data/spec/commands/exec_spec.rb +0 -309
- data/spec/commands/help_spec.rb +0 -39
- data/spec/commands/init_spec.rb +0 -39
- data/spec/commands/inject_spec.rb +0 -78
- data/spec/commands/licenses_spec.rb +0 -18
- data/spec/commands/newgem_spec.rb +0 -428
- data/spec/commands/open_spec.rb +0 -68
- data/spec/commands/outdated_spec.rb +0 -156
- data/spec/commands/package_spec.rb +0 -114
- data/spec/commands/show_spec.rb +0 -125
- data/spec/install/binstubs_spec.rb +0 -24
- data/spec/install/bundler_spec.rb +0 -146
- data/spec/install/deploy_spec.rb +0 -250
- data/spec/install/gemfile/gemspec_spec.rb +0 -170
- data/spec/install/gemfile/git_spec.rb +0 -967
- data/spec/install/gemfile/path_spec.rb +0 -500
- data/spec/install/gemfile_spec.rb +0 -44
- data/spec/install/gems/c_ext_spec.rb +0 -48
- data/spec/install/gems/dependency_api_spec.rb +0 -652
- data/spec/install/gems/env_spec.rb +0 -107
- data/spec/install/gems/flex_spec.rb +0 -314
- data/spec/install/gems/groups_spec.rb +0 -308
- data/spec/install/gems/mirror_spec.rb +0 -39
- data/spec/install/gems/platform_spec.rb +0 -195
- data/spec/install/gems/post_install_spec.rb +0 -121
- data/spec/install/gems/resolving_spec.rb +0 -124
- data/spec/install/gems/simple_case_spec.rb +0 -377
- data/spec/install/gems/sources_spec.rb +0 -386
- data/spec/install/gems/standalone_spec.rb +0 -260
- data/spec/install/gems/sudo_spec.rb +0 -136
- data/spec/install/gems/win32_spec.rb +0 -26
- data/spec/install/gemspecs_spec.rb +0 -50
- data/spec/install/path_spec.rb +0 -150
- data/spec/install/post_bundle_message_spec.rb +0 -142
- data/spec/install/prereleases_spec.rb +0 -43
- data/spec/install/security_policy_spec.rb +0 -77
- data/spec/install/upgrade_spec.rb +0 -26
- data/spec/lock/git_spec.rb +0 -34
- data/spec/lock/lockfile_spec.rb +0 -924
- data/spec/other/bundle_ruby_spec.rb +0 -142
- data/spec/other/cli_dispatch_spec.rb +0 -21
- data/spec/other/ext_spec.rb +0 -60
- data/spec/other/platform_spec.rb +0 -1285
- data/spec/other/ssl_cert_spec.rb +0 -23
- data/spec/quality_spec.rb +0 -88
- data/spec/realworld/dependency_api_spec.rb +0 -60
- data/spec/realworld/edgecases_spec.rb +0 -212
- data/spec/realworld/parallel_spec.rb +0 -71
- data/spec/resolver/basic_spec.rb +0 -66
- data/spec/resolver/platform_spec.rb +0 -88
- data/spec/runtime/executable_spec.rb +0 -149
- data/spec/runtime/load_spec.rb +0 -107
- data/spec/runtime/platform_spec.rb +0 -90
- data/spec/runtime/require_spec.rb +0 -332
- data/spec/runtime/setup_spec.rb +0 -853
- data/spec/runtime/with_clean_env_spec.rb +0 -91
- data/spec/spec_helper.rb +0 -123
- data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +0 -13
- data/spec/support/artifice/endpoint.rb +0 -71
- data/spec/support/artifice/endpoint_500.rb +0 -37
- data/spec/support/artifice/endpoint_api_forbidden.rb +0 -11
- data/spec/support/artifice/endpoint_api_missing.rb +0 -16
- data/spec/support/artifice/endpoint_basic_authentication.rb +0 -13
- data/spec/support/artifice/endpoint_creds_diff_host.rb +0 -38
- data/spec/support/artifice/endpoint_extra.rb +0 -31
- data/spec/support/artifice/endpoint_extra_api.rb +0 -32
- data/spec/support/artifice/endpoint_extra_missing.rb +0 -15
- data/spec/support/artifice/endpoint_fallback.rb +0 -17
- data/spec/support/artifice/endpoint_host_redirect.rb +0 -15
- data/spec/support/artifice/endpoint_marshal_fail.rb +0 -11
- data/spec/support/artifice/endpoint_redirect.rb +0 -15
- data/spec/support/artifice/endpoint_strict_basic_authentication.rb +0 -18
- data/spec/support/artifice/endpoint_timeout.rb +0 -13
- data/spec/support/builders.rb +0 -693
- data/spec/support/fakeweb/rack-1.0.0.marshal +0 -2
- data/spec/support/fakeweb/windows.rb +0 -23
- data/spec/support/hax.rb +0 -22
- data/spec/support/helpers.rb +0 -361
- data/spec/support/indexes.rb +0 -280
- data/spec/support/matchers.rb +0 -77
- data/spec/support/path.rb +0 -85
- data/spec/support/permissions.rb +0 -10
- data/spec/support/platforms.rb +0 -94
- data/spec/support/ruby_ext.rb +0 -20
- data/spec/support/rubygems_ext.rb +0 -39
- data/spec/support/streams.rb +0 -13
- data/spec/support/sudo.rb +0 -16
- data/spec/update/gems_spec.rb +0 -201
- data/spec/update/git_spec.rb +0 -283
- data/spec/update/path_spec.rb +0 -18
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require "bundler/vendored_thor"
|
2
3
|
|
3
4
|
module Bundler
|
@@ -33,10 +34,42 @@ module Bundler
|
|
33
34
|
rescue SystemExit => e
|
34
35
|
exit e.status
|
35
36
|
rescue Exception => e
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
request_issue_report_for(e)
|
38
|
+
exit 1
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.request_issue_report_for(e)
|
42
|
+
Bundler.ui.info <<-EOS.gsub(/^ {6}/, '')
|
43
|
+
#{'――― ERROR REPORT TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――'}
|
44
|
+
- What did you do?
|
45
|
+
- What did you expect to happen?
|
46
|
+
- What happened instead?
|
47
|
+
|
48
|
+
Error details
|
49
|
+
|
50
|
+
#{e.class}: #{e.message}
|
51
|
+
#{e.backtrace.join("\n ")}
|
52
|
+
|
53
|
+
#{Bundler::Env.new.report(:print_gemfile => false).gsub(/\n/, "\n ").strip}
|
54
|
+
#{'――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――'}
|
55
|
+
|
56
|
+
EOS
|
57
|
+
|
58
|
+
Bundler.ui.error "Unfortunately, an unexpected error occurred, and Bundler cannot continue."
|
59
|
+
|
60
|
+
Bundler.ui.warn <<-EOS.gsub(/^ {6}/, '')
|
61
|
+
|
62
|
+
First, try this link to see if there are any existing issue reports for this error:
|
63
|
+
#{issues_url(e)}
|
64
|
+
|
65
|
+
If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
|
66
|
+
https://github.com/bundler/bundler/issues/new
|
67
|
+
EOS
|
41
68
|
end
|
69
|
+
|
70
|
+
def self.issues_url(exception)
|
71
|
+
'https://github.com/bundler/bundler/search?q=' \
|
72
|
+
"#{CGI.escape(exception.message)}&type=Issues"
|
73
|
+
end
|
74
|
+
|
42
75
|
end
|
data/lib/bundler/gem_helper.rb
CHANGED
@@ -44,9 +44,22 @@ module Bundler
|
|
44
44
|
install_gem(built_gem_path)
|
45
45
|
end
|
46
46
|
|
47
|
-
desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to Rubygems"
|
48
|
-
|
49
|
-
|
47
|
+
desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to Rubygems\n" \
|
48
|
+
"To prevent publishing in Rubygems use `gem_push=no rake release`"
|
49
|
+
task 'release' => ['build', 'release:guard_clean',
|
50
|
+
'release:source_control_push', 'release:rubygem_push'] do
|
51
|
+
end
|
52
|
+
|
53
|
+
task 'release:guard_clean' do
|
54
|
+
guard_clean
|
55
|
+
end
|
56
|
+
|
57
|
+
task 'release:source_control_push' do
|
58
|
+
tag_version { git_push } unless already_tagged?
|
59
|
+
end
|
60
|
+
|
61
|
+
task 'release:rubygem_push' do
|
62
|
+
rubygem_push(built_gem_path) if gem_push?
|
50
63
|
end
|
51
64
|
|
52
65
|
GemHelper.instance = self
|
@@ -70,13 +83,6 @@ module Bundler
|
|
70
83
|
Bundler.ui.confirm "#{name} (#{version}) installed."
|
71
84
|
end
|
72
85
|
|
73
|
-
def release_gem(built_gem_path=nil)
|
74
|
-
guard_clean
|
75
|
-
built_gem_path ||= build_gem
|
76
|
-
tag_version { git_push } unless already_tagged?
|
77
|
-
rubygem_push(built_gem_path) if gem_push?
|
78
|
-
end
|
79
|
-
|
80
86
|
protected
|
81
87
|
def rubygem_push(path)
|
82
88
|
if Pathname.new("~/.gem/credentials").expand_path.exist?
|
data/lib/bundler/gem_helpers.rb
CHANGED
@@ -5,6 +5,7 @@ module Bundler
|
|
5
5
|
GENERICS = [
|
6
6
|
[Gem::Platform.new('java'), Gem::Platform.new('java')],
|
7
7
|
[Gem::Platform.new('mswin32'), Gem::Platform.new('mswin32')],
|
8
|
+
[Gem::Platform.new('mswin64'), Gem::Platform.new('mswin64')],
|
8
9
|
[Gem::Platform.new('x64-mingw32'), Gem::Platform.new('x64-mingw32')],
|
9
10
|
[Gem::Platform.new('x86_64-mingw32'), Gem::Platform.new('x64-mingw32')],
|
10
11
|
[Gem::Platform.new('mingw32'), Gem::Platform.new('x86-mingw32')]
|
data/lib/bundler/graph.rb
CHANGED
@@ -3,12 +3,13 @@ module Bundler
|
|
3
3
|
class Graph
|
4
4
|
GRAPH_NAME = :Gemfile
|
5
5
|
|
6
|
-
def initialize(env, output_file, show_version = false, show_requirements = false, output_format = "png")
|
6
|
+
def initialize(env, output_file, show_version = false, show_requirements = false, output_format = "png", without = [])
|
7
7
|
@env = env
|
8
8
|
@output_file = output_file
|
9
9
|
@show_version = show_version
|
10
10
|
@show_requirements = show_requirements
|
11
11
|
@output_format = output_format
|
12
|
+
@without_groups = without.map(&:to_sym)
|
12
13
|
|
13
14
|
@groups = []
|
14
15
|
@relations = Hash.new {|h, k| h[k] = Set.new}
|
@@ -53,6 +54,8 @@ module Bundler
|
|
53
54
|
relations = Hash.new {|h, k| h[k] = Set.new}
|
54
55
|
@env.current_dependencies.each do |dependency|
|
55
56
|
dependency.groups.each do |group|
|
57
|
+
next if @without_groups.include?(group)
|
58
|
+
|
56
59
|
relations[group.to_s].add(dependency)
|
57
60
|
@relations[group.to_s].add(dependency.name)
|
58
61
|
|
data/lib/bundler/index.rb
CHANGED
@@ -16,7 +16,7 @@ module Bundler
|
|
16
16
|
def initialize
|
17
17
|
@sources = []
|
18
18
|
@cache = {}
|
19
|
-
@specs = Hash.new { |h,k| h[k] =
|
19
|
+
@specs = Hash.new { |h,k| h[k] = Hash.new }
|
20
20
|
@all_specs = Hash.new { |h,k| h[k] = [] }
|
21
21
|
end
|
22
22
|
|
@@ -24,11 +24,11 @@ module Bundler
|
|
24
24
|
super
|
25
25
|
@sources = @sources.dup
|
26
26
|
@cache = {}
|
27
|
-
@specs = Hash.new { |h,k| h[k] =
|
27
|
+
@specs = Hash.new { |h,k| h[k] = Hash.new }
|
28
28
|
@all_specs = Hash.new { |h,k| h[k] = [] }
|
29
29
|
|
30
|
-
o.specs.each do |name,
|
31
|
-
@specs[name] =
|
30
|
+
o.specs.each do |name, hash|
|
31
|
+
@specs[name] = hash.dup
|
32
32
|
end
|
33
33
|
o.all_specs.each do |name, array|
|
34
34
|
@all_specs[name] = array.dup
|
@@ -88,33 +88,24 @@ module Bundler
|
|
88
88
|
alias [] search
|
89
89
|
|
90
90
|
def <<(spec)
|
91
|
-
|
91
|
+
@specs[spec.name]["#{spec.version}-#{spec.platform}"] = spec
|
92
92
|
|
93
|
-
arr.delete_if do |s|
|
94
|
-
same_version?(s.version, spec.version) && s.platform == spec.platform
|
95
|
-
end
|
96
|
-
|
97
|
-
arr << spec
|
98
93
|
spec
|
99
94
|
end
|
100
95
|
|
101
96
|
def each(&blk)
|
102
|
-
specs.values.each do |
|
103
|
-
|
97
|
+
specs.values.each do |spec_sets|
|
98
|
+
spec_sets.values.each(&blk)
|
104
99
|
end
|
105
100
|
end
|
106
101
|
|
107
102
|
# returns a list of the dependencies
|
108
103
|
def unmet_dependency_names
|
109
|
-
names = dependency_names
|
110
|
-
names.delete_if{|n| n == "bundler" }
|
111
|
-
names.select{|n| search(n).empty? }
|
112
|
-
end
|
113
|
-
|
114
|
-
def dependency_names
|
115
104
|
names = []
|
116
105
|
each{|s| names.push(*s.dependencies.map{|d| d.name }) }
|
117
|
-
names.uniq
|
106
|
+
names.uniq!
|
107
|
+
names.delete_if{|n| n == "bundler" }
|
108
|
+
names.select{|n| search(n).empty? }
|
118
109
|
end
|
119
110
|
|
120
111
|
def use(other, override_dupes = false)
|
@@ -123,9 +114,9 @@ module Bundler
|
|
123
114
|
if (dupes = search_by_spec(s)) && dupes.any?
|
124
115
|
@all_specs[s.name] = [s] + dupes
|
125
116
|
next unless override_dupes
|
126
|
-
|
117
|
+
self << s
|
127
118
|
end
|
128
|
-
|
119
|
+
self << s
|
129
120
|
end
|
130
121
|
self
|
131
122
|
end
|
@@ -155,7 +146,7 @@ module Bundler
|
|
155
146
|
private
|
156
147
|
|
157
148
|
def specs_by_name(name)
|
158
|
-
@specs[name]
|
149
|
+
@specs[name].values
|
159
150
|
end
|
160
151
|
|
161
152
|
def search_by_dependency(dependency, base = nil)
|
@@ -182,9 +173,8 @@ module Bundler
|
|
182
173
|
end
|
183
174
|
|
184
175
|
def search_by_spec(spec)
|
185
|
-
|
186
|
-
|
187
|
-
end
|
176
|
+
spec = @specs[spec.name]["#{spec.version}-#{spec.platform}"]
|
177
|
+
spec ? [spec] : []
|
188
178
|
end
|
189
179
|
|
190
180
|
if RUBY_VERSION < '1.9'
|
data/lib/bundler/installer.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'erb'
|
2
2
|
require 'rubygems/dependency_installer'
|
3
|
-
require 'bundler/
|
3
|
+
require 'bundler/worker'
|
4
4
|
|
5
5
|
module Bundler
|
6
6
|
class Installer < Environment
|
@@ -84,7 +84,7 @@ module Bundler
|
|
84
84
|
# that said, it's a rare situation (other than rake), and parallel
|
85
85
|
# installation is just SO MUCH FASTER. so we let people opt in.
|
86
86
|
jobs = [Bundler.settings[:jobs].to_i-1, 1].max
|
87
|
-
if jobs > 1 &&
|
87
|
+
if jobs > 1 && can_install_in_parallel?
|
88
88
|
install_in_parallel jobs, options[:standalone]
|
89
89
|
else
|
90
90
|
install_sequentially options[:standalone]
|
@@ -194,7 +194,7 @@ module Bundler
|
|
194
194
|
|
195
195
|
private
|
196
196
|
|
197
|
-
def
|
197
|
+
def can_install_in_parallel?
|
198
198
|
min_rubygems = "2.0.7"
|
199
199
|
if Bundler.current_ruby.mri? || Bundler.rubygems.provides?(">= #{min_rubygems}")
|
200
200
|
true
|
@@ -254,7 +254,7 @@ module Bundler
|
|
254
254
|
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
|
255
255
|
file.puts "path = File.expand_path('..', __FILE__)"
|
256
256
|
paths.each do |path|
|
257
|
-
file.puts %{$:.unshift
|
257
|
+
file.puts %{$:.unshift "\#{path}/#{path}"}
|
258
258
|
end
|
259
259
|
end
|
260
260
|
end
|
@@ -277,9 +277,9 @@ module Bundler
|
|
277
277
|
remains[spec.name] = true
|
278
278
|
end
|
279
279
|
|
280
|
-
worker_pool =
|
280
|
+
worker_pool = Worker.new size, lambda { |name, worker_num|
|
281
281
|
spec = name2spec[name]
|
282
|
-
message = install_gem_from_spec spec, standalone,
|
282
|
+
message = install_gem_from_spec spec, standalone, worker_num
|
283
283
|
{ :name => spec.name, :post_install => message }
|
284
284
|
}
|
285
285
|
|
@@ -52,9 +52,9 @@ module Bundler
|
|
52
52
|
private
|
53
53
|
|
54
54
|
TYPES = {
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
GIT => Bundler::Source::Git,
|
56
|
+
GEM => Bundler::Source::Rubygems,
|
57
|
+
PATH => Bundler::Source::Path,
|
58
58
|
}
|
59
59
|
|
60
60
|
def parse_source(line)
|
@@ -64,18 +64,18 @@ module Bundler
|
|
64
64
|
@opts, @type = {}, line
|
65
65
|
when SPECS
|
66
66
|
case @type
|
67
|
-
when
|
67
|
+
when PATH
|
68
68
|
@current_source = TYPES[@type].from_lock(@opts)
|
69
69
|
@sources << @current_source
|
70
|
-
when
|
70
|
+
when GIT
|
71
71
|
@current_source = TYPES[@type].from_lock(@opts)
|
72
72
|
# Strip out duplicate GIT sections
|
73
|
-
if @
|
73
|
+
if @sources.include?(@current_source)
|
74
74
|
@current_source = @sources.find { |s| s == @current_source }
|
75
75
|
else
|
76
76
|
@sources << @current_source
|
77
77
|
end
|
78
|
-
when
|
78
|
+
when GEM
|
79
79
|
Array(@opts["remote"]).each do |url|
|
80
80
|
@rubygems_aggregate.add_remote(url)
|
81
81
|
end
|
data/lib/bundler/resolver.rb
CHANGED
@@ -141,6 +141,7 @@ module Bundler
|
|
141
141
|
@index = index
|
142
142
|
@deps_for = {}
|
143
143
|
@missing_gems = Hash.new(0)
|
144
|
+
@prereleases_cache = Hash.new { |h,k| h[k] = k.prerelease? }
|
144
145
|
@source_requirements = source_requirements
|
145
146
|
@iteration_counter = 0
|
146
147
|
@started_at = Time.now
|
@@ -269,7 +270,7 @@ module Bundler
|
|
269
270
|
|
270
271
|
reqs = reqs.sort_by do |a|
|
271
272
|
[ activated[a.name] ? 0 : 1,
|
272
|
-
a.requirement
|
273
|
+
@prereleases_cache[a.requirement] ? 0 : 1,
|
273
274
|
@errors[a.name] ? 0 : 1,
|
274
275
|
activated[a.name] ? 0 : @gems_size[a] ]
|
275
276
|
end
|
data/lib/bundler/ruby_version.rb
CHANGED
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -149,6 +149,7 @@ module Gem
|
|
149
149
|
class Platform
|
150
150
|
JAVA = Gem::Platform.new('java') unless defined?(JAVA)
|
151
151
|
MSWIN = Gem::Platform.new('mswin32') unless defined?(MSWIN)
|
152
|
+
MSWIN64 = Gem::Platform.new('mswin64') unless defined?(MSWIN64)
|
152
153
|
MINGW = Gem::Platform.new('x86-mingw32') unless defined?(MINGW)
|
153
154
|
X64_MINGW = Gem::Platform.new('x64-mingw32') unless defined?(X64_MINGW)
|
154
155
|
|
@@ -306,12 +306,12 @@ module Bundler
|
|
306
306
|
|
307
307
|
if exec_name
|
308
308
|
spec = specs.find { |s| s.executables.include?(exec_name) }
|
309
|
+
spec or raise Gem::Exception, "can't find executable #{exec_name}"
|
309
310
|
unless spec.name == name
|
310
311
|
warn "Bundler is using a binstub that was created for a different gem.\n" \
|
311
312
|
"This is deprecated, in future versions you may need to `bundle binstub #{name}` " \
|
312
313
|
"to work around a system/bundle conflict."
|
313
314
|
end
|
314
|
-
spec or raise Gem::Exception, "can't find executable #{exec_name}"
|
315
315
|
else
|
316
316
|
spec = specs.find { |s| s.name == name }
|
317
317
|
exec_name = spec.default_executable or raise Gem::Exception, "no default executable for #{spec.full_name}"
|
data/lib/bundler/runtime.rb
CHANGED
@@ -46,7 +46,7 @@ module Bundler
|
|
46
46
|
self
|
47
47
|
end
|
48
48
|
|
49
|
-
|
49
|
+
REQUIRE_ERRORS = [
|
50
50
|
/^no such file to load -- (.+)$/i,
|
51
51
|
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
|
52
52
|
/^Missing API definition file in (.+)$/i,
|
@@ -76,20 +76,21 @@ module Bundler
|
|
76
76
|
Kernel.require file
|
77
77
|
end
|
78
78
|
rescue LoadError => e
|
79
|
-
|
79
|
+
REQUIRE_ERRORS.find { |r| r =~ e.message }
|
80
80
|
raise if dep.autorequire || $1 != required_file
|
81
81
|
|
82
82
|
if dep.autorequire.nil? && dep.name.include?('-')
|
83
83
|
begin
|
84
84
|
namespaced_file = dep.name.gsub('-', '/')
|
85
85
|
Kernel.require namespaced_file
|
86
|
-
rescue LoadError
|
87
|
-
|
88
|
-
|
89
|
-
raise e if dep.autorequire || (regex_name && regex_name.gsub('-', '/') != namespaced_file)
|
90
|
-
raise e if regex_name.nil?
|
86
|
+
rescue LoadError => e
|
87
|
+
REQUIRE_ERRORS.find { |r| r =~ e.message }
|
88
|
+
raise if $1 != namespaced_file
|
91
89
|
end
|
92
90
|
end
|
91
|
+
rescue => e
|
92
|
+
Bundler.ui.debug e
|
93
|
+
Bundler.ui.warn "Unable to require #{required_file}. #{e.class}: #{e.message}."
|
93
94
|
end
|
94
95
|
end
|
95
96
|
end
|
@@ -105,12 +106,13 @@ module Bundler
|
|
105
106
|
alias gems specs
|
106
107
|
|
107
108
|
def cache(custom_path = nil)
|
108
|
-
cache_path =
|
109
|
+
cache_path = Bundler.app_cache(custom_path)
|
109
110
|
FileUtils.mkdir_p(cache_path) unless File.exist?(cache_path)
|
110
111
|
|
111
|
-
Bundler.ui.info "Updating files in
|
112
|
+
Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"
|
112
113
|
specs.each do |spec|
|
113
114
|
next if spec.name == 'bundler'
|
115
|
+
spec.source.send(:fetch_gem, spec) if Bundler.settings[:cache_all_platforms] && spec.source.respond_to?(:fetch_gem, true)
|
114
116
|
spec.source.cache(spec, custom_path) if spec.source.respond_to?(:cache)
|
115
117
|
end
|
116
118
|
|
@@ -119,15 +121,14 @@ module Bundler
|
|
119
121
|
FileUtils.touch(File.expand_path("../.bundlecache", git_dir))
|
120
122
|
end
|
121
123
|
|
122
|
-
prune_cache(
|
124
|
+
prune_cache(cache_path) unless Bundler.settings[:no_prune]
|
123
125
|
end
|
124
126
|
|
125
|
-
def prune_cache(
|
126
|
-
cache_path = cache_path(custom_path)
|
127
|
+
def prune_cache(cache_path)
|
127
128
|
FileUtils.mkdir_p(cache_path) unless File.exist?(cache_path)
|
128
129
|
resolve = @definition.resolve
|
129
|
-
prune_gem_cache(resolve,
|
130
|
-
prune_git_and_path_cache(resolve,
|
130
|
+
prune_gem_cache(resolve, cache_path)
|
131
|
+
prune_git_and_path_cache(resolve, cache_path)
|
131
132
|
end
|
132
133
|
|
133
134
|
def clean(dry_run = false)
|
@@ -218,31 +219,16 @@ module Bundler
|
|
218
219
|
ENV["BUNDLE_BIN_PATH"] = File.expand_path("../../../bin/bundle", __FILE__)
|
219
220
|
end
|
220
221
|
|
221
|
-
# Set PATH
|
222
|
-
paths = (ENV["PATH"] || "").split(File::PATH_SEPARATOR)
|
223
|
-
paths.unshift "#{Bundler.bundle_path}/bin"
|
224
|
-
ENV["PATH"] = paths.uniq.join(File::PATH_SEPARATOR)
|
225
|
-
|
226
222
|
# Set BUNDLE_GEMFILE
|
227
223
|
ENV["BUNDLE_GEMFILE"] = default_gemfile.to_s
|
228
224
|
|
229
|
-
|
230
|
-
rubyopt = [ENV["RUBYOPT"]].compact
|
231
|
-
if rubyopt.empty? || rubyopt.first !~ /-rbundler\/setup/
|
232
|
-
rubyopt.unshift %|-rbundler/setup|
|
233
|
-
ENV["RUBYOPT"] = rubyopt.join(' ')
|
234
|
-
end
|
235
|
-
|
236
|
-
# Set RUBYLIB
|
237
|
-
rubylib = (ENV["RUBYLIB"] || "").split(File::PATH_SEPARATOR)
|
238
|
-
rubylib.unshift File.expand_path('../..', __FILE__)
|
239
|
-
ENV["RUBYLIB"] = rubylib.uniq.join(File::PATH_SEPARATOR)
|
225
|
+
SharedHelpers.set_bundle_environment
|
240
226
|
end
|
241
227
|
|
242
228
|
private
|
243
229
|
|
244
|
-
def prune_gem_cache(resolve,
|
245
|
-
cached = Dir["#{cache_path
|
230
|
+
def prune_gem_cache(resolve, cache_path)
|
231
|
+
cached = Dir["#{cache_path}/*.gem"]
|
246
232
|
|
247
233
|
cached = cached.delete_if do |path|
|
248
234
|
spec = Bundler.rubygems.spec_from_gem path
|
@@ -253,7 +239,7 @@ module Bundler
|
|
253
239
|
end
|
254
240
|
|
255
241
|
if cached.any?
|
256
|
-
Bundler.ui.info "Removing outdated .gem files from
|
242
|
+
Bundler.ui.info "Removing outdated .gem files from #{Bundler.settings.app_cache_path}"
|
257
243
|
|
258
244
|
cached.each do |path|
|
259
245
|
Bundler.ui.info " * #{File.basename(path)}"
|
@@ -262,8 +248,8 @@ module Bundler
|
|
262
248
|
end
|
263
249
|
end
|
264
250
|
|
265
|
-
def prune_git_and_path_cache(resolve,
|
266
|
-
cached = Dir["#{cache_path
|
251
|
+
def prune_git_and_path_cache(resolve, cache_path)
|
252
|
+
cached = Dir["#{cache_path}/*/.bundlecache"]
|
267
253
|
|
268
254
|
cached = cached.delete_if do |path|
|
269
255
|
name = File.basename(File.dirname(path))
|
@@ -275,7 +261,7 @@ module Bundler
|
|
275
261
|
end
|
276
262
|
|
277
263
|
if cached.any?
|
278
|
-
Bundler.ui.info "Removing outdated git and path gems from
|
264
|
+
Bundler.ui.info "Removing outdated git and path gems from #{Bundler.settings.app_cache_path}"
|
279
265
|
|
280
266
|
cached.each do |path|
|
281
267
|
path = File.dirname(path)
|
@@ -302,9 +288,5 @@ module Bundler
|
|
302
288
|
end
|
303
289
|
end
|
304
290
|
|
305
|
-
def cache_path(custom_path = nil)
|
306
|
-
path = custom_path || root
|
307
|
-
path.join("vendor/cache")
|
308
|
-
end
|
309
291
|
end
|
310
292
|
end
|