summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVít Ondruch <vondruch@redhat.com>2012-07-19 13:43:19 +0200
committerVít Ondruch <vondruch@redhat.com>2012-07-19 13:43:19 +0200
commit4769679a503306f6ed513f629081630ae5676dec (patch)
treef45e6a3b44f1e4d9bb1c3cabb6d21311ca00e097
parentebfbb96ffffaa1d25d32a670722d8032d11e5a66 (diff)
downloadrubygem-activerecord-4769679a503306f6ed513f629081630ae5676dec.tar.gz
rubygem-activerecord-4769679a503306f6ed513f629081630ae5676dec.tar.xz
rubygem-activerecord-4769679a503306f6ed513f629081630ae5676dec.zip
Update to ActiveRecord 3.2.6.
-rw-r--r--.gitignore2
-rw-r--r--Rakefile201
-rw-r--r--activerecord-downgrade-dependencies.patch24
-rw-r--r--activerecord-rakefile-fix.patch15
-rw-r--r--rubygem-activerecord.spec131
-rw-r--r--sources4
6 files changed, 51 insertions, 326 deletions
diff --git a/.gitignore b/.gitignore
index 8614831..6a35a38 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,5 @@ activerecord-2.3.8.gem
/activerecord-3.0.13.gem
/activerecord-3.0.15-tests.tgz
/activerecord-3.0.15.gem
+/activerecord-3.2.6-tests.tgz
+/activerecord-3.2.6.gem
diff --git a/Rakefile b/Rakefile
deleted file mode 100644
index c2d63cd..0000000
--- a/Rakefile
+++ /dev/null
@@ -1,201 +0,0 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/packagetask'
-require 'rake/gempackagetask'
-
-require File.expand_path(File.dirname(__FILE__)) + "/test/config"
-
-MYSQL_DB_USER = 'rails'
-
-def run_without_aborting(*tasks)
- errors = []
-
- tasks.each do |task|
- begin
- Rake::Task[task].invoke
- rescue Exception
- errors << task
- end
- end
-
- abort "Errors running #{errors.join(', ')}" if errors.any?
-end
-
-desc 'Run mysql, mysql2, sqlite, and postgresql tests by default'
-task :default => :test
-
-desc 'Run mysql, mysql2, sqlite, and postgresql tests'
-task :test do
- tasks = defined?(JRUBY_VERSION) ?
- %w(test_jdbcmysql test_jdbcsqlite3 test_jdbcpostgresql) :
- %w(test_mysql test_mysql2 test_sqlite3 test_postgresql)
- run_without_aborting(*tasks)
-end
-
-namespace :test do
- task :isolated do
- tasks = defined?(JRUBY_VERSION) ?
- %w(isolated_test_jdbcmysql isolated_test_jdbcsqlite3 isolated_test_jdbcpostgresql) :
- %w(isolated_test_mysql isolated_test_mysql2 isolated_test_sqlite3 isolated_test_postgresql)
- run_without_aborting(*tasks)
- end
-end
-
-%w( mysql mysql2 postgresql sqlite3 firebird db2 oracle sybase openbase frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb ).each do |adapter|
- Rake::TestTask.new("test_#{adapter}") { |t|
- connection_path = "test/connections/#{adapter =~ /jdbc/ ? 'jdbc' : 'native'}_#{adapter}"
- adapter_short = adapter == 'db2' ? adapter : adapter[/^[a-z0-9]+/]
- t.libs << "test" << connection_path
- t.test_files = (Dir.glob( "test/cases/**/*_test.rb" ).reject {
- |x| x =~ /\/adapters\//
- } + Dir.glob("test/cases/adapters/#{adapter_short}/**/*_test.rb")).sort
-
- t.verbose = true
- t.warning = true
- }
-
- task "isolated_test_#{adapter}" do
- connection_path = "test/connections/#{adapter =~ /jdbc/ ? 'jdbc' : 'native'}_#{adapter}"
- adapter_short = adapter == 'db2' ? adapter : adapter[/^[a-z0-9]+/]
- puts [adapter, adapter_short, connection_path].inspect
- ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
- (Dir["test/cases/**/*_test.rb"].reject {
- |x| x =~ /\/adapters\//
- } + Dir["test/cases/adapters/#{adapter_short}/**/*_test.rb"]).all? do |file|
- system(ruby, "-Ilib:test:#{connection_path}", file)
- end or raise "Failures"
- end
-
- namespace adapter do
- task :test => "test_#{adapter}"
- task :isolated_test => "isolated_test_#{adapter}"
- end
-end
-
-namespace :mysql do
- desc 'Build the MySQL test databases'
- task :build_databases do
- %x( echo "create DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci " | mysql --user=#{MYSQL_DB_USER})
- %x( echo "create DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci " | mysql --user=#{MYSQL_DB_USER})
- end
-
- desc 'Drop the MySQL test databases'
- task :drop_databases do
- %x( mysqladmin --user=#{MYSQL_DB_USER} -f drop activerecord_unittest )
- %x( mysqladmin --user=#{MYSQL_DB_USER} -f drop activerecord_unittest2 )
- end
-
- desc 'Rebuild the MySQL test databases'
- task :rebuild_databases => [:drop_databases, :build_databases]
-end
-
-task :build_mysql_databases => 'mysql:build_databases'
-task :drop_mysql_databases => 'mysql:drop_databases'
-task :rebuild_mysql_databases => 'mysql:rebuild_databases'
-
-
-namespace :postgresql do
- desc 'Build the PostgreSQL test databases'
- task :build_databases do
- %x( createdb -E UTF8 activerecord_unittest )
- %x( createdb -E UTF8 activerecord_unittest2 )
- end
-
- desc 'Drop the PostgreSQL test databases'
- task :drop_databases do
- %x( dropdb activerecord_unittest )
- %x( dropdb activerecord_unittest2 )
- end
-
- desc 'Rebuild the PostgreSQL test databases'
- task :rebuild_databases => [:drop_databases, :build_databases]
-end
-
-task :build_postgresql_databases => 'postgresql:build_databases'
-task :drop_postgresql_databases => 'postgresql:drop_databases'
-task :rebuild_postgresql_databases => 'postgresql:rebuild_databases'
-
-
-namespace :frontbase do
- desc 'Build the FrontBase test databases'
- task :build_databases => :rebuild_frontbase_databases
-
- desc 'Rebuild the FrontBase test databases'
- task :rebuild_databases do
- build_frontbase_database = Proc.new do |db_name, sql_definition_file|
- %(
- STOP DATABASE #{db_name};
- DELETE DATABASE #{db_name};
- CREATE DATABASE #{db_name};
-
- CONNECT TO #{db_name} AS SESSION_NAME USER _SYSTEM;
- SET COMMIT FALSE;
-
- CREATE USER RAILS;
- CREATE SCHEMA RAILS AUTHORIZATION RAILS;
- COMMIT;
-
- SET SESSION AUTHORIZATION RAILS;
- SCRIPT '#{sql_definition_file}';
-
- COMMIT;
-
- DISCONNECT ALL;
- )
- end
- create_activerecord_unittest = build_frontbase_database['activerecord_unittest', File.join(SCHEMA_ROOT, 'frontbase.sql')]
- create_activerecord_unittest2 = build_frontbase_database['activerecord_unittest2', File.join(SCHEMA_ROOT, 'frontbase2.sql')]
- execute_frontbase_sql = Proc.new do |sql|
- system(<<-SHELL)
- /Library/FrontBase/bin/sql92 <<-SQL
- #{sql}
- SQL
- SHELL
- end
- execute_frontbase_sql[create_activerecord_unittest]
- execute_frontbase_sql[create_activerecord_unittest2]
- end
-end
-
-task :build_frontbase_databases => 'frontbase:build_databases'
-task :rebuild_frontbase_databases => 'frontbase:rebuild_databases'
-
-spec = eval(File.read('activerecord.gemspec'))
-
-Rake::GemPackageTask.new(spec) do |p|
- p.gem_spec = spec
-end
-
-task :lines do
- lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
-
- for file_name in FileList["lib/active_record/**/*.rb"]
- next if file_name =~ /vendor/
- f = File.open(file_name)
-
- while line = f.gets
- lines += 1
- next if line =~ /^\s*$/
- next if line =~ /^\s*#/
- codelines += 1
- end
- puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"
-
- total_lines += lines
- total_codelines += codelines
-
- lines, codelines = 0, 0
- end
-
- puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
-end
-
-
-# Publishing ------------------------------------------------------
-
-desc "Release to gemcutter"
-task :release => :package do
- require 'rake/gemcutter'
- Rake::Gemcutter::Tasks.new(spec).define
- Rake::Task['gem:push'].invoke
-end
diff --git a/activerecord-downgrade-dependencies.patch b/activerecord-downgrade-dependencies.patch
deleted file mode 100644
index c56e732..0000000
--- a/activerecord-downgrade-dependencies.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- specifications/activerecord-3.0.15.gemspec.orig
-+++ specifications/activerecord-3.0.15.gemspec
-@@ -25,18 +25,18 @@
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<activesupport>, ["= 3.0.15"])
- s.add_runtime_dependency(%q<activemodel>, ["= 3.0.15"])
-- s.add_runtime_dependency(%q<arel>, ["~> 2.0.10"])
-+ s.add_runtime_dependency(%q<arel>, ["~> 2.0.9"])
- s.add_runtime_dependency(%q<tzinfo>, ["~> 0.3.23"])
- else
- s.add_dependency(%q<activesupport>, ["= 3.0.15"])
- s.add_dependency(%q<activemodel>, ["= 3.0.15"])
-- s.add_dependency(%q<arel>, ["~> 2.0.10"])
-+ s.add_dependency(%q<arel>, ["~> 2.0.9"])
- s.add_dependency(%q<tzinfo>, ["~> 0.3.23"])
- end
- else
- s.add_dependency(%q<activesupport>, ["= 3.0.15"])
- s.add_dependency(%q<activemodel>, ["= 3.0.15"])
-- s.add_dependency(%q<arel>, ["~> 2.0.10"])
-+ s.add_dependency(%q<arel>, ["~> 2.0.9"])
- s.add_dependency(%q<tzinfo>, ["~> 0.3.23"])
- end
- end
diff --git a/activerecord-rakefile-fix.patch b/activerecord-rakefile-fix.patch
deleted file mode 100644
index a74481b..0000000
--- a/activerecord-rakefile-fix.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- Rakefile.orig 2011-01-10 20:41:24.492457355 -0500
-+++ Rakefile 2011-01-10 20:41:27.112458000 -0500
-@@ -160,12 +160,6 @@ end
- task :build_frontbase_databases => 'frontbase:build_databases'
- task :rebuild_frontbase_databases => 'frontbase:rebuild_databases'
-
--spec = eval(File.read('activerecord.gemspec'))
--
--Rake::GemPackageTask.new(spec) do |p|
-- p.gem_spec = spec
--end
--
- task :lines do
- lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
-
diff --git a/rubygem-activerecord.spec b/rubygem-activerecord.spec
index 7e6649b..a467c0c 100644
--- a/rubygem-activerecord.spec
+++ b/rubygem-activerecord.spec
@@ -1,50 +1,34 @@
# Generated from activerecord-1.15.5.gem by gem2rpm -*- rpm-spec -*-
%global gem_name activerecord
-
%global rubyabi 1.9.1
Summary: Implements the ActiveRecord pattern for ORM
Name: rubygem-%{gem_name}
Epoch: 1
-Version: 3.0.15
+Version: 3.2.6
Release: 1%{?dist}
Group: Development/Languages
License: MIT
URL: http://www.rubyonrails.org
Source0: http://rubygems.org/downloads/activerecord-%{version}.gem
-
-# The activerecord gem doesn't ship with the upstream Rakefile
-Source1: http://github.com/rails/rails/raw/v%{version}/%{gem_name}/Rakefile
-
-# Also the activerecord gem doesn't ship with the test suite.
-# You may check it out like so
# git clone http://github.com/rails/rails.git
# cd rails/activerecord/
-# git checkout v3.0.15
-# tar czvf activerecord-3.0.15-tests.tgz test/
-Source2: activerecord-%{version}-tests.tgz
-
-# Remove a task which breaks the Rakefile due to the gemspec
-# not being present in the gem
-Patch0: activerecord-rakefile-fix.patch
-
-Patch2: activerecord-downgrade-dependencies.patch
-
+# git checkout v3.2.6
+# tar czvf activerecord-3.2.6-tests.tgz test/
+Source1: activerecord-%{version}-tests.tgz
Requires: ruby(abi) = %{rubyabi}
Requires: ruby(rubygems)
Requires: rubygem(activesupport) = %{version}
Requires: rubygem(activemodel) = %{version}
Requires: rubygem(arel)
Requires: rubygem(tzinfo) >= 0.3.23
-Requires: rubygem(i18n)
BuildRequires: rubygems-devel
-BuildRequires: rubygem(rake)
+BuildRequires: rubygem(bcrypt-ruby)
BuildRequires: rubygem(activesupport) = %{version}
BuildRequires: rubygem(activemodel) = %{version}
BuildRequires: rubygem(sqlite3)
BuildRequires: rubygem(erubis)
BuildRequires: rubygem(mocha)
-BuildRequires: rubygem(i18n)
BuildRequires: rubygem(arel)
BuildRequires: rubygem(tzinfo) >= 0.3.23
BuildRequires: rubygem(minitest)
@@ -57,96 +41,75 @@ tables and classes together for business objects, like Customer or
Subscription, that can find, save, and destroy themselves without resorting to
manual SQL.
-%prep
-%setup -q -c -T
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
-# rake test creates debug.log under %%{gem_instdir},
-# so let's install gem file under %%{_builddir} first
+%description doc
+Documentation for %{name}
-mkdir -p ./%{gem_dir}
-gem install --local --install-dir ./%{gem_dir} \
+%prep
+%setup -q -c -T
+mkdir -p .%{gem_dir}
+gem install --local --install-dir .%{gem_dir} \
--force --rdoc %{SOURCE0}
-# move the Rakefile in place
-cp %{SOURCE1} .%{gem_instdir}
-
-# move the tests into place
-tar xzvf %{SOURCE2} -C .%{gem_instdir}
-
-pushd ./%{gem_instdir}
-%patch0 -p0
-popd
-
-pushd .%{gem_dir}
-%patch2 -p0
-popd
-
-# Remove backup files
-find ./%{gem_instdir} -type f -name "*~" -delete
-
-# Delete zero-length files
-# No! These are needed for rake test
-# find ./%{gem_instdir} -type f -size 0c -exec rm -rvf {} \;
-
-# Fix anything executable that does not have a shebang
-for file in `find ./%{gem_instdir} -type f -perm /a+x`; do
- [ -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 644 $file
-done
-
-# Find files with a shebang that do not have executable permissions
-for file in `find ./%{gem_instdir} -type f ! -perm /a+x -name "*.rb"`; do
- [ ! -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 755 $file
-done
-
-# this file is being marked as a doc, need to remove ruby executable path
-# and mark as non-executable
-sed -i -e 's/^#!\/usr\/bin\/env ruby//' ./%{gem_instdir}/examples/performance.rb
-chmod 0644 ./%{gem_instdir}/examples/performance.rb
-
%build
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}
-%clean
-rm -rf %{buildroot}
-
%check
pushd .%{gem_instdir}
+tar xzvf %{SOURCE1}
+
# load_path is not available, remove its require.
sed -i '1,2d' test/cases/helper.rb
-# Test fails with newer mocha. Keep with older one is not solution.
-# https://github.com/rails/rails/pull/6046
-# https://github.com/rails/rails/commit/2aa7c6d065802cd230a812b8331ee293e4aae0e8
-sed -i '592,597 s|^|#|' test/cases/autosave_association_test.rb
-sed -i '637,642 s|^|#|' test/cases/autosave_association_test.rb
-sed -i '702,710 s|^|#|' test/cases/autosave_association_test.rb
+ruby -I.:test:lib << EOF
+ require "test/config"
+ require "test/support/config"
-# to prevent a circular dependency w/ actionpack
-mv test/cases/session_store/session_test.rb \
- test/cases/session_store/session_test.rb.norun
+ test_files = Dir.glob( "test/cases/**/*_test.rb" )
+ test_files.reject! { |x| x =~ %r|/adapters/| }
+
+ # Only test sqlite3 backend
+ test_files += Dir.glob("test/cases/adapters/sqlite3/*_test.rb")
+
+ # To prevent a circular dependency w/ actionpack.
+ test_files.delete('test/cases/session_store/session_test.rb')
+
+ # Test dependes on mysql adapter
+ # https://github.com/rails/rails/issues/7103
+ test_files.delete('test/cases/connection_specification/resolver_test.rb')
+
+ test_files.each { |f| require f }
+EOF
-# Only test sqlite3 backend
-rake test_sqlite3 --trace
popd
%files
%dir %{gem_instdir}
-%doc %{gem_instdir}/CHANGELOG
-%doc %{gem_instdir}/examples
%{gem_libdir}
-%{gem_instdir}/Rakefile
-%doc %{gem_instdir}/README.rdoc
-%{gem_instdir}/test
-
-%doc %{gem_docdir}
+%doc %{gem_instdir}/MIT-LICENSE
%exclude %{gem_cache}
%{gem_spec}
+%files doc
+%doc %{gem_docdir}
+%doc %{gem_instdir}/CHANGELOG.md
+%doc %{gem_instdir}/README.rdoc
+%doc %{gem_instdir}/examples
+
+
%changelog
+* Thu Jul 19 2012 Vít Ondruch <vondruch@redhat.com> - 1:3.2.6-1
+- Update to ActiveRecord 3.2.6.
+
* Fri Jun 15 2012 Vít Ondruch <vondruch@redhat.com> - 1:3.0.15-1
- Update to ActiveRecord 3.0.15.
diff --git a/sources b/sources
index cd7f9d3..bc2b6f2 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-541f289b4e6c0502e13782f9552a5d99 activerecord-3.0.15-tests.tgz
-d5ca4d34b412b42139ec3ca00420ed48 activerecord-3.0.15.gem
+d9c840441f9ece344e81f1229b5fc976 activerecord-3.2.6-tests.tgz
+00c29000e63fc7790198488c8550b742 activerecord-3.2.6.gem