Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use gemfile per each rails version

  • Loading branch information...
commit b2df15d2f3ab37d9cf8a994b29b2adb0fa3ca220 1 parent de41ff2
@mlomnicki mlomnicki authored
View
1  .gitignore
@@ -23,3 +23,4 @@ pkg
*.log
*.sqlite3
Gemfile.lock
+gemfiles/*.lock
View
4 Gemfile
@@ -1,3 +1,7 @@
source "http://rubygems.org"
gemspec
+
+platforms :ruby_19 do
+ gem "ruby-debug19"
+end
View
5 Rakefile
@@ -30,10 +30,11 @@ Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end
+POSTGRES_DB_USER = ENV.fetch('POSTGRES_DB_USER', 'postgres')
namespace :postgresql do
desc 'Build the PostgreSQL test databases'
task :build_databases do
- %x( createdb -E UTF8 schema_plus_unittest )
+ %x( createdb -U #{POSTGRES_DB_USER} -E UTF8 schema_plus_unittest )
end
desc 'Drop the PostgreSQL test databases'
@@ -49,7 +50,7 @@ task :build_postgresql_databases => 'postgresql:build_databases'
task :drop_postgresql_databases => 'postgresql:drop_databases'
task :rebuild_postgresql_databases => 'postgresql:rebuild_databases'
-MYSQL_DB_USER = 'schema_plus'
+MYSQL_DB_USER = ENV.fetch('MYSQL_DB_USER', 'schema_plus')
namespace :mysql do
desc 'Build the MySQL test databases'
task :build_databases do
View
6 gemfiles/Gemfile.rails-2.3
@@ -0,0 +1,6 @@
+source "http://rubygems.org"
+
+puts __FILE__
+gemspec :path => File.expand_path('../..', __FILE__)
+gem "rails", "~> 2.3"
+gem "mysql2", "~> 0.2.7"
View
5 gemfiles/Gemfile.rails-3.0
@@ -0,0 +1,5 @@
+source "http://rubygems.org"
+
+gemspec :path => File.expand_path('../..', __FILE__)
+gem "rails", "~> 3.0.0"
+gem "mysql2", "~> 0.2.7"
View
5 gemfiles/Gemfile.rails-3.1
@@ -0,0 +1,5 @@
+source "http://rubygems.org"
+
+gemspec :path => File.expand_path('../..', __FILE__)
+gem "rails", "~> 3.1.0.rc5"
+gem "mysql2"
View
14 runspecs
@@ -42,22 +42,20 @@ OptionParser.new do |opts|
end.parse!
cmds = if o.install
- ['bundle update']
+ "bundle install"
else
- ['bundle update --local rails mysql2 | egrep "rails|mysql2"', o.run_cmd]
+ "bundle exec #{o.run_cmd}"
end
n = 1
+GEMFILES_DIR = File.expand_path('../gemfiles', __FILE__)
total = o.ruby_versions.size * o.rails_versions.size
o.ruby_versions.each do |ruby|
o.rails_versions.each do |rails|
puts "\n\n*** ruby version #{ruby} - rails version #{rails} [#{n} of #{total}]\n\n"
+ gemfile = File.join(GEMFILES_DIR, "Gemfile.rails-#{rails}")
n += 1
- allcmds = []
- allcmds << "rvm use #{ruby}"
- allcmds << "export #{PROJECT.upcase}_RAILS_VERSION=#{rails}"
- allcmds += cmds
- allcmds << 'exit'
- system %Q{echo '#{allcmds.join(' \n ')}' | bash -i} or abort "aborting #{$0}"
+ allcmds = %Q{rvm use #{ruby} BUNDLE_GEMFILE="#{gemfile}" #{cmds}}
+ system(cmds)
end
end
View
15 schema_plus.gemspec
@@ -22,20 +22,6 @@ Gem::Specification.new do |s|
s.add_dependency("rails")
s.add_dependency("valuable")
-
- case ENV['SCHEMA_PLUS_RAILS_VERSION']
- when '2.3'
- s.add_development_dependency("rails", "~> 2.3")
- s.add_development_dependency("mysql2", "~> 0.2.6")
- when '3.0'
- s.add_development_dependency("rails", "~> 3.0")
- s.add_development_dependency("mysql2", "~> 0.2.6")
- when '3.1'
- s.add_development_dependency("rails", ">= 3.1.0.rc1")
- s.add_development_dependency("mysql2")
- else
- s.add_development_dependency("mysql2")
- end
s.add_development_dependency("rake", "~> 0.8.7")
s.add_development_dependency("rspec")
@@ -44,6 +30,5 @@ Gem::Specification.new do |s|
s.add_development_dependency("sqlite3")
s.add_development_dependency("simplecov")
s.add_development_dependency("simplecov-gem-adapter")
- s.add_development_dependency("ruby-debug19") if RUBY_VERSION >= "1.9.2"
end
Please sign in to comment.
Something went wrong with that request. Please try again.