ext 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ end
11
11
 
12
12
  gem_specification = Gem::Specification.new do |specification|
13
13
  specification.name = 'ext'
14
- specification.version = '0.0.9'
14
+ specification.version = '0.0.10'
15
15
  specification.platform = Gem::Platform::RUBY
16
16
  specification.rubyforge_project = 'ext'
17
17
 
data/lib/externals/ext.rb CHANGED
@@ -292,6 +292,13 @@ Please use
292
292
  scm = options[:scm]
293
293
 
294
294
  scm ||= infer_scm(row)
295
+
296
+ unless scm
297
+ raise "Unable to determine SCM from the repository name.
298
+ You need to either specify the scm used to manage the subproject
299
+ that you are installing. Use an option to specify it
300
+ (such as --git or --svn)"
301
+ end
295
302
 
296
303
  if !configuration[scm]
297
304
  configuration.add_empty_section(scm)
@@ -41,12 +41,12 @@ module Externals
41
41
  end
42
42
  end
43
43
  end
44
-
44
+
45
45
  def destroy_test_repository scm
46
46
  puts(rmcmd = "rm -rf #{repository_dir(scm)}")
47
47
  puts `#{rmcmd}`
48
48
  end
49
-
49
+
50
50
  def repository_dir scm = nil
51
51
  if scm.nil?
52
52
  File.join(File.dirname(__FILE__), '..', '..', 'test', 'repositories')
@@ -54,6 +54,45 @@ module Externals
54
54
  File.expand_path(File.join(repository_dir, "#{scm}repo"))
55
55
  end
56
56
  end
57
+
58
+ def create_test_modules_repository scm
59
+ Dir.chdir(File.join(File.dirname(__FILE__), '..', '..', 'test')) do
60
+ `mkdir repositories` unless File.exists? 'repositories'
61
+ Dir.chdir 'repositories' do
62
+ puts `svnadmin create #{scm}modulesrepo`
63
+ end
64
+
65
+ cmd = "svn checkout \"file:///#{File.expand_path(File.join('repositories', "#{scm}modulesrepo"))}\""
66
+ puts "about to run #{cmd}"
67
+ puts `#{cmd}`
68
+ Dir.chdir "#{scm}modulesrepo" do
69
+ if !File.exists? 'modules.txt'
70
+ open("modules.txt", "w") do |f|
71
+ f.write "line1 of modules.txt\n"
72
+ end
73
+
74
+ SvnProject.add_all
75
+ puts `svn commit -m "created modules.txt"`
76
+ end
77
+ end
78
+ `rm -rf #{scm}modulesrepo`
79
+ end
80
+ end
81
+
82
+ def destroy_test_modules_repository scm
83
+ puts(rmcmd = "rm -rf #{modules_repository_dir(scm)}")
84
+ puts `#{rmcmd}`
85
+ puts(rmcmd = "rm -rf #{modules_repository_dir(scm)}")
86
+ puts `#{rmcmd}`
87
+ end
88
+
89
+ def modules_repository_dir scm = nil
90
+ if scm.nil?
91
+ File.join(File.dirname(__FILE__), '..', '..', 'test', 'repositories')
92
+ else
93
+ File.expand_path(File.join(repository_dir, "#{scm}modulesrepo"))
94
+ end
95
+ end
57
96
 
58
97
 
59
98
  def create_rails_application
@@ -9,6 +9,8 @@ module Externals
9
9
  create_rails_application
10
10
  destroy_test_repository 'svn'
11
11
  initialize_test_svn_repository
12
+ destroy_test_modules_repository 'svn'
13
+ create_test_modules_repository 'svn'
12
14
 
13
15
  Dir.chdir File.join(root_dir, 'test') do
14
16
  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('/')
@@ -40,7 +42,13 @@ module Externals
40
42
  %w(foreign_key_migrations redhillonrails_core).each do |proj|
41
43
  Ext.run "install", "svn://rubyforge.org/var/svn/redhillonrails/trunk/vendor/plugins/#{proj}"
42
44
  end
43
-
45
+
46
+ #install project with a branch
47
+ Ext.run "install", "git://github.com/azimux/engines.git:edge"
48
+
49
+ #install project with a non-default path
50
+ Ext.run "install", "--svn", "file:///#{modules_repository_dir('svn')}", "modules"
51
+
44
52
  SvnProject.add_all
45
53
 
46
54
  puts `svn commit -m "created empty rails app with some subprojects"`
@@ -89,11 +97,20 @@ module Externals
89
97
  assert `git show 92f944818eece9fe4bc62ffb39accdb71ebc32be` =~ /azimux/
90
98
  end
91
99
 
92
- %w(foreign_key_migrations redhillonrails_core acts_as_list).each do |proj|
93
- assert File.exists?(File.join('vendor', 'plugins',proj, 'lib'))
100
+ %w(foreign_key_migrations redhillonrails_core acts_as_list engines).each do |proj|
101
+ assert File.exists?(File.join('vendor', 'plugins', proj, 'lib'))
94
102
  end
95
103
 
96
104
  assert File.exists?(File.join('vendor', 'rails', 'activerecord', 'lib'))
105
+
106
+ assert File.exists?(File.join('modules', 'modules.txt'))
107
+
108
+ assert File.read(File.join('modules', 'modules.txt')) =~ /line1 of/
109
+
110
+ Dir.chdir File.join('vendor','plugins','engines') do
111
+ assert(`git branch -a` =~ /^\*\s*edge\s*$/)
112
+ assert(`git branch -a` !~ /^\*\s*master\s*$/)
113
+ end
97
114
  end
98
115
  end
99
116
  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.9
4
+ version: 0.0.10
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-06 00:00:00 -07:00
12
+ date: 2008-09-10 00:00:00 -07:00
13
13
  default_executable: ext
14
14
  dependencies: []
15
15