ext 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ February 17, 2011 Version 1.8 released
2
+ - Fixes a compatibility issue with jruby (thanks to Patrik Sundberg)
3
+ - Fixes some issues with recognizing rails 3 projects and testing with
4
+ rails 3 installed
5
+
1
6
  1/3/2010 Version 1.6 released
2
7
  - Fixes a problem that can occur if ext is symlinked (thanks to Olmo Maldonado)
3
8
  - Added --version command line option
data/Rakefile CHANGED
@@ -6,6 +6,8 @@ require 'find'
6
6
 
7
7
  root_dir = File.dirname(__FILE__)
8
8
 
9
+ $LOAD_PATH << File.join(root_dir, 'lib')
10
+
9
11
  require File.join(root_dir, 'lib', 'externals', 'ext')
10
12
 
11
13
  desc "Creates the starting repositories needed to run the tests.
@@ -4,13 +4,13 @@ require 'externals/configuration/configuration'
4
4
  require 'externals/configuration/old_configuration'
5
5
  require 'optparse'
6
6
  require 'externals/command'
7
- require 'extensions/symbol'
7
+ require 'externals/extensions/symbol'
8
8
 
9
9
  module Externals
10
10
  #exit status
11
11
  OBSOLETE_EXTERNALS_FILE = 15
12
12
 
13
- VERSION = '0.1.7'
13
+ VERSION = '0.1.8'
14
14
  PROJECT_TYPES_DIRECTORY = File.join(File.dirname(__FILE__), '..', 'externals','project_types')
15
15
 
16
16
  # Full commands operate on the main project as well as the externals
@@ -84,8 +84,8 @@ module Externals
84
84
 
85
85
 
86
86
  class Ext
87
- Dir.entries(File.join(File.dirname(__FILE__), '..', 'extensions')).each do |extension|
88
- require "extensions/#{extension}" if extension =~ /.rb$/
87
+ Dir.entries(File.join(File.dirname(__FILE__), 'extensions')).each do |extension|
88
+ require "externals/extensions/#{extension}" if extension =~ /.rb$/
89
89
  end
90
90
 
91
91
  Dir.entries(File.join(File.dirname(__FILE__), '..', 'externals','scms')).each do |project|
@@ -198,7 +198,7 @@ module Externals
198
198
  end
199
199
  end
200
200
 
201
- new(main_options).send(command, args, sub_options)
201
+ self.new(main_options).send(command, args, sub_options)
202
202
  end
203
203
  end
204
204
 
@@ -1,4 +1,4 @@
1
- require 'extensions/symbol'
1
+ require 'externals/extensions/symbol'
2
2
 
3
3
  module Externals
