bundler_package_git 1.1.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +22 -0
- data/.rvmrc +1 -0
- data/CHANGELOG.md +659 -0
- data/ISSUES.md +47 -0
- data/LICENSE +23 -0
- data/README.md +29 -0
- data/Rakefile +167 -0
- data/UPGRADING.md +103 -0
- data/bin/bundle +22 -0
- data/bundler.gemspec +30 -0
- data/lib/bundler.rb +283 -0
- data/lib/bundler/capistrano.rb +11 -0
- data/lib/bundler/cli.rb +490 -0
- data/lib/bundler/definition.rb +429 -0
- data/lib/bundler/dependency.rb +130 -0
- data/lib/bundler/deployment.rb +53 -0
- data/lib/bundler/dsl.rb +243 -0
- data/lib/bundler/environment.rb +47 -0
- data/lib/bundler/fetcher.rb +101 -0
- data/lib/bundler/gem_helper.rb +146 -0
- data/lib/bundler/graph.rb +130 -0
- data/lib/bundler/index.rb +131 -0
- data/lib/bundler/installer.rb +117 -0
- data/lib/bundler/lazy_specification.rb +71 -0
- data/lib/bundler/lockfile_parser.rb +108 -0
- data/lib/bundler/remote_specification.rb +57 -0
- data/lib/bundler/resolver.rb +470 -0
- data/lib/bundler/rubygems_ext.rb +226 -0
- data/lib/bundler/runtime.rb +201 -0
- data/lib/bundler/settings.rb +117 -0
- data/lib/bundler/setup.rb +16 -0
- data/lib/bundler/shared_helpers.rb +167 -0
- data/lib/bundler/source.rb +675 -0
- data/lib/bundler/spec_set.rb +134 -0
- data/lib/bundler/templates/Executable +16 -0
- data/lib/bundler/templates/Gemfile +4 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
- data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/gitignore.tt +4 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +21 -0
- data/lib/bundler/ui.rb +73 -0
- data/lib/bundler/vendor/net/http/faster.rb +27 -0
- data/lib/bundler/vendor/net/http/persistent.rb +464 -0
- data/lib/bundler/vendor/thor.rb +319 -0
- data/lib/bundler/vendor/thor/actions.rb +297 -0
- data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
- data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
- data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
- data/lib/bundler/vendor/thor/actions/file_manipulation.rb +229 -0
- data/lib/bundler/vendor/thor/actions/inject_into_file.rb +104 -0
- data/lib/bundler/vendor/thor/base.rb +556 -0
- data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
- data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
- data/lib/bundler/vendor/thor/error.rb +30 -0
- data/lib/bundler/vendor/thor/invocation.rb +168 -0
- data/lib/bundler/vendor/thor/parser.rb +4 -0
- data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
- data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
- data/lib/bundler/vendor/thor/parser/option.rb +120 -0
- data/lib/bundler/vendor/thor/parser/options.rb +174 -0
- data/lib/bundler/vendor/thor/shell.rb +88 -0
- data/lib/bundler/vendor/thor/shell/basic.rb +275 -0
- data/lib/bundler/vendor/thor/shell/color.rb +108 -0
- data/lib/bundler/vendor/thor/shell/html.rb +121 -0
- data/lib/bundler/vendor/thor/task.rb +114 -0
- data/lib/bundler/vendor/thor/util.rb +229 -0
- data/lib/bundler/vendor/thor/version.rb +3 -0
- data/lib/bundler/version.rb +6 -0
- data/lib/bundler/vlad.rb +9 -0
- data/man/bundle-config.ronn +90 -0
- data/man/bundle-exec.ronn +111 -0
- data/man/bundle-install.ronn +314 -0
- data/man/bundle-package.ronn +59 -0
- data/man/bundle-update.ronn +176 -0
- data/man/bundle.ronn +80 -0
- data/man/gemfile.5.ronn +279 -0
- data/man/index.txt +6 -0
- data/spec/cache/gems_spec.rb +219 -0
- data/spec/cache/git_spec.rb +9 -0
- data/spec/cache/path_spec.rb +27 -0
- data/spec/cache/platform_spec.rb +57 -0
- data/spec/install/deploy_spec.rb +197 -0
- data/spec/install/deprecated_spec.rb +37 -0
- data/spec/install/gems/c_ext_spec.rb +48 -0
- data/spec/install/gems/dependency_api_spec.rb +85 -0
- data/spec/install/gems/env_spec.rb +107 -0
- data/spec/install/gems/flex_spec.rb +313 -0
- data/spec/install/gems/groups_spec.rb +245 -0
- data/spec/install/gems/packed_spec.rb +84 -0
- data/spec/install/gems/platform_spec.rb +208 -0
- data/spec/install/gems/resolving_spec.rb +72 -0
- data/spec/install/gems/simple_case_spec.rb +715 -0
- data/spec/install/gems/standalone_spec.rb +162 -0
- data/spec/install/gems/sudo_spec.rb +73 -0
- data/spec/install/gems/win32_spec.rb +26 -0
- data/spec/install/gemspec_spec.rb +108 -0
- data/spec/install/git_spec.rb +571 -0
- data/spec/install/invalid_spec.rb +17 -0
- data/spec/install/path_spec.rb +353 -0
- data/spec/install/upgrade_spec.rb +26 -0
- data/spec/lock/git_spec.rb +35 -0
- data/spec/lock/lockfile_spec.rb +683 -0
- data/spec/other/check_spec.rb +221 -0
- data/spec/other/clean_spec.rb +202 -0
- data/spec/other/config_spec.rb +40 -0
- data/spec/other/console_spec.rb +54 -0
- data/spec/other/exec_spec.rb +241 -0
- data/spec/other/ext_spec.rb +16 -0
- data/spec/other/gem_helper_spec.rb +128 -0
- data/spec/other/help_spec.rb +38 -0
- data/spec/other/init_spec.rb +40 -0
- data/spec/other/newgem_spec.rb +24 -0
- data/spec/other/open_spec.rb +35 -0
- data/spec/other/show_spec.rb +82 -0
- data/spec/pack/gems_spec.rb +54 -0
- data/spec/quality_spec.rb +58 -0
- data/spec/resolver/basic_spec.rb +20 -0
- data/spec/resolver/platform_spec.rb +82 -0
- data/spec/runtime/executable_spec.rb +110 -0
- data/spec/runtime/load_spec.rb +107 -0
- data/spec/runtime/platform_spec.rb +90 -0
- data/spec/runtime/require_spec.rb +231 -0
- data/spec/runtime/setup_spec.rb +688 -0
- data/spec/runtime/with_clean_env_spec.rb +15 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/artifice/endpoint.rb +50 -0
- data/spec/support/artifice/endpoint_fallback.rb +22 -0
- data/spec/support/artifice/endpoint_marshal_fail.rb +11 -0
- data/spec/support/artifice/endpoint_redirect.rb +11 -0
- data/spec/support/builders.rb +574 -0
- data/spec/support/fakeweb/rack-1.0.0.marshal +2 -0
- data/spec/support/fakeweb/windows.rb +23 -0
- data/spec/support/helpers.rb +246 -0
- data/spec/support/indexes.rb +112 -0
- data/spec/support/matchers.rb +89 -0
- data/spec/support/path.rb +73 -0
- data/spec/support/platforms.rb +53 -0
- data/spec/support/ruby_ext.rb +20 -0
- data/spec/support/rubygems_ext.rb +35 -0
- data/spec/support/rubygems_hax/platform.rb +11 -0
- data/spec/support/sudo.rb +21 -0
- data/spec/update/gems_spec.rb +121 -0
- data/spec/update/git_spec.rb +196 -0
- data/spec/update/source_spec.rb +51 -0
- metadata +294 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
module Spec
|
4
|
+
module Path
|
5
|
+
def root
|
6
|
+
@root ||= Pathname.new(File.expand_path("../../..", __FILE__))
|
7
|
+
end
|
8
|
+
|
9
|
+
def tmp(*path)
|
10
|
+
root.join("tmp", *path)
|
11
|
+
end
|
12
|
+
|
13
|
+
def home(*path)
|
14
|
+
tmp.join("home", *path)
|
15
|
+
end
|
16
|
+
|
17
|
+
def default_bundle_path(*path)
|
18
|
+
system_gem_path(*path)
|
19
|
+
end
|
20
|
+
|
21
|
+
def bundled_app(*path)
|
22
|
+
root = tmp.join("bundled_app")
|
23
|
+
FileUtils.mkdir_p(root)
|
24
|
+
root.join(*path)
|
25
|
+
end
|
26
|
+
|
27
|
+
alias bundled_app1 bundled_app
|
28
|
+
|
29
|
+
def bundled_app2(*path)
|
30
|
+
root = tmp.join("bundled_app2")
|
31
|
+
FileUtils.mkdir_p(root)
|
32
|
+
root.join(*path)
|
33
|
+
end
|
34
|
+
|
35
|
+
def vendored_gems(path = nil)
|
36
|
+
bundled_app("vendor/bundle/#{Gem.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}/#{path}")
|
37
|
+
end
|
38
|
+
|
39
|
+
def cached_gem(path)
|
40
|
+
bundled_app("vendor/cache/#{path}.gem")
|
41
|
+
end
|
42
|
+
|
43
|
+
def base_system_gems
|
44
|
+
tmp.join("gems/base")
|
45
|
+
end
|
46
|
+
|
47
|
+
def gem_repo1(*args)
|
48
|
+
tmp("gems/remote1", *args)
|
49
|
+
end
|
50
|
+
|
51
|
+
def gem_repo2(*args)
|
52
|
+
tmp("gems/remote2", *args)
|
53
|
+
end
|
54
|
+
|
55
|
+
def gem_repo3(*args)
|
56
|
+
tmp("gems/remote3", *args)
|
57
|
+
end
|
58
|
+
|
59
|
+
def system_gem_path(*path)
|
60
|
+
tmp("gems/system", *path)
|
61
|
+
end
|
62
|
+
|
63
|
+
def lib_path(*args)
|
64
|
+
tmp("libs", *args)
|
65
|
+
end
|
66
|
+
|
67
|
+
def bundler_path
|
68
|
+
Pathname.new(File.expand_path('../../../lib', __FILE__))
|
69
|
+
end
|
70
|
+
|
71
|
+
extend self
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Spec
|
2
|
+
module Platforms
|
3
|
+
include Bundler::GemHelpers
|
4
|
+
|
5
|
+
def rb
|
6
|
+
Gem::Platform::RUBY
|
7
|
+
end
|
8
|
+
|
9
|
+
def mac
|
10
|
+
Gem::Platform.new('x86-darwin-10')
|
11
|
+
end
|
12
|
+
|
13
|
+
def java
|
14
|
+
Gem::Platform.new([nil, "java", nil])
|
15
|
+
end
|
16
|
+
|
17
|
+
def linux
|
18
|
+
Gem::Platform.new(['x86', 'linux', nil])
|
19
|
+
end
|
20
|
+
|
21
|
+
def mswin
|
22
|
+
Gem::Platform.new(['x86', 'mswin32', nil])
|
23
|
+
end
|
24
|
+
|
25
|
+
def mingw
|
26
|
+
Gem::Platform.new(['x86', 'mingw32', nil])
|
27
|
+
end
|
28
|
+
|
29
|
+
def all_platforms
|
30
|
+
[rb, java, linux, mswin, mingw]
|
31
|
+
end
|
32
|
+
|
33
|
+
def local
|
34
|
+
generic(Gem::Platform.local)
|
35
|
+
end
|
36
|
+
|
37
|
+
def not_local
|
38
|
+
all_platforms.find { |p| p != generic(Gem::Platform.local) }
|
39
|
+
end
|
40
|
+
|
41
|
+
def local_tag
|
42
|
+
if RUBY_PLATFORM == "java"
|
43
|
+
:jruby
|
44
|
+
else
|
45
|
+
:ruby
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def not_local_tag
|
50
|
+
[:ruby, :jruby].find { |tag| tag != local_tag }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class IO
|
2
|
+
def read_available_bytes(chunk_size = 16384, select_timeout = 0.02)
|
3
|
+
buffer = []
|
4
|
+
|
5
|
+
return "" if closed? || eof?
|
6
|
+
# IO.select cannot be used here due to the fact that it
|
7
|
+
# just does not work on windows
|
8
|
+
while true
|
9
|
+
begin
|
10
|
+
IO.select([self], nil, nil, select_timeout)
|
11
|
+
break if eof? # stop raising :-(
|
12
|
+
buffer << self.readpartial(chunk_size)
|
13
|
+
rescue(EOFError)
|
14
|
+
break
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
return buffer.join
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'rubygems/user_interaction'
|
2
|
+
|
3
|
+
module Spec
|
4
|
+
module Rubygems
|
5
|
+
def self.setup
|
6
|
+
Gem.clear_paths
|
7
|
+
|
8
|
+
ENV['BUNDLE_PATH'] = nil
|
9
|
+
ENV['GEM_HOME'] = ENV['GEM_PATH'] = Path.base_system_gems.to_s
|
10
|
+
ENV['PATH'] = ["#{Path.root}/bin", "#{Path.system_gem_path}/bin", ENV['PATH']].join(File::PATH_SEPARATOR)
|
11
|
+
|
12
|
+
unless File.exist?("#{Path.base_system_gems}")
|
13
|
+
FileUtils.mkdir_p(Path.base_system_gems)
|
14
|
+
puts "running `gem install rake fakeweb artifice sinatra --no-rdoc --no-ri`"
|
15
|
+
`gem install rake fakeweb artifice sinatra --no-rdoc --no-ri`
|
16
|
+
# 3.0.0 breaks 1.9.2 specs
|
17
|
+
puts "running `gem install builder --version 2.1.2 --no-rdoc --no-ri`"
|
18
|
+
`gem install builder --version 2.1.2 --no-rdoc --no-ri`
|
19
|
+
end
|
20
|
+
|
21
|
+
ENV['HOME'] = Path.home.to_s
|
22
|
+
|
23
|
+
Gem::DefaultUserInteraction.ui = Gem::SilentUI.new
|
24
|
+
end
|
25
|
+
|
26
|
+
def gem_command(command, args = "", options = {})
|
27
|
+
if command == :exec && !options[:no_quote]
|
28
|
+
args = args.gsub(/(?=")/, "\\")
|
29
|
+
args = %["#{args}"]
|
30
|
+
end
|
31
|
+
lib = File.join(File.dirname(__FILE__), '..', '..', 'lib')
|
32
|
+
%x{#{Gem.ruby} -I#{lib} -rubygems -S gem --backtrace #{command} #{args}}.strip
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Spec
|
2
|
+
module Sudo
|
3
|
+
def self.present?
|
4
|
+
@which_sudo ||= (`which sudo`.chomp rescue '')
|
5
|
+
!@which_sudo.empty?
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.test_sudo?
|
9
|
+
present? && ENV['BUNDLER_SUDO_TESTS']
|
10
|
+
end
|
11
|
+
|
12
|
+
def sudo(cmd)
|
13
|
+
raise "sudo not present" unless Sudo.present?
|
14
|
+
sys_exec("sudo #{cmd}")
|
15
|
+
end
|
16
|
+
|
17
|
+
def chown_system_gems_to_root
|
18
|
+
sudo "chown -R root #{system_gem_path}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle update" do
|
4
|
+
before :each do
|
5
|
+
build_repo2
|
6
|
+
|
7
|
+
install_gemfile <<-G
|
8
|
+
source "file://#{gem_repo2}"
|
9
|
+
gem "activesupport"
|
10
|
+
gem "rack-obama"
|
11
|
+
G
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "with no arguments" do
|
15
|
+
it "updates the entire bundle" do
|
16
|
+
update_repo2 do
|
17
|
+
build_gem "activesupport", "3.0"
|
18
|
+
end
|
19
|
+
|
20
|
+
bundle "update"
|
21
|
+
should_be_installed "rack 1.2", "rack-obama 1.0", "activesupport 3.0"
|
22
|
+
end
|
23
|
+
|
24
|
+
it "doesn't delete the Gemfile.lock file if something goes wrong" do
|
25
|
+
gemfile <<-G
|
26
|
+
source "file://#{gem_repo2}"
|
27
|
+
gem "activesupport"
|
28
|
+
gem "rack-obama"
|
29
|
+
exit!
|
30
|
+
G
|
31
|
+
bundle "update"
|
32
|
+
bundled_app("Gemfile.lock").should exist
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "with a top level dependency" do
|
37
|
+
it "unlocks all child dependencies that are unrelated to other locked dependencies" do
|
38
|
+
update_repo2 do
|
39
|
+
build_gem "activesupport", "3.0"
|
40
|
+
end
|
41
|
+
|
42
|
+
bundle "update rack-obama"
|
43
|
+
should_be_installed "rack 1.2", "rack-obama 1.0", "activesupport 2.3.5"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "with --local option" do
|
48
|
+
it "doesn't hit repo2" do
|
49
|
+
FileUtils.rm_rf(gem_repo2)
|
50
|
+
|
51
|
+
bundle "update --local"
|
52
|
+
out.should_not match(/Fetching source index/)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe "bundle update in more complicated situations" do
|
58
|
+
before :each do
|
59
|
+
build_repo2
|
60
|
+
end
|
61
|
+
|
62
|
+
it "will eagerly unlock dependencies of a specified gem" do
|
63
|
+
install_gemfile <<-G
|
64
|
+
source "file://#{gem_repo2}"
|
65
|
+
|
66
|
+
gem "thin"
|
67
|
+
gem "rack-obama"
|
68
|
+
G
|
69
|
+
|
70
|
+
update_repo2 do
|
71
|
+
build_gem "thin" , '2.0' do |s|
|
72
|
+
s.add_dependency "rack"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
bundle "update thin"
|
77
|
+
should_be_installed "thin 2.0", "rack 1.2", "rack-obama 1.0"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe "bundle update without a Gemfile.lock" do
|
82
|
+
it "should not explode" do
|
83
|
+
build_repo2
|
84
|
+
|
85
|
+
gemfile <<-G
|
86
|
+
source "file://#{gem_repo2}"
|
87
|
+
|
88
|
+
gem "rack", "1.0"
|
89
|
+
G
|
90
|
+
|
91
|
+
bundle "update"
|
92
|
+
|
93
|
+
should_be_installed "rack 1.0.0"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
describe "bundle update when a gem depends on a newer version of bundler" do
|
98
|
+
before(:each) do
|
99
|
+
build_repo2 do
|
100
|
+
build_gem "rails", "3.0.1" do |s|
|
101
|
+
s.add_dependency "bundler", Bundler::VERSION.succ
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
gemfile <<-G
|
106
|
+
source "file://#{gem_repo2}"
|
107
|
+
gem "rails", "3.0.1"
|
108
|
+
G
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should not explode" do
|
112
|
+
bundle "update"
|
113
|
+
err.should be_empty
|
114
|
+
end
|
115
|
+
|
116
|
+
it "should explain that bundler conflicted" do
|
117
|
+
bundle "update"
|
118
|
+
out.should_not =~ /In snapshot/
|
119
|
+
out.should =~ /Current Bundler version/
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1,196 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle update" do
|
4
|
+
describe "git sources" do
|
5
|
+
it "floats on a branch when :branch is used" do
|
6
|
+
build_git "foo", "1.0"
|
7
|
+
update_git "foo", :branch => "omg"
|
8
|
+
|
9
|
+
install_gemfile <<-G
|
10
|
+
git "#{lib_path('foo-1.0')}", :branch => "omg" do
|
11
|
+
gem 'foo'
|
12
|
+
end
|
13
|
+
G
|
14
|
+
|
15
|
+
update_git "foo", :branch => "omg" do |s|
|
16
|
+
s.write "lib/foo.rb", "FOO = '1.1'"
|
17
|
+
end
|
18
|
+
|
19
|
+
bundle "update"
|
20
|
+
|
21
|
+
should_be_installed "foo 1.1"
|
22
|
+
end
|
23
|
+
|
24
|
+
it "updates correctly when you have like craziness" do
|
25
|
+
build_lib "activesupport", "3.0", :path => lib_path("rails/activesupport")
|
26
|
+
build_git "rails", "3.0", :path => lib_path("rails") do |s|
|
27
|
+
s.add_dependency "activesupport", "= 3.0"
|
28
|
+
end
|
29
|
+
|
30
|
+
install_gemfile <<-G
|
31
|
+
gem "rails", :git => "#{lib_path('rails')}"
|
32
|
+
G
|
33
|
+
|
34
|
+
bundle "update rails"
|
35
|
+
out.should include("Using activesupport (3.0) from #{lib_path('rails')} (at master)")
|
36
|
+
should_be_installed "rails 3.0", "activesupport 3.0"
|
37
|
+
end
|
38
|
+
|
39
|
+
it "floats on a branch when :branch is used and the source is specified in the update" do
|
40
|
+
build_git "foo", "1.0", :path => lib_path("foo")
|
41
|
+
update_git "foo", :branch => "omg", :path => lib_path("foo")
|
42
|
+
|
43
|
+
install_gemfile <<-G
|
44
|
+
git "#{lib_path('foo')}", :branch => "omg" do
|
45
|
+
gem 'foo'
|
46
|
+
end
|
47
|
+
G
|
48
|
+
|
49
|
+
update_git "foo", :branch => "omg", :path => lib_path("foo") do |s|
|
50
|
+
s.write "lib/foo.rb", "FOO = '1.1'"
|
51
|
+
end
|
52
|
+
|
53
|
+
bundle "update --source foo"
|
54
|
+
|
55
|
+
should_be_installed "foo 1.1"
|
56
|
+
end
|
57
|
+
|
58
|
+
it "floats on master when updating all gems that are pinned to the source even if you have child dependencies" do
|
59
|
+
build_git "foo", :path => lib_path('foo')
|
60
|
+
build_gem "bar", :to_system => true do |s|
|
61
|
+
s.add_dependency "foo"
|
62
|
+
end
|
63
|
+
|
64
|
+
install_gemfile <<-G
|
65
|
+
gem "foo", :git => "#{lib_path('foo')}"
|
66
|
+
gem "bar"
|
67
|
+
G
|
68
|
+
|
69
|
+
update_git "foo", :path => lib_path('foo') do |s|
|
70
|
+
s.write "lib/foo.rb", "FOO = '1.1'"
|
71
|
+
end
|
72
|
+
|
73
|
+
bundle "update foo"
|
74
|
+
|
75
|
+
should_be_installed "foo 1.1"
|
76
|
+
end
|
77
|
+
|
78
|
+
it "notices when you change the repo url in the Gemfile" do
|
79
|
+
build_git "foo", :path => lib_path("foo_one")
|
80
|
+
build_git "foo", :path => lib_path("foo_two")
|
81
|
+
|
82
|
+
install_gemfile <<-G
|
83
|
+
gem "foo", "1.0", :git => "#{lib_path('foo_one')}"
|
84
|
+
G
|
85
|
+
|
86
|
+
FileUtils.rm_rf lib_path("foo_one")
|
87
|
+
|
88
|
+
install_gemfile <<-G
|
89
|
+
gem "foo", "1.0", :git => "#{lib_path('foo_two')}"
|
90
|
+
G
|
91
|
+
|
92
|
+
err.should be_empty
|
93
|
+
out.should include("Fetching #{lib_path}/foo_two")
|
94
|
+
out.should include("Your bundle is complete!")
|
95
|
+
end
|
96
|
+
|
97
|
+
|
98
|
+
it "fetches tags from the remote" do
|
99
|
+
build_git "foo"
|
100
|
+
@remote = build_git("bar", :bare => true)
|
101
|
+
update_git "foo", :remote => @remote.path
|
102
|
+
update_git "foo", :push => "master"
|
103
|
+
|
104
|
+
install_gemfile <<-G
|
105
|
+
gem 'foo', :git => "#{@remote.path}"
|
106
|
+
G
|
107
|
+
|
108
|
+
# Create a new tag on the remote that needs fetching
|
109
|
+
update_git "foo", :tag => "fubar"
|
110
|
+
update_git "foo", :push => "fubar"
|
111
|
+
|
112
|
+
gemfile <<-G
|
113
|
+
gem 'foo', :git => "#{@remote.path}", :tag => "fubar"
|
114
|
+
G
|
115
|
+
|
116
|
+
bundle "update", :exitstatus => true
|
117
|
+
exitstatus.should == 0
|
118
|
+
end
|
119
|
+
|
120
|
+
describe "with submodules" do
|
121
|
+
before :each do
|
122
|
+
build_gem "submodule", :to_system => true do |s|
|
123
|
+
s.write "lib/submodule.rb", "puts 'GEM'"
|
124
|
+
end
|
125
|
+
|
126
|
+
build_git "submodule", "1.0" do |s|
|
127
|
+
s.write "lib/submodule.rb", "puts 'GIT'"
|
128
|
+
end
|
129
|
+
|
130
|
+
build_git "has_submodule", "1.0" do |s|
|
131
|
+
s.add_dependency "submodule"
|
132
|
+
end
|
133
|
+
|
134
|
+
Dir.chdir(lib_path('has_submodule-1.0')) do
|
135
|
+
`git submodule add #{lib_path('submodule-1.0')} submodule-1.0`
|
136
|
+
`git commit -m "submodulator"`
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
it "it unlocks the source when submodules is added to a git source" do
|
141
|
+
install_gemfile <<-G
|
142
|
+
git "#{lib_path('has_submodule-1.0')}" do
|
143
|
+
gem "has_submodule"
|
144
|
+
end
|
145
|
+
G
|
146
|
+
|
147
|
+
run "require 'submodule'"
|
148
|
+
check out.should == 'GEM'
|
149
|
+
|
150
|
+
install_gemfile <<-G
|
151
|
+
git "#{lib_path('has_submodule-1.0')}", :submodules => true do
|
152
|
+
gem "has_submodule"
|
153
|
+
end
|
154
|
+
G
|
155
|
+
|
156
|
+
run "require 'submodule'"
|
157
|
+
out.should == 'GIT'
|
158
|
+
end
|
159
|
+
|
160
|
+
it "it unlocks the source when submodules is removed from git source" do
|
161
|
+
pending "This would require actually removing the submodule from the clone"
|
162
|
+
install_gemfile <<-G
|
163
|
+
git "#{lib_path('has_submodule-1.0')}", :submodules => true do
|
164
|
+
gem "has_submodule"
|
165
|
+
end
|
166
|
+
G
|
167
|
+
|
168
|
+
run "require 'submodule'"
|
169
|
+
check out.should == 'GIT'
|
170
|
+
|
171
|
+
install_gemfile <<-G
|
172
|
+
git "#{lib_path('has_submodule-1.0')}" do
|
173
|
+
gem "has_submodule"
|
174
|
+
end
|
175
|
+
G
|
176
|
+
|
177
|
+
run "require 'submodule'"
|
178
|
+
out.should == 'GEM'
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
it "errors with a message when the .git repo is gone" do
|
183
|
+
build_git "foo", "1.0"
|
184
|
+
|
185
|
+
install_gemfile <<-G
|
186
|
+
gem "foo", :git => "#{lib_path('foo-1.0')}"
|
187
|
+
G
|
188
|
+
|
189
|
+
lib_path("foo-1.0").join(".git").rmtree
|
190
|
+
|
191
|
+
bundle :update, :expect_err => true
|
192
|
+
out.should include(lib_path("foo-1.0").to_s)
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
196
|
+
end
|