ext 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +4 -0
- data/Rakefile +3 -1
- data/lib/externals/configuration/configuration.rb +3 -3
- data/lib/externals/ext.rb +19 -13
- data/lib/externals/extensions/file_utils.rb +7 -7
- data/lib/externals/extensions/symbol.rb +2 -2
- data/lib/externals/project.rb +10 -9
- data/lib/externals/project_types/rails.rb +3 -3
- data/lib/externals/scms/git_project.rb +5 -7
- data/lib/externals/scms/svn_project.rb +5 -5
- data/test/test_checkout_git.rb +4 -4
- data/test/test_checkout_with_subprojects_git.rb +11 -11
- data/test/test_checkout_with_subprojects_svn.rb +22 -22
- data/test/test_freeze_to_revision.rb +10 -10
- data/test/test_init_git.rb +31 -9
- data/test/test_out_of_date_git_subproject.rb +7 -7
- data/test/test_projects.rb +3 -3
- data/test/test_svn_branches.rb +30 -30
- data/test/test_touch_emptydirs.rb +8 -8
- metadata +38 -55
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b99aa9d7a8d8bbc0d7bf8f46bfa26eca19156b15de602e5b3eeb0a47ce821f6d
|
4
|
+
data.tar.gz: 62d788f0fb5cb8c09cac2ccc422524325b7c50d945bc616ca940d13184869692
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f1053255a27570040872fae424909a59b9b1164be59a1e8261ae1e01c5cbbf77f524fb3a9680d787775a4e4142288e70ea81e160b25a2372312e56bfb3fb7a3a
|
7
|
+
data.tar.gz: b580423a99dd943a25eb17cf1b6b90a71162adad8531c3ebbd8a73123963e85e4903a232e150637045f3340c0215fa8800281fb9825e4201f3facf7d88be00b1
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
February 10, 2019 Version 1.1.3 released
|
2
|
+
- Includes a --type bug fix
|
3
|
+
- Removes several deprecation warnings
|
4
|
+
|
1
5
|
January 13, 2012 Version 1.1.2 released
|
2
6
|
- Fixes export problem with newer versions of git.
|
3
7
|
- Fixes build on Windows, along with a bug that can prevent svn branches from
|
data/Rakefile
CHANGED
@@ -65,6 +65,8 @@ the main project.}
|
|
65
65
|
specification.executables = ['ext']
|
66
66
|
specification.default_executable = "ext"
|
67
67
|
|
68
|
+
specification.licenses = ['MIT']
|
69
|
+
|
68
70
|
specification.files = ['Rakefile', 'README', 'MIT_LICENSE.txt', 'CHANGELOG'] +
|
69
71
|
FileList['lib/**/*.rb']
|
70
72
|
#specification.require_path = 'lib'
|
@@ -72,4 +74,4 @@ end
|
|
72
74
|
|
73
75
|
Gem::PackageTask.new(gem_specification) do |package|
|
74
76
|
package.need_zip = package.need_tar = false
|
75
|
-
end
|
77
|
+
end
|
@@ -19,8 +19,8 @@ module Externals
|
|
19
19
|
end
|
20
20
|
|
21
21
|
|
22
|
-
SETTING_REGEX = /^\s*([\.\
|
23
|
-
SET_SETTING_REGEX = /^(\s*(?:[\.\
|
22
|
+
SETTING_REGEX = /^\s*([\.\w-]+)\s*=\s*([^#\n]*)(?:#[^\n]*)?$/
|
23
|
+
SET_SETTING_REGEX = /^(\s*(?:[\.\w-]+)\s*=\s*)(?:[^#\n]*)(#[^\n]*)?$/
|
24
24
|
|
25
25
|
def attributes
|
26
26
|
retval = {}
|
@@ -181,4 +181,4 @@ module Externals
|
|
181
181
|
end
|
182
182
|
end
|
183
183
|
end
|
184
|
-
end
|
184
|
+
end
|
data/lib/externals/ext.rb
CHANGED
@@ -9,7 +9,7 @@ Dir.entries(File.join(File.dirname(__FILE__), 'extensions')).each do |extension|
|
|
9
9
|
end
|
10
10
|
|
11
11
|
module Externals
|
12
|
-
VERSION = '1.1.
|
12
|
+
VERSION = '1.1.3'
|
13
13
|
PROJECT_TYPES_DIRECTORY = File.join(File.dirname(__FILE__), '..', 'externals','project_types')
|
14
14
|
|
15
15
|
# Full commands operate on the main project as well as the externals
|
@@ -140,7 +140,7 @@ module Externals
|
|
140
140
|
String,
|
141
141
|
*"The type of project the main project is.
|
142
142
|
For example, 'rails'.".lines_by_width(summary_width)
|
143
|
-
) {|type| sub_options[:
|
143
|
+
) {|type| sub_options[:type] = main_options[:type] = type}
|
144
144
|
opts.on("--scm SCM", "-s SCM",
|
145
145
|
String,
|
146
146
|
*"The SCM used to manage the main project. For example, '--scm svn'.".lines_by_width(summary_width)
|
@@ -163,7 +163,7 @@ module Externals
|
|
163
163
|
opts.on("--workdir DIR", "-w DIR", String, *"The working directory to execute commands from. Use this if for some reason you
|
164
164
|
cannot execute ext from the main project's directory (or if it's just inconvenient, such as in a script
|
165
165
|
or in a Capistrano task)".lines_by_width(summary_width)) {|dir|
|
166
|
-
raise "No such directory: #{dir}" unless File.
|
166
|
+
raise "No such directory: #{dir}" unless File.exist?(dir) && File.directory?(dir)
|
167
167
|
main_options[:workdir] = dir
|
168
168
|
}
|
169
169
|
opts.on(
|
@@ -237,6 +237,7 @@ module Externals
|
|
237
237
|
print_commands(SHORT_COMMANDS_HASH)
|
238
238
|
end
|
239
239
|
|
240
|
+
@registered_scms = nil
|
240
241
|
def self.registered_scms
|
241
242
|
return @registered_scms if @registered_scms
|
242
243
|
@registered_scms ||= []
|
@@ -293,7 +294,7 @@ module Externals
|
|
293
294
|
return @configuration if @configuration
|
294
295
|
|
295
296
|
file_string = ''
|
296
|
-
if File.
|
297
|
+
if File.exist?('.externals')
|
297
298
|
open('.externals', 'r') do |f|
|
298
299
|
file_string = f.read
|
299
300
|
end
|
@@ -310,6 +311,9 @@ module Externals
|
|
310
311
|
def initialize options = {}
|
311
312
|
super()
|
312
313
|
|
314
|
+
@configuration = nil
|
315
|
+
@projects = nil
|
316
|
+
|
313
317
|
scm = configuration['.']
|
314
318
|
scm = scm['scm'] if scm
|
315
319
|
scm ||= options[:scm]
|
@@ -360,8 +364,8 @@ Please use
|
|
360
364
|
end
|
361
365
|
|
362
366
|
if project_name_or_path
|
363
|
-
project = subprojects.detect do |
|
364
|
-
|
367
|
+
project = subprojects.detect do |p|
|
368
|
+
p.name == project_name_or_path || p.path == project_name_or_path
|
365
369
|
end
|
366
370
|
|
367
371
|
raise "no such project" unless project
|
@@ -417,7 +421,7 @@ Please use
|
|
417
421
|
end
|
418
422
|
|
419
423
|
def install args, options
|
420
|
-
if !File.
|
424
|
+
if !File.exist?('.externals')
|
421
425
|
STDERR.puts "This project does not appear to be managed by externals. Try 'ext init' first"
|
422
426
|
exit NO_EXTERNALS_FILE
|
423
427
|
end
|
@@ -461,7 +465,9 @@ that you are installing. Use an option to specify it
|
|
461
465
|
end
|
462
466
|
|
463
467
|
def uninstall args, options
|
464
|
-
|
468
|
+
unless File.exist?('.externals')
|
469
|
+
raise "Hmm... there's no .externals file in this directory."
|
470
|
+
end
|
465
471
|
|
466
472
|
project = subproject_by_name_or_path(args[0])
|
467
473
|
|
@@ -618,14 +624,14 @@ by creating the .externals file manually"
|
|
618
624
|
|
619
625
|
removed_project_paths = old_config.removed_project_paths(
|
620
626
|
configuration
|
621
|
-
).select{|path| File.
|
627
|
+
).select{|path| File.exist?(path)}
|
622
628
|
|
623
629
|
if !removed_project_paths.empty?
|
624
630
|
puts "WARNING: The following subprojects are no longer being maintained in the
|
625
631
|
.externals file. You might want to remove them. You can copy and paste the
|
626
632
|
commands below if you actually wish to delete them."
|
627
633
|
removed_project_paths.each do |path|
|
628
|
-
if File.
|
634
|
+
if File.exist?(path)
|
629
635
|
puts " rm -r #{path}"
|
630
636
|
end
|
631
637
|
end
|
@@ -689,7 +695,7 @@ commands below if you actually wish to delete them."
|
|
689
695
|
end
|
690
696
|
|
691
697
|
def init args, options = {}
|
692
|
-
raise ".externals already exists" if File.
|
698
|
+
raise ".externals already exists" if File.exist?('.externals')
|
693
699
|
|
694
700
|
scm = options[:scm]
|
695
701
|
type = options[:type]
|
@@ -726,7 +732,7 @@ Please use the --type option to tell ext which to use."
|
|
726
732
|
end
|
727
733
|
|
728
734
|
config = Configuration::Configuration.new_empty
|
729
|
-
raise ".externals already exists" if File.
|
735
|
+
raise ".externals already exists" if File.exist?('.externals')
|
730
736
|
|
731
737
|
config.add_empty_section '.'
|
732
738
|
|
@@ -763,7 +769,7 @@ Please use the --type option to tell ext which to use."
|
|
763
769
|
|
764
770
|
protected
|
765
771
|
def do_checkout_or_export repository, path, options, sym
|
766
|
-
if File.
|
772
|
+
if File.exist?('.externals')
|
767
773
|
raise "seems main project is already checked out here?"
|
768
774
|
else
|
769
775
|
#We appear to be attempting to checkout/export a main project
|
@@ -8,17 +8,17 @@ FileUtils.class_eval do
|
|
8
8
|
|
9
9
|
# calls rm_rf if the file exists
|
10
10
|
def rm_rf_ie file, options = {}
|
11
|
-
rm_rf file, options if File.
|
11
|
+
rm_rf file, options if File.exist?(file)
|
12
12
|
end
|
13
13
|
|
14
14
|
# calls rmdir if the file exists and is empty
|
15
15
|
def rmdir_if_empty_ie path
|
16
|
-
rmdir path if File.
|
16
|
+
rmdir path if File.exist?(path) && dir_empty?(path)
|
17
17
|
end
|
18
18
|
|
19
19
|
# calls rmdir if the file exists
|
20
20
|
def rmdir_ie path
|
21
|
-
rmdir path if File.
|
21
|
+
rmdir path if File.exist?(path)
|
22
22
|
end
|
23
23
|
|
24
24
|
alias rm_rf_old rm_rf
|
@@ -27,9 +27,9 @@ FileUtils.class_eval do
|
|
27
27
|
tries = 0
|
28
28
|
|
29
29
|
rm = proc do
|
30
|
-
rm_rf_old
|
30
|
+
rm_rf_old(*args)
|
31
31
|
|
32
|
-
while File.
|
32
|
+
while File.exist?(args[0]) && tries < 10
|
33
33
|
# :nocov:
|
34
34
|
sleep 1
|
35
35
|
tries += 1
|
@@ -53,7 +53,7 @@ FileUtils.class_eval do
|
|
53
53
|
|
54
54
|
def dir_empty? path
|
55
55
|
File.directory?(path) &&
|
56
|
-
File.
|
56
|
+
File.exist?(path) &&
|
57
57
|
!Dir.entries(path).detect{|entry| !["..","."].include?(entry)}
|
58
58
|
end
|
59
|
-
end
|
59
|
+
end
|
data/lib/externals/project.rb
CHANGED
@@ -16,12 +16,13 @@ module Externals
|
|
16
16
|
def self.attr_attr_accessor *names
|
17
17
|
names = [names].flatten
|
18
18
|
names.each do |name|
|
19
|
-
define_method name do
|
20
|
-
attributes[name.to_sym]
|
21
|
-
end
|
22
19
|
define_method "#{name}=" do |value|
|
23
20
|
attributes[name.to_sym] = value
|
24
21
|
end
|
22
|
+
next if name == "name" || name == "scm"
|
23
|
+
define_method name do
|
24
|
+
attributes[name.to_sym]
|
25
|
+
end
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
@@ -112,7 +113,7 @@ module Externals
|
|
112
113
|
end
|
113
114
|
|
114
115
|
def extract_name repository
|
115
|
-
if repository =~ /\/([\
|
116
|
+
if repository =~ /\/([\w-]+)(?:\.git)?$/
|
116
117
|
$1
|
117
118
|
end
|
118
119
|
end
|
@@ -128,11 +129,11 @@ module Externals
|
|
128
129
|
end
|
129
130
|
|
130
131
|
exists.each do |proj|
|
131
|
-
assert.call File.
|
132
|
+
assert.call File.exist?(File.join('vendor', 'plugins', proj, 'lib'))
|
132
133
|
end
|
133
134
|
|
134
135
|
doesnt.each do |proj|
|
135
|
-
assert.call !File.
|
136
|
+
assert.call !File.exist?(File.join('vendor', 'plugins', proj, 'lib'))
|
136
137
|
end
|
137
138
|
end
|
138
139
|
|
@@ -153,7 +154,7 @@ module Externals
|
|
153
154
|
|
154
155
|
# create the suffixed versions
|
155
156
|
OPTS_SUFFIXES.map do |suffix|
|
156
|
-
|
157
|
+
"scm_opts_#{suffix}"
|
157
158
|
end.each do |name|
|
158
159
|
define_method name do
|
159
160
|
values = [
|
@@ -206,7 +207,7 @@ module Externals
|
|
206
207
|
|
207
208
|
#now we create the suffixed version of the global settings.
|
208
209
|
OPTS_SUFFIXES.map do |suffix|
|
209
|
-
|
210
|
+
"#{scm_name}_opts_#{suffix}"
|
210
211
|
end.each do |name|
|
211
212
|
#defer to the parent project for these global settings
|
212
213
|
Project.__send__(:define_method, name) do
|
@@ -247,4 +248,4 @@ module Externals
|
|
247
248
|
send("scm_opts#{command}")
|
248
249
|
end
|
249
250
|
end
|
250
|
-
end
|
251
|
+
end
|
@@ -18,13 +18,13 @@ module Externals
|
|
18
18
|
class RailsDetector
|
19
19
|
def self.detected?
|
20
20
|
application_path = File.join('config', 'application.rb')
|
21
|
-
if File.
|
21
|
+
if File.exist?(application_path)
|
22
22
|
open(application_path) do |f|
|
23
23
|
f.read =~ /<\s*Rails::Application/
|
24
24
|
end
|
25
25
|
else
|
26
26
|
boot_path = File.join('config', 'boot.rb')
|
27
|
-
if File.
|
27
|
+
if File.exist?(boot_path)
|
28
28
|
open(boot_path) do |f|
|
29
29
|
f.read =~ /^\s*module\s+Rails/
|
30
30
|
end
|
@@ -32,4 +32,4 @@ module Externals
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
|
-
end
|
35
|
+
end
|
@@ -139,7 +139,7 @@ module Externals
|
|
139
139
|
if revision
|
140
140
|
# No clean reliable way to clone something that's not a branch or tag.
|
141
141
|
# just call up instead.
|
142
|
-
up
|
142
|
+
up(*args)
|
143
143
|
else
|
144
144
|
clone_opts = "--depth 1"
|
145
145
|
if branch
|
@@ -161,8 +161,6 @@ module Externals
|
|
161
161
|
end
|
162
162
|
|
163
163
|
def do_up command
|
164
|
-
opts = resolve_opts(command)
|
165
|
-
|
166
164
|
project_path = if path == "."
|
167
165
|
name || "." # if no name is specified then we are expected to already be in the right path.
|
168
166
|
# this is a little confusing and should be cleaned up.
|
@@ -176,7 +174,7 @@ module Externals
|
|
176
174
|
|
177
175
|
puts "Updating #{path}..."
|
178
176
|
|
179
|
-
if !File.
|
177
|
+
if !File.exist?(project_path)
|
180
178
|
do_clone command
|
181
179
|
end
|
182
180
|
change_to_branch_revision command
|
@@ -203,7 +201,7 @@ module Externals
|
|
203
201
|
end
|
204
202
|
|
205
203
|
def self.detected?
|
206
|
-
File.
|
204
|
+
File.exist?(".git")
|
207
205
|
end
|
208
206
|
|
209
207
|
#this is a test helper method
|
@@ -218,7 +216,7 @@ module Externals
|
|
218
216
|
end
|
219
217
|
|
220
218
|
def ignore_text(path = nil)
|
221
|
-
return '' unless File.
|
219
|
+
return '' unless File.exist?('.gitignore')
|
222
220
|
retval = ''
|
223
221
|
open('.gitignore') do |f|
|
224
222
|
retval = f.read
|
@@ -288,4 +286,4 @@ module Externals
|
|
288
286
|
end
|
289
287
|
|
290
288
|
end
|
291
|
-
end
|
289
|
+
end
|
@@ -15,7 +15,7 @@ module Externals
|
|
15
15
|
dest = '' if dest == '.'
|
16
16
|
dest = "\"#{dest}\"" if dest && !dest.empty?
|
17
17
|
|
18
|
-
if File.
|
18
|
+
if File.exist?(dest)
|
19
19
|
up
|
20
20
|
else
|
21
21
|
opts = resolve_opts "co"
|
@@ -89,7 +89,7 @@ module Externals
|
|
89
89
|
# delete path if empty
|
90
90
|
rmdir_if_empty_ie path
|
91
91
|
|
92
|
-
if File.
|
92
|
+
if File.exist?(path)
|
93
93
|
puts "updating #{path}:"
|
94
94
|
|
95
95
|
if branch
|
@@ -119,12 +119,12 @@ module Externals
|
|
119
119
|
return true if path =~ /^svn(\+ssh)?:/
|
120
120
|
|
121
121
|
# Look for http(s)://svn.*/*
|
122
|
-
if path =~ /^https?:\/\/([\w+\-
|
122
|
+
if path =~ /^https?:\/\/([\w+\-]+)\.(?:[\w+\-]+\.)*[\w\-]+(?:\/|$)/
|
123
123
|
return true if $1.downcase == "svn"
|
124
124
|
end
|
125
125
|
|
126
126
|
# Look for http(s)://*/*svn*/
|
127
|
-
if path =~ /^https?:\/\/(?:[\w+\-
|
127
|
+
if path =~ /^https?:\/\/(?:[\w+\-]+\.?)+\/(\w+)/
|
128
128
|
return true if $1.downcase.include? "svn"
|
129
129
|
end
|
130
130
|
|
@@ -140,7 +140,7 @@ module Externals
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def self.detected?
|
143
|
-
File.
|
143
|
+
File.exist?(".svn")
|
144
144
|
end
|
145
145
|
|
146
146
|
#this is a test helper method
|
data/test/test_checkout_git.rb
CHANGED
@@ -12,21 +12,21 @@ module Externals
|
|
12
12
|
repository = BasicGitRepository.new
|
13
13
|
repository.prepare
|
14
14
|
|
15
|
-
assert File.
|
15
|
+
assert File.exist?(repository.clean_dir)
|
16
16
|
|
17
17
|
workdir = File.join(root_dir, 'test', "tmp", "workdir")
|
18
18
|
mkdir_p workdir
|
19
19
|
|
20
20
|
Dir.chdir workdir do
|
21
|
-
if File.
|
21
|
+
if File.exist?(repository.name)
|
22
22
|
rm_r repository.name
|
23
23
|
end
|
24
24
|
|
25
25
|
Ext.run "checkout", "--git", repository.clean_dir
|
26
26
|
|
27
|
-
assert File.
|
27
|
+
assert File.exist?(File.join(repository.name, "readme.txt"))
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
32
|
-
end
|
32
|
+
end
|
@@ -15,7 +15,7 @@ module Externals
|
|
15
15
|
workdir = File.join(root_dir, 'test', "tmp", "workdir", "branches", "git")
|
16
16
|
mkdir_p workdir
|
17
17
|
|
18
|
-
if File.
|
18
|
+
if File.exist?(File.join(workdir,"rails_app"))
|
19
19
|
rm_rf File.join(workdir, "rails_app")
|
20
20
|
end
|
21
21
|
|
@@ -25,9 +25,9 @@ module Externals
|
|
25
25
|
Ext.run "checkout", "--git", source
|
26
26
|
|
27
27
|
Dir.chdir 'rails_app' do
|
28
|
-
assert File.
|
28
|
+
assert File.exist?('.git')
|
29
29
|
|
30
|
-
assert File.
|
30
|
+
assert File.exist?('.gitignore')
|
31
31
|
|
32
32
|
ext = Ext.new
|
33
33
|
main_project = ext.main_project
|
@@ -40,7 +40,7 @@ module Externals
|
|
40
40
|
assert_equal "edge", engines.current_branch
|
41
41
|
assert_equal "edge", ext.configuration["vendor/plugins/engines"]["branch"]
|
42
42
|
|
43
|
-
assert File.
|
43
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
44
44
|
|
45
45
|
`git checkout --track -b new_branch origin/new_branch`
|
46
46
|
raise unless $? == 0
|
@@ -57,7 +57,7 @@ module Externals
|
|
57
57
|
assert !main_project.ignore_contains?("vendor/rails")
|
58
58
|
|
59
59
|
rm_rf "vendor/rails"
|
60
|
-
raise if File.
|
60
|
+
raise if File.exist?(File.join("vendor", "rails"))
|
61
61
|
|
62
62
|
`git checkout master`
|
63
63
|
raise unless $? == 0
|
@@ -68,7 +68,7 @@ module Externals
|
|
68
68
|
Ext.run "up"
|
69
69
|
assert_equal "master", main_project.current_branch
|
70
70
|
assert_equal "edge", engines.current_branch
|
71
|
-
assert File.
|
71
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
72
72
|
|
73
73
|
`git checkout new_branch`
|
74
74
|
assert_equal "new_branch", main_project.current_branch
|
@@ -91,21 +91,21 @@ module Externals
|
|
91
91
|
assert_equal "branch1", engines.current_branch
|
92
92
|
|
93
93
|
assert !main_project.ignore_contains?("vendor/rails")
|
94
|
-
assert File.
|
94
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
95
95
|
rm_rf "vendor/rails"
|
96
96
|
|
97
97
|
Ext.run "switch", "master"
|
98
98
|
assert_equal "master", main_project.current_branch
|
99
99
|
assert_equal "edge", engines.current_branch
|
100
100
|
|
101
|
-
assert File.
|
101
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
102
102
|
|
103
103
|
assert main_project.ignore_contains?("vendor/rails")
|
104
104
|
end
|
105
105
|
|
106
106
|
#now let's check it out again to test "ext checkout -b new_branch"
|
107
107
|
rm_rf "rails_app"
|
108
|
-
if File.
|
108
|
+
if File.exist?("rails_app")
|
109
109
|
raise
|
110
110
|
end
|
111
111
|
|
@@ -129,7 +129,7 @@ module Externals
|
|
129
129
|
workdir = File.join(root_dir, 'test', "tmp", "workdir", "branches", "uninstall", "git")
|
130
130
|
mkdir_p workdir
|
131
131
|
|
132
|
-
if File.
|
132
|
+
if File.exist?(File.join(workdir,"rails_app"))
|
133
133
|
rm_rf File.join(workdir, "rails_app")
|
134
134
|
end
|
135
135
|
|
@@ -166,4 +166,4 @@ module Externals
|
|
166
166
|
end
|
167
167
|
|
168
168
|
end
|
169
|
-
end
|
169
|
+
end
|
@@ -24,7 +24,7 @@ module Externals
|
|
24
24
|
Ext.run "checkout", "--svn", source, 'rails_app'
|
25
25
|
|
26
26
|
Dir.chdir 'rails_app' do
|
27
|
-
assert File.
|
27
|
+
assert File.exist?('.svn')
|
28
28
|
|
29
29
|
%w(redhillonrails_core acts_as_list).each do |proj|
|
30
30
|
puts(ignore_text = `svn propget svn:ignore vendor/plugins`)
|
@@ -35,12 +35,12 @@ module Externals
|
|
35
35
|
assert(ignore_text =~ /^rails$/)
|
36
36
|
|
37
37
|
%w(redhillonrails_core acts_as_list some_subproject_with_edge).each do |proj|
|
38
|
-
assert File.
|
38
|
+
assert File.exist?(File.join('vendor', 'plugins', proj, 'lib'))
|
39
39
|
end
|
40
40
|
|
41
|
-
assert File.
|
41
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
42
42
|
|
43
|
-
assert File.
|
43
|
+
assert File.exist?(File.join('vendor', 'rails', '.git'))
|
44
44
|
|
45
45
|
Dir.chdir File.join('vendor', 'rails') do
|
46
46
|
heads = File.readlines("heads").map(&:strip)
|
@@ -53,7 +53,7 @@ module Externals
|
|
53
53
|
/^\s*commit\s+#{heads[0]}\s*$/
|
54
54
|
end
|
55
55
|
|
56
|
-
assert File.
|
56
|
+
assert File.exist?(File.join('modules', 'modules.txt'))
|
57
57
|
|
58
58
|
assert File.read(File.join('modules', 'modules.txt')) =~ /line1 of/
|
59
59
|
|
@@ -80,8 +80,8 @@ module Externals
|
|
80
80
|
|
81
81
|
Dir.chdir 'rails_app' do
|
82
82
|
pretests = proc do
|
83
|
-
assert File.
|
84
|
-
assert !File.
|
83
|
+
assert File.exist?('.svn')
|
84
|
+
assert !File.exist?(File.join('vendor', 'plugins', 'ssl_requirement', 'lib'))
|
85
85
|
assert File.read(".externals") =~ /rails/
|
86
86
|
assert File.read(".externals") !~ /ssl_requirement/
|
87
87
|
end
|
@@ -114,7 +114,7 @@ module Externals
|
|
114
114
|
#update the project and make sure ssl_requirement was added and checked out
|
115
115
|
Ext.run "update"
|
116
116
|
assert File.read(".externals") =~ /ssl_requirement/
|
117
|
-
assert File.
|
117
|
+
assert File.exist?(File.join('vendor', 'plugins', 'ssl_requirement', 'lib'))
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
@@ -139,8 +139,8 @@ module Externals
|
|
139
139
|
Dir.chdir 'rails_app' do
|
140
140
|
|
141
141
|
pretests = proc do
|
142
|
-
assert File.
|
143
|
-
assert !File.
|
142
|
+
assert File.exist?('.svn')
|
143
|
+
assert !File.exist?(File.join('vendor', 'plugins', subproject_name, 'lib'))
|
144
144
|
assert File.read(".externals") =~ /rails/
|
145
145
|
assert File.read(".externals") !~ /#{subproject}/
|
146
146
|
end
|
@@ -189,7 +189,7 @@ module Externals
|
|
189
189
|
Ext.run "update"
|
190
190
|
assert File.read(".externals") =~ /ssl_requirement/
|
191
191
|
|
192
|
-
assert File.
|
192
|
+
assert File.exist?(File.join('vendor', 'plugins', subproject_name, 'lib'))
|
193
193
|
|
194
194
|
Dir.chdir File.join("vendor",'plugins', subproject_name) do
|
195
195
|
assert `git show HEAD` =~ /^\s*commit\s*#{revision}\s*$/i
|
@@ -215,8 +215,8 @@ module Externals
|
|
215
215
|
|
216
216
|
Dir.chdir 'rails_app' do
|
217
217
|
pretests = proc do
|
218
|
-
assert File.
|
219
|
-
assert !File.
|
218
|
+
assert File.exist?('.svn')
|
219
|
+
assert !File.exist?(File.join('vendor', 'plugins', subproject.name, 'lib'))
|
220
220
|
assert File.read(".externals") =~ /rails/
|
221
221
|
assert File.read(".externals") !~ /empty_plugin/
|
222
222
|
end
|
@@ -248,7 +248,7 @@ module Externals
|
|
248
248
|
#update the project and make sure ssl_requirement was added and checked out
|
249
249
|
Ext.run "update"
|
250
250
|
assert File.read(".externals") =~ /empty_plugin/
|
251
|
-
assert File.
|
251
|
+
assert File.exist?(File.join('vendor', 'plugins', subproject.name, 'lib'))
|
252
252
|
end
|
253
253
|
end
|
254
254
|
end
|
@@ -267,7 +267,7 @@ module Externals
|
|
267
267
|
Ext.run "export", "--svn", source, 'rails_app'
|
268
268
|
|
269
269
|
Dir.chdir 'rails_app' do
|
270
|
-
assert !File.
|
270
|
+
assert !File.exist?('.svn')
|
271
271
|
|
272
272
|
Dir.chdir File.join('vendor', 'rails') do
|
273
273
|
heads = File.readlines("heads").map(&:strip)
|
@@ -281,18 +281,18 @@ module Externals
|
|
281
281
|
end
|
282
282
|
|
283
283
|
%w(redhillonrails_core acts_as_list).each do |proj|
|
284
|
-
puts "filethere? #{proj}: #{File.
|
285
|
-
if !File.
|
284
|
+
puts "filethere? #{proj}: #{File.exist?(File.join('vendor', 'plugins', proj, 'lib'))}"
|
285
|
+
if !File.exist?(File.join('vendor', 'plugins', proj, 'lib'))
|
286
286
|
puts "here"
|
287
287
|
end
|
288
|
-
assert File.
|
288
|
+
assert File.exist?(File.join('vendor', 'plugins', proj, 'lib'))
|
289
289
|
end
|
290
290
|
|
291
291
|
%w(redhillonrails_core).each do |proj|
|
292
|
-
assert !File.
|
292
|
+
assert !File.exist?(File.join('vendor', 'plugins',proj, '.svn'))
|
293
293
|
end
|
294
294
|
|
295
|
-
assert File.
|
295
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
296
296
|
|
297
297
|
# Check that engines subproject has content expected for edge branch
|
298
298
|
ext = Ext.new
|
@@ -363,7 +363,7 @@ module Externals
|
|
363
363
|
Ext.run "export", "--svn", source, 'rails_app'
|
364
364
|
|
365
365
|
Dir.chdir 'rails_app' do
|
366
|
-
assert !File.
|
366
|
+
assert !File.exist?('.svn')
|
367
367
|
|
368
368
|
# Check that engines subproject has content expected for sub_project_revision
|
369
369
|
ext = Ext.new
|
@@ -381,4 +381,4 @@ module Externals
|
|
381
381
|
|
382
382
|
end
|
383
383
|
end
|
384
|
-
end
|
384
|
+
end
|
@@ -14,21 +14,21 @@ module Externals
|
|
14
14
|
repository = RailsAppGitRepository.new
|
15
15
|
repository.prepare
|
16
16
|
|
17
|
-
assert File.
|
17
|
+
assert File.exist?(repository.clean_dir)
|
18
18
|
|
19
19
|
workdir = File.join(root_dir, 'test', "tmp", "workdir", "checkout", "git")
|
20
20
|
mkdir_p workdir
|
21
21
|
|
22
22
|
Dir.chdir workdir do
|
23
|
-
rm_r repository.name if File.
|
23
|
+
rm_r repository.name if File.exist?(repository.name)
|
24
24
|
source = repository.clean_dir
|
25
25
|
puts "About to checkout #{source}"
|
26
26
|
Ext.run "checkout", "--git", source
|
27
27
|
|
28
28
|
Dir.chdir repository.name do
|
29
|
-
assert File.
|
29
|
+
assert File.exist?('.git')
|
30
30
|
|
31
|
-
assert File.
|
31
|
+
assert File.exist?('.gitignore')
|
32
32
|
|
33
33
|
%w(foreign_key_migrations redhillonrails_core acts_as_list).each do |proj|
|
34
34
|
assert(File.read('.gitignore') =~ /^vendor[\/\\]plugins[\/\\]#{proj}$/)
|
@@ -63,7 +63,7 @@ module Externals
|
|
63
63
|
raise unless $? == 0
|
64
64
|
|
65
65
|
%w(foreign_key_migrations redhillonrails_core acts_as_list).each do |proj|
|
66
|
-
assert File.
|
66
|
+
assert File.exist?(File.join('vendor', 'plugins', proj, 'lib'))
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
@@ -76,13 +76,13 @@ module Externals
|
|
76
76
|
sub_repository = ModulesSvnBranchesRepository.new
|
77
77
|
sub_repository.prepare
|
78
78
|
|
79
|
-
assert File.
|
79
|
+
assert File.exist?(repository.clean_dir)
|
80
80
|
|
81
81
|
workdir = File.join(root_dir, 'test', "tmp", "workdir", "checkout", "git")
|
82
82
|
mkdir_p workdir
|
83
83
|
|
84
84
|
Dir.chdir workdir do
|
85
|
-
rm_r repository.name if File.
|
85
|
+
rm_r repository.name if File.exist?(repository.name)
|
86
86
|
source = repository.clean_dir
|
87
87
|
|
88
88
|
puts "About to checkout #{source}"
|
@@ -123,7 +123,7 @@ module Externals
|
|
123
123
|
mkdir_p workdir
|
124
124
|
|
125
125
|
Dir.chdir workdir do
|
126
|
-
rm_r repository.name if File.
|
126
|
+
rm_r repository.name if File.exist?(repository.name)
|
127
127
|
source = repository.clean_dir
|
128
128
|
|
129
129
|
puts "About to checkout #{source}"
|
@@ -155,7 +155,7 @@ module Externals
|
|
155
155
|
mkdir_p workdir
|
156
156
|
|
157
157
|
Dir.chdir workdir do
|
158
|
-
rm_r repository.name if File.
|
158
|
+
rm_r repository.name if File.exist?(repository.name)
|
159
159
|
source = repository.clean_dir
|
160
160
|
|
161
161
|
puts "About to checkout #{source}"
|
@@ -173,4 +173,4 @@ module Externals
|
|
173
173
|
|
174
174
|
end
|
175
175
|
end
|
176
|
-
end
|
176
|
+
end
|
data/test/test_init_git.rb
CHANGED
@@ -8,33 +8,55 @@ module Externals
|
|
8
8
|
class TestInitGit < ::Test::Unit::TestCase
|
9
9
|
include ExtTestCase
|
10
10
|
|
11
|
-
def
|
11
|
+
def setup
|
12
12
|
repository = BasicGitRepository.new
|
13
13
|
repository.prepare
|
14
14
|
|
15
|
-
assert File.
|
15
|
+
assert File.exist?(repository.clean_dir)
|
16
16
|
|
17
17
|
workdir = File.join(root_dir, 'test', "tmp", "workdir")
|
18
18
|
mkdir_p workdir
|
19
19
|
|
20
20
|
Dir.chdir workdir do
|
21
21
|
delete_if_dirty(repository.name)
|
22
|
-
if !File.
|
22
|
+
if !File.exist?(repository.name)
|
23
23
|
`git clone #{repository.clean_dir} #{repository.name}`
|
24
24
|
raise unless $? == 0
|
25
25
|
end
|
26
26
|
|
27
27
|
mark_dirty(repository.name)
|
28
|
-
|
29
|
-
|
28
|
+
end
|
29
|
+
|
30
|
+
@workdir = workdir
|
31
|
+
@repository = repository
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_init
|
35
|
+
Dir.chdir @workdir do
|
36
|
+
Dir.chdir @repository.name do
|
37
|
+
assert !File.exist?('.externals')
|
38
|
+
|
39
|
+
rescue_exit { Ext.run "init" }
|
40
|
+
|
41
|
+
config = Externals::Configuration::Configuration.new(File.read('.externals'))
|
42
|
+
assert_equal(config['.']['scm'], 'git')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_init_rails_project
|
48
|
+
Dir.chdir @workdir do
|
49
|
+
Dir.chdir @repository.name do
|
50
|
+
assert !File.exist?('.externals')
|
30
51
|
|
31
|
-
Ext.run "init"
|
52
|
+
rescue_exit { Ext.run "init", "--type", "rails" }
|
32
53
|
|
33
|
-
|
34
|
-
|
54
|
+
config = Externals::Configuration::Configuration.new(File.read('.externals'))
|
55
|
+
assert_equal(config['.']['scm'], 'git')
|
56
|
+
assert_equal(config['.']['type'], 'rails')
|
35
57
|
end
|
36
58
|
end
|
37
59
|
end
|
38
60
|
end
|
39
61
|
end
|
40
|
-
end
|
62
|
+
end
|
@@ -12,24 +12,24 @@ module Externals
|
|
12
12
|
repository = SimpleGitWithSub.new
|
13
13
|
repository.prepare
|
14
14
|
|
15
|
-
assert File.
|
15
|
+
assert File.exist?(repository.clean_dir)
|
16
16
|
|
17
17
|
workdir = File.join(root_dir, 'test', "tmp", "workdir")
|
18
18
|
mkdir_p workdir
|
19
19
|
|
20
20
|
Dir.chdir workdir do
|
21
|
-
if File.
|
21
|
+
if File.exist?(repository.name)
|
22
22
|
rm_rf repository.name
|
23
23
|
end
|
24
24
|
|
25
25
|
Ext.run "checkout", "--git", repository.clean_dir
|
26
26
|
|
27
|
-
assert !File.
|
28
|
-
assert File.
|
29
|
-
assert !File.
|
27
|
+
assert !File.exist?(File.join(repository.name, "readme.txt"))
|
28
|
+
assert File.exist?(File.join(repository.name, "simple_readme.txt"))
|
29
|
+
assert !File.exist?(File.join(
|
30
30
|
repository.name, "subs", repository.dependents[:basic].name, "simple_readme.txt")
|
31
31
|
)
|
32
|
-
assert File.
|
32
|
+
assert File.exist?(File.join(
|
33
33
|
repository.name, "subs", repository.dependents[:basic].name, "readme.txt")
|
34
34
|
)
|
35
35
|
|
@@ -80,4 +80,4 @@ module Externals
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
83
|
-
end
|
83
|
+
end
|
data/test/test_projects.rb
CHANGED
@@ -17,7 +17,7 @@ module Externals
|
|
17
17
|
|
18
18
|
def test_svn_global_opts
|
19
19
|
Dir.chdir File.join(root_dir, 'test') do
|
20
|
-
rm_rf "test_svn_global_opts" if File.
|
20
|
+
rm_rf "test_svn_global_opts" if File.exist?("test_svn_global_opts")
|
21
21
|
mkdir "test_svn_global_opts"
|
22
22
|
|
23
23
|
begin
|
@@ -138,11 +138,11 @@ repository = svn://rubyforge.org/var/svn/redhillonrails/trunk/vendor/plugins/for
|
|
138
138
|
|
139
139
|
end
|
140
140
|
ensure
|
141
|
-
rm_rf "test_svn_global_opts" if File.
|
141
|
+
rm_rf "test_svn_global_opts" if File.exist?("test_svn_global_opts")
|
142
142
|
end
|
143
143
|
|
144
144
|
end
|
145
145
|
end
|
146
146
|
end
|
147
147
|
end
|
148
|
-
end
|
148
|
+
end
|
data/test/test_svn_branches.rb
CHANGED
@@ -14,12 +14,12 @@ module Externals
|
|
14
14
|
repository = RailsAppSvnBranches.new
|
15
15
|
repository.prepare
|
16
16
|
|
17
|
-
assert File.
|
17
|
+
assert File.exist?(File.join(repository.clean_dir, "db"))
|
18
18
|
|
19
19
|
workdir = File.join(root_dir, 'test', "tmp", "workdir", mode, "svn", "branches")
|
20
20
|
mkdir_p workdir
|
21
21
|
|
22
|
-
if File.
|
22
|
+
if File.exist?(File.join(workdir, "rails_app"))
|
23
23
|
rm_r File.join(workdir, "rails_app")
|
24
24
|
end
|
25
25
|
|
@@ -33,7 +33,7 @@ module Externals
|
|
33
33
|
Ext.run mode, "--svn", source, "-b", "current", 'rails_app'
|
34
34
|
|
35
35
|
Dir.chdir 'rails_app' do
|
36
|
-
assert File.
|
36
|
+
assert File.exist?('.svn')
|
37
37
|
|
38
38
|
%w(redhillonrails_core acts_as_list).each do |proj|
|
39
39
|
ignore_text = `svn propget svn:ignore vendor/plugins`
|
@@ -46,14 +46,14 @@ module Externals
|
|
46
46
|
assert(ignore_text =~ /^rails$/)
|
47
47
|
|
48
48
|
%w(redhillonrails_core acts_as_list engines).each do |proj|
|
49
|
-
assert File.
|
49
|
+
assert File.exist?(File.join('vendor', 'plugins', proj, 'lib'))
|
50
50
|
end
|
51
51
|
|
52
|
-
assert File.
|
52
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
53
53
|
|
54
|
-
assert File.
|
54
|
+
assert File.exist?(File.join('vendor', 'rails', '.git'))
|
55
55
|
|
56
|
-
assert File.
|
56
|
+
assert File.exist?(File.join('modules', 'modules.txt'))
|
57
57
|
|
58
58
|
assert File.read(File.join('modules', 'modules.txt')) =~ /line1 of/
|
59
59
|
|
@@ -70,8 +70,8 @@ module Externals
|
|
70
70
|
assert_equal "current", modules.current_branch
|
71
71
|
assert_equal "current", ext.configuration["modules"]["branch"]
|
72
72
|
|
73
|
-
assert !File.
|
74
|
-
assert !File.
|
73
|
+
assert !File.exist?(File.join(%w(vendor plugins ssl_requirement)))
|
74
|
+
assert !File.exist?(File.join(%w(vendor plugins empty_plugin)))
|
75
75
|
|
76
76
|
#let's run update. This can expose certain errors.
|
77
77
|
Ext.run "update"
|
@@ -81,8 +81,8 @@ module Externals
|
|
81
81
|
raise
|
82
82
|
end
|
83
83
|
|
84
|
-
assert !File.
|
85
|
-
assert !File.
|
84
|
+
assert !File.exist?(File.join(%w(vendor plugins ssl_requirement)))
|
85
|
+
assert !File.exist?(File.join(%w(vendor plugins empty_plugin)))
|
86
86
|
|
87
87
|
assert !main_project.ignore_contains?("vendor/rails")
|
88
88
|
|
@@ -101,8 +101,8 @@ module Externals
|
|
101
101
|
|
102
102
|
Ext.run "up"
|
103
103
|
|
104
|
-
assert File.
|
105
|
-
assert File.
|
104
|
+
assert File.exist?(File.join(%w(vendor plugins ssl_requirement)))
|
105
|
+
assert File.exist?(File.join(%w(vendor plugins empty_plugin)))
|
106
106
|
|
107
107
|
Dir.chdir File.join("vendor",'plugins', "ssl_requirement") do
|
108
108
|
assert `git show HEAD` =~ /^\s*commit\s*#{
|
@@ -146,9 +146,9 @@ module Externals
|
|
146
146
|
engines = ext.subproject("engines")
|
147
147
|
modules = ext.subproject("modules")
|
148
148
|
|
149
|
-
assert File.
|
149
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
150
150
|
|
151
|
-
assert File.
|
151
|
+
assert File.exist?(File.join('vendor', 'rails', '.git'))
|
152
152
|
|
153
153
|
assert_equal "current", main_project.current_branch
|
154
154
|
|
@@ -224,9 +224,9 @@ module Externals
|
|
224
224
|
|
225
225
|
capture = capture.string
|
226
226
|
|
227
|
-
assert File.
|
227
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
228
228
|
|
229
|
-
assert File.
|
229
|
+
assert File.exist?(File.join('vendor', 'rails', '.git'))
|
230
230
|
|
231
231
|
|
232
232
|
assert_equal "current", main_project.current_branch
|
@@ -255,13 +255,13 @@ module Externals
|
|
255
255
|
repository = RailsAppSvnBranches.new
|
256
256
|
repository.prepare
|
257
257
|
|
258
|
-
assert File.
|
258
|
+
assert File.exist?(File.join(repository.clean_dir, "db"))
|
259
259
|
|
260
260
|
workdir = File.join(root_dir, 'test', "tmp", "workdir", mode, "svn", "branch_test")
|
261
261
|
rm_rf workdir
|
262
262
|
mkdir_p workdir
|
263
263
|
|
264
|
-
if File.
|
264
|
+
if File.exist?(File.join(workdir,"rails_app"))
|
265
265
|
rm_r File.join(workdir, "rails_app")
|
266
266
|
end
|
267
267
|
|
@@ -275,21 +275,21 @@ module Externals
|
|
275
275
|
Ext.run mode, "--svn", source, "-b", "current", 'rails_app'
|
276
276
|
|
277
277
|
Dir.chdir 'rails_app' do
|
278
|
-
assert !File.
|
278
|
+
assert !File.exist?('.svn')
|
279
279
|
|
280
280
|
%w(redhillonrails_core).each do |proj|
|
281
|
-
assert !File.
|
281
|
+
assert !File.exist?(File.join('vendor', 'plugins', proj, '.svn'))
|
282
282
|
end
|
283
283
|
|
284
284
|
%w(redhillonrails_core acts_as_list engines).each do |proj|
|
285
|
-
assert File.
|
285
|
+
assert File.exist?(File.join('vendor', 'plugins', proj, 'lib'))
|
286
286
|
end
|
287
287
|
|
288
|
-
assert File.
|
288
|
+
assert File.exist?(File.join('vendor', 'rails', 'activerecord', 'lib'))
|
289
289
|
|
290
|
-
assert File.
|
290
|
+
assert File.exist?(File.join('vendor', 'rails', '.git'))
|
291
291
|
|
292
|
-
assert File.
|
292
|
+
assert File.exist?(File.join('modules', 'modules.txt'))
|
293
293
|
|
294
294
|
assert File.read(File.join('modules', 'modules.txt')) =~ /line1 of/
|
295
295
|
|
@@ -297,8 +297,8 @@ module Externals
|
|
297
297
|
assert_equal "edge", ext.configuration["vendor/plugins/engines"]["branch"]
|
298
298
|
assert_equal "current", ext.configuration["modules"]["branch"]
|
299
299
|
|
300
|
-
assert !File.
|
301
|
-
assert !File.
|
300
|
+
assert !File.exist?(File.join(%w(vendor plugins ssl_requirement)))
|
301
|
+
assert !File.exist?(File.join(%w(vendor plugins empty_plugin)))
|
302
302
|
end
|
303
303
|
end
|
304
304
|
end
|
@@ -307,12 +307,12 @@ module Externals
|
|
307
307
|
repository = RailsAppSvnBranches.new
|
308
308
|
repository.prepare
|
309
309
|
|
310
|
-
assert File.
|
310
|
+
assert File.exist?(File.join(repository.clean_dir, "db"))
|
311
311
|
|
312
312
|
workdir = File.join(root_dir, 'test', "tmp", "workdir","uninstall","svn","branches")
|
313
313
|
mkdir_p workdir
|
314
314
|
|
315
|
-
if File.
|
315
|
+
if File.exist?(File.join(workdir,"rails_app"))
|
316
316
|
rm_r File.join(workdir, "rails_app")
|
317
317
|
end
|
318
318
|
|
@@ -350,4 +350,4 @@ module Externals
|
|
350
350
|
|
351
351
|
end
|
352
352
|
end
|
353
|
-
end
|
353
|
+
end
|
@@ -41,19 +41,19 @@ module Externals
|
|
41
41
|
|
42
42
|
def test_touch_emptydirs
|
43
43
|
Dir.chdir File.join(root_dir, 'test') do
|
44
|
-
assert !File.
|
44
|
+
assert !File.exist?(File.join('.emptydir'))
|
45
45
|
Dir.chdir 'workdir' do
|
46
46
|
Ext.run "touch_emptydirs"
|
47
|
-
assert !File.
|
48
|
-
assert !File.
|
49
|
-
assert File.
|
50
|
-
assert !File.
|
51
|
-
assert File.
|
52
|
-
assert !File.
|
47
|
+
assert !File.exist?(File.join('.emptydir'))
|
48
|
+
assert !File.exist?(File.join('notempty1', '.emptydir'))
|
49
|
+
assert File.exist?(File.join('notempty1', 'empty1', '.emptydir'))
|
50
|
+
assert !File.exist?(File.join('notempty1', 'notempty2', '.emptydir'))
|
51
|
+
assert File.exist?(File.join('notempty1', 'notempty2', 'empty2', '.emptydir'))
|
52
|
+
assert !File.exist?(File.join('notempty1', 'notempty2', 'notempty3', '.emptydir'))
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
57
|
end
|
58
58
|
end
|
59
|
-
end
|
59
|
+
end
|
metadata
CHANGED
@@ -1,63 +1,54 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ext
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 2
|
10
|
-
version: 1.1.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.3
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Miles Georgi
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2013-01-13 00:00:00 Z
|
11
|
+
date: 2019-02-10 00:00:00.000000000 Z
|
19
12
|
dependencies: []
|
20
|
-
|
21
13
|
description: |-
|
22
14
|
Provides an SCM agnostic way to manage subprojects with a workflow similar
|
23
15
|
to the scm:externals feature of subversion. It's particularly useful for rails
|
24
16
|
projects that have some plugins managed by svn and some managed by git.
|
25
|
-
|
17
|
+
|
26
18
|
For example, "ext install git://github.com/rails/rails.git" from within a rails
|
27
19
|
application directory will realize that this belongs in the vendor/rails folder.
|
28
20
|
It will also realize that this URL is a git repository and clone it into that
|
29
21
|
folder.
|
30
|
-
|
22
|
+
|
31
23
|
It will also add the vendor/rails folder to the ignore feature for the SCM of
|
32
24
|
the main project. Let's say that the main project is being managed by
|
33
25
|
subversion. In that case it adds "rails" to the svn:ignore property of the
|
34
26
|
vendor folder. It also adds the URL to the .externals file so that when this
|
35
27
|
project is checked out via "ext checkout" it knows where to fetch the
|
36
28
|
subprojects.
|
37
|
-
|
29
|
+
|
38
30
|
There are several other useful commands, such as init, touch_emptydirs, add_all,
|
39
31
|
export, status. There's a tutorial at http://nopugs.com/ext-tutorial
|
40
|
-
|
32
|
+
|
41
33
|
The reason I made this project is that I was frustrated by two things:
|
42
|
-
|
34
|
+
|
43
35
|
1. In my opinion, the workflow for svn:externals is far superior to
|
44
36
|
git-submodule.
|
45
|
-
|
37
|
+
|
46
38
|
2. Even if git-submodule was as useful as svn:externals, I would still like a
|
47
39
|
uniform way to fetch all of the subprojects regardless of the SCM used to manage
|
48
40
|
the main project.
|
49
41
|
email: azimux@gmail.com
|
50
|
-
executables:
|
42
|
+
executables:
|
51
43
|
- ext
|
52
44
|
extensions: []
|
53
|
-
|
54
45
|
extra_rdoc_files: []
|
55
|
-
|
56
|
-
files:
|
57
|
-
- Rakefile
|
58
|
-
- README
|
59
|
-
- MIT_LICENSE.txt
|
46
|
+
files:
|
60
47
|
- CHANGELOG
|
48
|
+
- MIT_LICENSE.txt
|
49
|
+
- README
|
50
|
+
- Rakefile
|
51
|
+
- bin/ext
|
61
52
|
- lib/externals/command.rb
|
62
53
|
- lib/externals/configuration/configuration.rb
|
63
54
|
- lib/externals/ext.rb
|
@@ -68,6 +59,9 @@ files:
|
|
68
59
|
- lib/externals/project_types/rails.rb
|
69
60
|
- lib/externals/scms/git_project.rb
|
70
61
|
- lib/externals/scms/svn_project.rb
|
62
|
+
- test/setup/empty_plugin.svn.gz
|
63
|
+
- test/setup/foreign_key_migrations.svn.gz
|
64
|
+
- test/setup/redhillonrails_core.svn.gz
|
71
65
|
- test/test_checkout_git.rb
|
72
66
|
- test/test_checkout_with_subprojects_git.rb
|
73
67
|
- test/test_checkout_with_subprojects_svn.rb
|
@@ -83,44 +77,33 @@ files:
|
|
83
77
|
- test/test_svn_branches.rb
|
84
78
|
- test/test_touch_emptydirs.rb
|
85
79
|
- test/test_version.rb
|
86
|
-
- test/setup/empty_plugin.svn.gz
|
87
|
-
- test/setup/foreign_key_migrations.svn.gz
|
88
|
-
- test/setup/redhillonrails_core.svn.gz
|
89
|
-
- bin/ext
|
90
80
|
homepage: http://nopugs.com/ext-tutorial
|
91
|
-
licenses:
|
92
|
-
|
81
|
+
licenses:
|
82
|
+
- MIT
|
83
|
+
metadata: {}
|
93
84
|
post_install_message:
|
94
85
|
rdoc_options: []
|
95
|
-
|
96
|
-
require_paths:
|
86
|
+
require_paths:
|
97
87
|
- lib
|
98
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
-
|
100
|
-
requirements:
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
101
90
|
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
version: "0"
|
107
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
-
none: false
|
109
|
-
requirements:
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
110
95
|
- - ">="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
|
113
|
-
segments:
|
114
|
-
- 0
|
115
|
-
version: "0"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
116
98
|
requirements: []
|
117
|
-
|
118
99
|
rubyforge_project: ext
|
119
|
-
rubygems_version:
|
100
|
+
rubygems_version: 2.7.8
|
120
101
|
signing_key:
|
121
|
-
specification_version:
|
122
|
-
summary: Provides an SCM agnostic way to manage subprojects with a workflow similar
|
123
|
-
|
102
|
+
specification_version: 4
|
103
|
+
summary: Provides an SCM agnostic way to manage subprojects with a workflow similar
|
104
|
+
to the svn:externals feature of subversion. It's particularly useful for rails
|
105
|
+
projects that have some plugins managed by svn and some managed by git.
|
106
|
+
test_files:
|
124
107
|
- test/test_checkout_git.rb
|
125
108
|
- test/test_checkout_with_subprojects_git.rb
|
126
109
|
- test/test_checkout_with_subprojects_svn.rb
|