4
4
  VALID_ATTRIB = [:name, :path, :repository, :branch, :type, :scm, :revision
@@ -29,10 +29,17 @@ module Externals
29
29
 
30
30
  class RailsDetector
31
31
  def self.detected?
32
- boot_path = File.join('config','boot.rb')
33
- if File.exists? boot_path
34
- open(boot_path) do |f|
35
- f.read =~ /^\s*module\s+Rails/
32
+ application_path = File.join('config', 'application.rb')
33
+ if File.exists? application_path
34
+ open(application_path) do |f|
35
+ f.read =~ /^\s*module\s+RailsApp/
36
+ end
37
+ else
38
+ boot_path = File.join('config', 'boot.rb')
39
+ if File.exists? boot_path
40
+ open(boot_path) do |f|
41
+ f.read =~ /^\s*module\s+Rails/
42
+ end
36
43
  end
37
44
  end
38
45
  end
@@ -99,14 +99,20 @@ module Externals
99
99
  def create_rails_application
100
100
  Dir.mkdir applications_dir unless File.exists?(applications_dir)
101
101
  Dir.chdir applications_dir do
102
- if windows?
103
- puts `ruby C:\\ruby\\bin\\rails rails_app`
104
- else
102
+ if rails_version =~ /^3([^\d]|$)/
103
+ puts `rails new rails_app`
104
+ elsif rails_version =~ /^2([^\d]|$)/
105
105
  puts `rails rails_app`
106
+ else
107
+ raise "can't determine rails version"
106
108
  end
107
109
  end
108
110
  end
109
111
 
112
+ def rails_version
113
+ /[\d\.]+/.match(`rails --version`)[0]
114
+ end
115
+
110
116
  def windows?
111
117
  ENV['OS'] =~ /^Win/i
112
118
  end
@@ -33,6 +33,10 @@ module Externals
33
33
  Ext.run "install", "--svn", 'file:///' + File.join(root_dir, 'test', 'cleanreps', proj)
34
34
  end
35
35
 
36
+ Dir.chdir File.join('vendor', 'plugins', 'foreign_key_migrations') do
37
+ assert `svn info` !~ /^.*:\s*2\s*$/i
38
+ end
39
+
36
40
  Ext.run "freeze", "foreign_key_migrations", "2"
37
41
  Ext.run "freeze", "acts_as_list", "9baff190a52c05cc542bfcaa7f77a91ce669f2f8"
38
42
 
@@ -91,12 +95,12 @@ module Externals
91
95
  end
92
96
 
93
97
  Dir.chdir 'foreign_key_migrations' do
94
- assert `svn info` =~ /^Revision:\s*2\s*$/i
98
+ assert `svn info` =~ /^.*:\s*2\s*$/i
95
99
  end
96
100
  end
97
101
 
98
102
  %w(foreign_key_migrations redhillonrails_core acts_as_list).each do |proj|
99
- assert File.exists?(File.join('vendor', 'plugins',proj, 'lib'))
103
+ assert File.exists?(File.join('vendor', 'plugins', proj, 'lib'))
100
104
  end
101
105
  end
102
106
  end
metadata CHANGED
@@ -1,15 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 8
9
+ version: 0.1.8
5
10
  platform: ruby
6
11
  authors:
7
- - Miles Georgi
12
+ - Miles Georgi
8
13
  autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-01-03 00:00:00 -08:00
17
+ date: 2011-02-17 00:00:00 -08:00
13
18
  default_executable: ext
14
19
  dependencies: []
15
20
 
@@ -43,30 +48,42 @@ description: |-
43
48
  the main project.
44
49
  email: azimux@gmail.com
45
50
  executables:
46
- - ext
51
+ - ext
47
52
  extensions: []
48
53
 
49
54
  extra_rdoc_files: []
50
55
 
51
56
  files:
52
- - Rakefile
53
- - README
54
- - MIT_LICENSE.txt
55
- - CHANGELOG
56
- - lib/extensions/string.rb
57
- - lib/extensions/symbol.rb
58
- - lib/externals/project_types/rails.rb
59
- - lib/externals/old_project.rb
60
- - lib/externals/command.rb
61
- - lib/externals/old_scms/old_git_project.rb
62
- - lib/externals/old_scms/old_svn_project.rb
63
- - lib/externals/project.rb
64
- - lib/externals/configuration/configuration.rb
65
- - lib/externals/configuration/old_configuration.rb
66
- - lib/externals/test_case.rb
67
- - lib/externals/scms/git_project.rb
68
- - lib/externals/scms/svn_project.rb
69
- - lib/externals/ext.rb
57
+ - Rakefile
58
+ - README
59
+ - MIT_LICENSE.txt
60
+ - CHANGELOG
61
+ - lib/externals/old_project.rb
62
+ - lib/externals/command.rb
63
+ - lib/externals/project.rb
64
+ - lib/externals/test_case.rb
65
+ - lib/externals/ext.rb
66
+ - lib/externals/project_types/rails.rb
67
+ - lib/externals/old_scms/old_git_project.rb
68
+ - lib/externals/old_scms/old_svn_project.rb
69
+ - lib/externals/extensions/string.rb
70
+ - lib/externals/extensions/symbol.rb
71
+ - lib/externals/configuration/configuration.rb
72
+ - lib/externals/configuration/old_configuration.rb
73
+ - lib/externals/scms/git_project.rb
74
+ - lib/externals/scms/svn_project.rb
75
+ - test/test_rails_detection.rb
76
+ - test/test_string_extensions.rb
77
+ - test/test_git_project_extract_name.rb
78
+ - test/test_version.rb
79
+ - test/test_init_git.rb
80
+ - test/test_upgrade_externals_file.rb
81
+ - test/test_checkout_git.rb
82
+ - test/test_checkout_with_subprojects_svn.rb
83
+ - test/test_freeze_to_revision.rb
84
+ - test/test_checkout_with_subprojects_git.rb
85
+ - test/test_touch_emptydirs.rb
86
+ - bin/ext
70
87
  has_rdoc: true
71
88
  homepage: http://nopugs.com/ext-tutorial
72
89
  licenses: []
@@ -75,35 +92,39 @@ post_install_message:
75
92
  rdoc_options: []
76
93
 
77
94
  require_paths:
78
- - lib
95
+ - lib
79
96
  required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
80
98
  requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: "0"
84
- version:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ segments:
102
+ - 0
103
+ version: "0"
85
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
+ none: false
86
106
  requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: "0"
90
- version:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ segments:
110
+ - 0
111
+ version: "0"
91
112
  requirements: []
92
113
 
93
114
  rubyforge_project: ext
94
- rubygems_version: 1.3.5
115
+ rubygems_version: 1.3.7
95
116
  signing_key:
96
117
  specification_version: 3
97
118
  summary: Provides an SCM agnostic way to manage subprojects with a workflow similar to the svn:externals feature of subversion. It's particularly useful for rails projects that have some plugins managed by svn and some managed by git.
98
119
  test_files:
99
- - test/test_rails_detection.rb
100
- - test/test_string_extensions.rb
101
- - test/test_git_project_extract_name.rb
102
- - test/test_version.rb
103
- - test/test_init_git.rb
104
- - test/test_upgrade_externals_file.rb
105
- - test/test_checkout_git.rb
106
- - test/test_checkout_with_subprojects_svn.rb
107
- - test/test_freeze_to_revision.rb
108
- - test/test_checkout_with_subprojects_git.rb
109
- - test/test_touch_emptydirs.rb
120
+ - test/test_rails_detection.rb
121
+ - test/test_string_extensions.rb
122
+ - test/test_git_project_extract_name.rb
123
+ - test/test_version.rb
124
+ - test/test_init_git.rb
125
+ - test/test_upgrade_externals_file.rb
126
+ - test/test_checkout_git.rb
127
+ - test/test_checkout_with_subprojects_svn.rb
128
+ - test/test_freeze_to_revision.rb
129
+ - test/test_checkout_with_subprojects_git.rb
130
+ - test/test_touch_emptydirs.rb