ext 1.0.7 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/README +12 -12
- data/Rakefile +1 -1
- data/lib/externals/ext.rb +35 -43
- data/test/test_checkout_git.rb +3 -3
- data/test/test_checkout_with_subprojects_git.rb +3 -3
- data/test/test_checkout_with_subprojects_svn.rb +3 -3
- data/test/test_file_utils_extensions.rb +2 -2
- data/test/test_freeze_to_revision.rb +37 -5
- data/test/test_git_project_extract_name.rb +2 -2
- data/test/test_init_git.rb +3 -3
- data/test/test_out_of_date_git_subproject.rb +3 -3
- data/test/test_projects.rb +2 -2
- data/test/test_rails_detection.rb +3 -3
- data/test/test_string_extensions.rb +2 -2
- data/test/test_svn_branches.rb +3 -3
- data/test/test_touch_emptydirs.rb +2 -2
- data/test/test_version.rb +2 -2
- metadata +4 -22
- data/lib/externals/test/basic_git_repository.rb +0 -57
- data/lib/externals/test/engines.rb +0 -11
- data/lib/externals/test/engines_with_branch1.rb +0 -36
- data/lib/externals/test/fake_rails_repository.rb +0 -112
- data/lib/externals/test/git_repository.rb +0 -15
- data/lib/externals/test/git_repository_from_internet.rb +0 -20
- data/lib/externals/test/modules_svn_branches_repository.rb +0 -72
- data/lib/externals/test/modules_svn_repository.rb +0 -41
- data/lib/externals/test/rails_app_git_branches.rb +0 -109
- data/lib/externals/test/rails_app_git_repository.rb +0 -66
- data/lib/externals/test/rails_app_svn_branches.rb +0 -132
- data/lib/externals/test/rails_app_svn_repository.rb +0 -106
- data/lib/externals/test/rails_app_unmanaged.rb +0 -25
- data/lib/externals/test/repository.rb +0 -186
- data/lib/externals/test/simple_git_with_sub.rb +0 -72
- data/lib/externals/test/svn_repository_from_dump.rb +0 -27
- data/lib/externals/test/svn_repository_helper.rb +0 -10
- data/lib/externals/test_case.rb +0 -54
data/test/test_projects.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib') if $0 == __FILE__
|
2
|
-
require '
|
2
|
+
require 'ext_test_case'
|
3
3
|
require 'externals/ext'
|
4
4
|
|
5
5
|
module Externals
|
6
6
|
module Test
|
7
|
-
class TestProjects < TestCase
|
7
|
+
class TestProjects < ::Test::Unit::TestCase
|
8
8
|
include ExtTestCase
|
9
9
|
|
10
10
|
def test_project_scm
|
@@ -1,12 +1,12 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__),'..','lib') if $0 == __FILE__
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'ext_test_case'
|
4
4
|
require 'externals/ext'
|
5
|
-
require '
|
5
|
+
require 'rails_app_unmanaged'
|
6
6
|
|
7
7
|
module Externals
|
8
8
|
module Test
|
9
|
-
class TestRailsDetection < TestCase
|
9
|
+
class TestRailsDetection < ::Test::Unit::TestCase
|
10
10
|
include ExtTestCase
|
11
11
|
|
12
12
|
def test_detection
|
@@ -1,11 +1,11 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__),'..','lib') if $0 == __FILE__
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'ext_test_case'
|
4
4
|
require 'externals/ext'
|
5
5
|
|
6
6
|
module Externals
|
7
7
|
module Test
|
8
|
-
class TestStringExtensions < TestCase
|
8
|
+
class TestStringExtensions < ::Test::Unit::TestCase
|
9
9
|
include ExtTestCase
|
10
10
|
|
11
11
|
def test_classify
|
data/test/test_svn_branches.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib') if $0 == __FILE__
|
2
|
-
require '
|
2
|
+
require 'ext_test_case'
|
3
3
|
require 'externals/ext'
|
4
|
-
require '
|
4
|
+
require 'rails_app_svn_branches'
|
5
5
|
|
6
6
|
module Externals
|
7
7
|
module Test
|
8
|
-
class TestSvnBranches < TestCase
|
8
|
+
class TestSvnBranches < ::Test::Unit::TestCase
|
9
9
|
include ExtTestCase
|
10
10
|
|
11
11
|
def test_checkout_with_subproject
|
@@ -1,11 +1,11 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__),'..','lib') if $0 == __FILE__
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'ext_test_case'
|
4
4
|
require 'externals/ext'
|
5
5
|
|
6
6
|
module Externals
|
7
7
|
module Test
|
8
|
-
class TestTouchEmptydirs < TestCase
|
8
|
+
class TestTouchEmptydirs < ::Test::Unit::TestCase
|
9
9
|
include ExtTestCase
|
10
10
|
|
11
11
|
def setup
|
data/test/test_version.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib') if $0 == __FILE__
|
2
|
-
require '
|
2
|
+
require 'ext_test_case'
|
3
3
|
require 'externals/ext'
|
4
4
|
require 'stringio'
|
5
5
|
|
6
6
|
module Externals
|
7
7
|
module Test
|
8
|
-
class TestVersion < TestCase
|
8
|
+
class TestVersion < ::Test::Unit::TestCase
|
9
9
|
include ExtTestCase
|
10
10
|
|
11
11
|
def test_version
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.7
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Miles Georgi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
18
|
+
date: 2012-07-21 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: |-
|
@@ -68,24 +68,6 @@ files:
|
|
68
68
|
- lib/externals/scms/svn_project.rb
|
69
69
|
- lib/externals/scms/git_project.rb
|
70
70
|
- lib/externals/command.rb
|
71
|
-
- lib/externals/test/modules_svn_repository.rb
|
72
|
-
- lib/externals/test/rails_app_unmanaged.rb
|
73
|
-
- lib/externals/test/rails_app_git_branches.rb
|
74
|
-
- lib/externals/test/simple_git_with_sub.rb
|
75
|
-
- lib/externals/test/modules_svn_branches_repository.rb
|
76
|
-
- lib/externals/test/svn_repository_from_dump.rb
|
77
|
-
- lib/externals/test/repository.rb
|
78
|
-
- lib/externals/test/engines.rb
|
79
|
-
- lib/externals/test/rails_app_git_repository.rb
|
80
|
-
- lib/externals/test/rails_app_svn_repository.rb
|
81
|
-
- lib/externals/test/rails_app_svn_branches.rb
|
82
|
-
- lib/externals/test/svn_repository_helper.rb
|
83
|
-
- lib/externals/test/basic_git_repository.rb
|
84
|
-
- lib/externals/test/git_repository_from_internet.rb
|
85
|
-
- lib/externals/test/fake_rails_repository.rb
|
86
|
-
- lib/externals/test/engines_with_branch1.rb
|
87
|
-
- lib/externals/test/git_repository.rb
|
88
|
-
- lib/externals/test_case.rb
|
89
71
|
- test/test_string_extensions.rb
|
90
72
|
- test/test_rails_detection.rb
|
91
73
|
- test/test_init_git.rb
|
@@ -1,57 +0,0 @@
|
|
1
|
-
require 'externals/test/git_repository'
|
2
|
-
|
3
|
-
module Externals
|
4
|
-
module Test
|
5
|
-
class BasicGitRepository < GitRepository
|
6
|
-
def initialize
|
7
|
-
super "basic", "git"
|
8
|
-
end
|
9
|
-
|
10
|
-
def build_here
|
11
|
-
repo_name = "#{name}.git"
|
12
|
-
|
13
|
-
mkdir repo_name
|
14
|
-
|
15
|
-
Dir.chdir("#{repo_name}") do
|
16
|
-
`git init --bare`
|
17
|
-
|
18
|
-
raise unless $? == 0
|
19
|
-
end
|
20
|
-
|
21
|
-
mkdir "#{name}.local"
|
22
|
-
|
23
|
-
Dir.chdir("#{name}.local") do
|
24
|
-
`git init`
|
25
|
-
|
26
|
-
raise unless $? == 0
|
27
|
-
|
28
|
-
open 'readme.txt', 'w' do |f|
|
29
|
-
f.write "readme.txt Line 1
|
30
|
-
Line 2
|
31
|
-
Line 3"
|
32
|
-
end
|
33
|
-
|
34
|
-
`git add .`
|
35
|
-
raise unless $? == 0
|
36
|
-
`git commit -m "added readme.txt"`
|
37
|
-
raise unless $? == 0
|
38
|
-
|
39
|
-
open 'readme.txt', 'a' do |f|
|
40
|
-
f.write "line 4"
|
41
|
-
end
|
42
|
-
|
43
|
-
`git add .`
|
44
|
-
raise unless $? == 0
|
45
|
-
`git commit -m "added a line to readme.txt"`
|
46
|
-
raise unless $? == 0
|
47
|
-
|
48
|
-
puts `git push ../#{repo_name} HEAD:master`
|
49
|
-
raise unless $? == 0
|
50
|
-
end
|
51
|
-
|
52
|
-
rm_rf "#{name}.local"
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'externals/test/git_repository'
|
2
|
-
require 'externals/test/engines'
|
3
|
-
|
4
|
-
module Externals
|
5
|
-
module Test
|
6
|
-
class EnginesWithBranch1 < GitRepository
|
7
|
-
def initialize
|
8
|
-
super "engines", File.join("git", "with_branch1")
|
9
|
-
dependents.merge!(
|
10
|
-
:other_engines => Engines.new
|
11
|
-
)
|
12
|
-
end
|
13
|
-
|
14
|
-
#builds the test repository in the current directory
|
15
|
-
def build_here
|
16
|
-
rm_rf_ie name
|
17
|
-
|
18
|
-
puts `git clone --bare #{dependents[:other_engines].clean_dir} #{name}.git`
|
19
|
-
raise unless $? == 0
|
20
|
-
|
21
|
-
rm_rf_ie "workdir"
|
22
|
-
mkdir "workdir"
|
23
|
-
Dir.chdir 'workdir' do
|
24
|
-
`git clone #{clean_dir}`
|
25
|
-
raise unless $? == 0
|
26
|
-
Dir.chdir name.gsub(".git", "") do
|
27
|
-
`git push origin master:branch1`
|
28
|
-
raise unless $? == 0
|
29
|
-
end
|
30
|
-
end
|
31
|
-
rm_rf_ie "workdir"
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,112 +0,0 @@
|
|
1
|
-
require 'externals/test/git_repository'
|
2
|
-
require 'find'
|
3
|
-
require 'externals/test/git_repository_from_internet'
|
4
|
-
|
5
|
-
module Externals
|
6
|
-
module Test
|
7
|
-
class FakeRailsRepository < GitRepository
|
8
|
-
def initialize
|
9
|
-
super "rails", "fake3"
|
10
|
-
end
|
11
|
-
|
12
|
-
def build_here
|
13
|
-
repository = GitRepositoryFromInternet.new("rails")
|
14
|
-
repository.prepare
|
15
|
-
|
16
|
-
rm_rf "fake_rails"
|
17
|
-
|
18
|
-
`git clone #{repository.clean_dir} fake_rails`
|
19
|
-
raise unless $? == 0
|
20
|
-
|
21
|
-
#let's make the repo smaller by removing all but 1 file from each
|
22
|
-
#directory to save time
|
23
|
-
Dir.chdir 'fake_rails' do
|
24
|
-
rm_rf ".git"
|
25
|
-
end
|
26
|
-
|
27
|
-
dirs = []
|
28
|
-
Find.find('fake_rails') do |f|
|
29
|
-
dirs << f if File.directory?(f)
|
30
|
-
end
|
31
|
-
|
32
|
-
dirs.each do |dir|
|
33
|
-
files = Dir.entries(dir)
|
34
|
-
|
35
|
-
Dir.chdir(dir) do
|
36
|
-
files = files.select {|e|e != ".gitignore" && File.file?(e)}.sort
|
37
|
-
files.shift #let's keep the first file in the list.
|
38
|
-
files.each do |file|
|
39
|
-
File.delete(file)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
raise "why is rails already here?" if File.exists? 'rails.git'
|
45
|
-
|
46
|
-
Dir.mkdir('rails.git')
|
47
|
-
|
48
|
-
Dir.chdir('rails.git') do
|
49
|
-
puts `git init --bare`
|
50
|
-
raise unless $? == 0
|
51
|
-
end
|
52
|
-
|
53
|
-
Dir.chdir 'fake_rails' do
|
54
|
-
puts `git init`
|
55
|
-
raise unless $? == 0
|
56
|
-
puts `git add .`
|
57
|
-
raise unless $? == 0
|
58
|
-
puts `git commit -m "rails with all but 1 file per directory deleted"`
|
59
|
-
raise unless $? == 0
|
60
|
-
puts `git push ../rails.git HEAD:master`
|
61
|
-
raise unless $? == 0
|
62
|
-
|
63
|
-
head1 = nil
|
64
|
-
head2 = nil
|
65
|
-
# let's make a couple commits...
|
66
|
-
open "heads", "a" do |file|
|
67
|
-
head1 = `git show HEAD`.match(/^\s*commit\s+([0-9a-f]{40})\s*$/)[1]
|
68
|
-
raise unless head1
|
69
|
-
file.puts head1
|
70
|
-
raise unless $? == 0
|
71
|
-
end
|
72
|
-
puts `git add .`
|
73
|
-
raise unless $? == 0
|
74
|
-
puts `git commit -m "dummy commit 1"`
|
75
|
-
raise unless $? == 0
|
76
|
-
puts `git push ../rails.git HEAD:master`
|
77
|
-
raise unless $? == 0
|
78
|
-
|
79
|
-
open "heads", "a" do |file|
|
80
|
-
head2 = `git show HEAD`.match(/^\s*commit\s+([0-9a-f]{40})\s*$/)[1]
|
81
|
-
raise unless head2
|
82
|
-
raise unless head1 != head2
|
83
|
-
file.puts head2
|
84
|
-
raise unless $? == 0
|
85
|
-
end
|
86
|
-
puts `git add .`
|
87
|
-
raise unless $? == 0
|
88
|
-
puts `git commit -m "dummy commit 2"`
|
89
|
-
raise unless $? == 0
|
90
|
-
puts `git push ../rails.git HEAD:master`
|
91
|
-
raise unless $? == 0
|
92
|
-
|
93
|
-
open "heads", "a" do |file|
|
94
|
-
head2 = `git show HEAD`.match(/^\s*commit\s+([0-9a-f]{40})\s*$/)[1]
|
95
|
-
raise unless head2
|
96
|
-
raise unless head1 != head2
|
97
|
-
file.puts head2
|
98
|
-
raise unless $? == 0
|
99
|
-
end
|
100
|
-
puts `git add .`
|
101
|
-
raise unless $? == 0
|
102
|
-
puts `git commit -m "dummy commit 3"`
|
103
|
-
raise unless $? == 0
|
104
|
-
puts `git push ../rails.git HEAD:master`
|
105
|
-
raise unless $? == 0
|
106
|
-
end
|
107
|
-
rm_rf "fake_rails"
|
108
|
-
end
|
109
|
-
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'externals/test/git_repository'
|
2
|
-
|
3
|
-
module Externals
|
4
|
-
module Test
|
5
|
-
class GitRepositoryFromInternet < GitRepository
|
6
|
-
attr_accessor :url
|
7
|
-
|
8
|
-
def initialize name, subpath = nil, url = nil
|
9
|
-
super name, subpath || "git"
|
10
|
-
self.url = url || "git://github.com/rails"
|
11
|
-
end
|
12
|
-
|
13
|
-
#builds the test repository in the current directory
|
14
|
-
def build_here
|
15
|
-
puts `git clone --bare #{url}/#{name}.git #{name}.git`
|
16
|
-
raise unless $? == 0
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,72 +0,0 @@
|
|
1
|
-
require 'externals/test/repository'
|
2
|
-
require 'externals/test/svn_repository_helper'
|
3
|
-
|
4
|
-
module Externals
|
5
|
-
module Test
|
6
|
-
class ModulesSvnBranchesRepository < Repository
|
7
|
-
include SvnRepositoryHelper
|
8
|
-
|
9
|
-
def initialize
|
10
|
-
super "modules_with_branches", "svn"
|
11
|
-
end
|
12
|
-
|
13
|
-
def build_here
|
14
|
-
puts `svnadmin create #{name}`
|
15
|
-
|
16
|
-
mkdir_p 'workdir'
|
17
|
-
Dir.chdir 'workdir' do
|
18
|
-
rm_rf name
|
19
|
-
|
20
|
-
cmd = "svn checkout \"#{clean_url}\""
|
21
|
-
puts "about to run #{cmd}"
|
22
|
-
puts `#{cmd}`
|
23
|
-
unless $? == 0
|
24
|
-
raise
|
25
|
-
end
|
26
|
-
|
27
|
-
Dir.chdir name do
|
28
|
-
mkdir "branches"
|
29
|
-
mkdir "current"
|
30
|
-
|
31
|
-
SvnProject.add_all
|
32
|
-
puts `svn commit -m "created branch directory structure"`
|
33
|
-
raise unless $? == 0
|
34
|
-
|
35
|
-
`svn switch #{[clean_url, 'current'].join("/")}`
|
36
|
-
raise unless $? == 0
|
37
|
-
|
38
|
-
open("modules.txt", "w") do |f|
|
39
|
-
f.write "line1 of modules.txt\n"
|
40
|
-
end
|
41
|
-
|
42
|
-
SvnProject.add_all
|
43
|
-
puts `svn commit -m "created modules.txt"`
|
44
|
-
raise unless $? == 0
|
45
|
-
|
46
|
-
`svn copy #{
|
47
|
-
[clean_url, "current"].join("/")
|
48
|
-
} #{[clean_url, "branches", "branch2"].join("/")
|
49
|
-
} -m "created branch2"`
|
50
|
-
raise unless $? == 0
|
51
|
-
|
52
|
-
puts `svn switch #{
|
53
|
-
[clean_url, "branches", "branch2"].join("/")
|
54
|
-
}`
|
55
|
-
raise unless $? == 0
|
56
|
-
|
57
|
-
open("modules.txt", "w") do |f|
|
58
|
-
f.write 'line 2 of modules.txt ... this is branch2!\n'
|
59
|
-
end
|
60
|
-
|
61
|
-
SvnProject.add_all
|
62
|
-
puts `svn commit -m "changed modules.txt"`
|
63
|
-
raise unless $? == 0
|
64
|
-
end
|
65
|
-
|
66
|
-
rm_rf name
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|