ext 0.0.10 → 0.1.0

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.
@@ -28,7 +28,7 @@ module Externals
28
28
 
29
29
  #install a couple svn managed subprojects
30
30
  %w(foreign_key_migrations redhillonrails_core).each do |proj|
31
- Ext.run "install", "svn://rubyforge.org/var/svn/redhillonrails/trunk/vendor/plugins/#{proj}"
31
+ Ext.run "install", "--svn", "http://redhillonrails.rubyforge.org/svn/trunk/vendor/plugins/#{proj}"
32
32
  end
33
33
 
34
34
  GitProject.add_all
@@ -40,6 +40,15 @@ module Externals
40
40
  def teardown
41
41
  destroy_rails_application
42
42
 
43
+ Dir.chdir File.join(root_dir, 'test') do
44
+ parts = 'workdir/checkout/rails_app/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/connection_adapters/.svn/text-base/table_definition.rb.svn-base'.split('/')
45
+ if File.exists? File.join(*parts)
46
+ Dir.chdir File.join(*(parts[0..-2])) do
47
+ File.delete parts[-1]
48
+ end
49
+ end
50
+ `rm -rf workdir`
51
+ end
43
52
  # Dir.chdir File.join(root_dir, 'test') do
44
53
  # `rm -rf workdir`
45
54
  # end
@@ -40,15 +40,15 @@ module Externals
40
40
 
41
41
  #install a couple svn managed subprojects
42
42
  %w(foreign_key_migrations redhillonrails_core).each do |proj|
43
- Ext.run "install", "svn://rubyforge.org/var/svn/redhillonrails/trunk/vendor/plugins/#{proj}"
43
+ Ext.run "install", "--svn", "http://redhillonrails.rubyforge.org/svn/trunk/vendor/plugins/#{proj}"
44
44
  end
45
-
45
+
46
46
  #install project with a branch
47
- Ext.run "install", "git://github.com/azimux/engines.git:edge"
48
-
47
+ Ext.run "install", "git://github.com/azimux/engines.git", "-b", "edge"
48
+
49
49
  #install project with a non-default path
50
50
  Ext.run "install", "--svn", "file:///#{modules_repository_dir('svn')}", "modules"
51
-
51
+
52
52
  SvnProject.add_all
53
53
 
54
54
  puts `svn commit -m "created empty rails app with some subprojects"`
@@ -58,6 +58,20 @@ module Externals
58
58
 
59
59
  def teardown
60
60
  destroy_rails_application
61
+ destroy_test_repository 'svn'
62
+ destroy_test_modules_repository 'svn'
63
+
64
+
65
+ Dir.chdir File.join(root_dir, 'test') do
66
+ parts = 'workdir/checkout/rails_app/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/connection_adapters/.svn/text-base/table_definition.rb.svn-base'.split('/')
67
+ if File.exists? File.join(*parts)
68
+ Dir.chdir File.join(*(parts[0..-2])) do
69
+ File.delete parts[-1]
70
+ end
71
+ end
72
+ `rm -rf workdir`
73
+ end
74
+
61
75
 
62
76
  # Dir.chdir File.join(root_dir, 'test') do
63
77
  # `rm -rf workdir`
@@ -92,7 +106,7 @@ module Externals
92
106
 
93
107
  puts(ignore_text = `svn propget svn:ignore vendor`)
94
108
  assert(ignore_text =~ /^rails$/)
95
-
109
+
96
110
  Dir.chdir File.join('vendor', 'rails') do
97
111
  assert `git show 92f944818eece9fe4bc62ffb39accdb71ebc32be` =~ /azimux/
98
112
  end
@@ -102,11 +116,11 @@ module Externals
102
116
  end
103
117
 
104
118
  assert File.exists?(File.join('vendor', 'rails', 'activerecord', 'lib'))
105
-
119
+
106
120
  assert File.exists?(File.join('modules', 'modules.txt'))
107
-
121
+
108
122
  assert File.read(File.join('modules', 'modules.txt')) =~ /line1 of/
109
-
123
+
110
124
  Dir.chdir File.join('vendor','plugins','engines') do
111
125
  assert(`git branch -a` =~ /^\*\s*edge\s*$/)
112
126
  assert(`git branch -a` !~ /^\*\s*master\s*$/)
@@ -116,7 +130,7 @@ module Externals
116
130
  end
117
131
  end
118
132
  end
119
-
133
+
120
134
  def test_export_with_subproject
121
135
  Dir.chdir File.join(root_dir, 'test') do
122
136
  Dir.chdir 'workdir' do
@@ -143,7 +157,7 @@ module Externals
143
157
 
144
158
  puts(ignore_text = `svn propget svn:ignore vendor`)
145
159
  assert(ignore_text =~ /^rails$/)
146
-
160
+
147
161
  Dir.chdir File.join('vendor', 'rails') do
148
162
  assert `git show 92f944818eece9fe4bc62ffb39accdb71ebc32be` !~ /azimux/
149
163
  end
@@ -155,7 +169,7 @@ module Externals
155
169
  end
156
170
  assert File.exists?(File.join('vendor', 'plugins', proj, 'lib'))
157
171
  end
158
-
172
+
159
173
  %w(foreign_key_migrations redhillonrails_core).each do |proj|
160
174
  assert !File.exists?(File.join('vendor', 'plugins',proj, '.svn'))
161
175
  end
@@ -0,0 +1,84 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib') if $0 == __FILE__
2
+ require 'externals/test_case'
3
+ require 'externals/ext'
4
+
5
+ module Externals
6
+ class TestUpgradeExternalsFile < TestCase
7
+ def test_upgrade
8
+ Dir.chdir File.join(root_dir, 'test') do
9
+ `rm -rf test_upgrade`
10
+ `mkdir test_upgrade`
11
+
12
+
13
+ Dir.chdir 'test_upgrade' do
14
+ open '.externals', 'w' do |f|
15
+ f.write "[main]
16
+
17
+ scm = git
18
+ type = rails
19
+ [git]
20
+
21
+ git://github.com/rails/rails.git
22
+ git://github.com/rails/acts_as_list.git:edge
23
+ [svn]
24
+
25
+ svn://rubyforge.org/var/svn/redhillonrails/trunk/vendor/plugins/foreign_key_migrations
26
+ svn://rubyforge.org/var/svn/redhillonrails/trunk/vendor/plugins/redhillonrails_core"
27
+ end
28
+
29
+ assert Ext.externals_file_obsolete?
30
+
31
+ Ext.run "upgrade_externals_file"
32
+ assert !Ext.externals_file_obsolete?
33
+
34
+ new_text = nil
35
+ open '.externals', 'r' do |f|
36
+ new_text = f.read
37
+ end
38
+ puts new_text
39
+
40
+ config1 = Configuration::Configuration.new(new_text)
41
+
42
+ config2 = Configuration::Configuration.new("[.]
43
+ scm = git
44
+ type = rails
45
+
46
+ [vendor/rails]
47
+ scm = git
48
+ repository = git://github.com/rails/rails.git
49
+
50
+ [vendor/plugins/acts_as_list]
51
+ scm = git
52
+ repository = git://github.com/rails/acts_as_list.git
53
+ branch = edge
54
+
55
+ [vendor/plugins/foreign_key_migrations]
56
+ scm = svn
57
+ repository = svn://rubyforge.org/var/svn/redhillonrails/trunk/vendor/plugins/foreign_key_migrations
58
+
59
+ [vendor/plugins/redhillonrails_core]
60
+ scm = svn
61
+ repository = svn://rubyforge.org/var/svn/redhillonrails/trunk/vendor/plugins/redhillonrails_core")
62
+
63
+
64
+ assert(config1.sections.size == 5)
65
+
66
+ [[config1, config2], [config2,config1]].each do |array|
67
+ c1 = array[0]
68
+ c2 = array[1]
69
+
70
+ c1.sections.each do |section|
71
+ s2 = c2[section.title]
72
+ assert s2
73
+ section.attributes.each_pair do |key,value|
74
+ assert s2[key] == value
75
+ end
76
+ end
77
+ end
78
+ end
79
+
80
+ `rm -rf test_upgrade`
81
+ end
82
+ end
83
+ end
84
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-10 00:00:00 -07:00
12
+ date: 2008-09-24 00:00:00 -07:00
13
13
  default_executable: ext
14
14
  dependencies: []
15
15
 
@@ -25,11 +25,15 @@ files:
25
25
  - Rakefile
26
26
  - README
27
27
  - MIT_LICENSE.txt
28
- - lib/ext/string.rb
29
- - lib/ext/symbol.rb
28
+ - lib/extensions/string.rb
29
+ - lib/extensions/symbol.rb
30
30
  - lib/externals/command.rb
31
31
  - lib/externals/configuration/configuration.rb
32
+ - lib/externals/configuration/old_configuration.rb
32
33
  - lib/externals/ext.rb
34
+ - lib/externals/old_project.rb
35
+ - lib/externals/old_scms/old_git_project.rb
36
+ - lib/externals/old_scms/old_svn_project.rb
33
37
  - lib/externals/project.rb
34
38
  - lib/externals/project_types/rails.rb
35
39
  - lib/externals/scms/git_project.rb
@@ -69,3 +73,4 @@ test_files:
69
73
  - test/test_rails_detection.rb
70
74
  - test/test_string_extensions.rb
71
75
  - test/test_touch_emptydirs.rb
76
+ - test/test_upgrade_externals_file.rb