1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 USE_RUBY="ruby20 ruby21"
8 # this is not null so that the dependencies will actually be filled
9 RUBY_FAKEGEM_TASK_TEST="test"
11 RUBY_FAKEGEM_TASK_DOC=""
12 RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.rdoc"
14 RUBY_FAKEGEM_GEMSPEC="activerecord.gemspec"
16 inherit ruby-fakegem versionator
18 DESCRIPTION="Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM"
19 HOMEPAGE="http://rubyforge.org/projects/activerecord/"
20 SRC_URI="https://github.com/rails/rails/archive/v${PV}.tar.gz -> rails-${PV}.tgz"
23 SLOT="$(get_version_component_range 1-2)"
24 KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
25 IUSE="mysql postgres sqlite"
27 RUBY_S="rails-${PV}/${PN}"
29 ruby_add_rdepend "~dev-ruby/activesupport-${PV}
30 ~dev-ruby/activemodel-${PV}
31 >=dev-ruby/arel-5.0.0:5.0
32 sqlite? ( >=dev-ruby/sqlite3-1.3.6 )
33 mysql? ( >=dev-ruby/mysql2-0.3.13:0.3 )
34 postgres? ( >=dev-ruby/pg-0.11.0 )"
39 ~dev-ruby/actionpack-${PV}
40 >=dev-ruby/sqlite3-1.3.5
42 <dev-ruby/minitest-5.3.4:5
46 # Remove items from the common Gemfile that we don't need for this
47 # test run. This also requires handling some gemspecs.
48 rm ../Gemfile.lock || die
49 sed -i -e "/\(uglifier\|system_timer\|sdoc\|w3c_validators\|pg\|jquery-rails\|'mysql'\|journey\|ruby-prof\|benchmark-ips\|kindlerb\|turbolinks\|coffee-rails\|debugger\|redcarpet\|minitest\|sprockets\|stackprof\)/ s:^:#:" \
50 -e '/group :doc/,/^end/ s:^:#:' ../Gemfile || die
51 sed -i -e '/rack-ssl/d' -e 's/~> 3.4/>= 3.4/' ../railties/railties.gemspec || die
52 sed -i -e '/mail/d' ../actionmailer/actionmailer.gemspec || die
54 sed -i -e '/bcrypt/ s/3.0.0/3.0/' ../Gemfile || die
56 # Add back json in the Gemfile because we dropped some dependencies
57 # earlier that implicitly required it.
58 sed -i -e '$agem "json"' ../Gemfile || die
60 # Avoid test depending on mysql adapter which we don't support for
61 # this Rails version to simplify our dependencies.
62 rm test/cases/connection_specification/resolver_test.rb || die
64 # Avoid single test using mysql dependencies.
65 rm test/cases/invalid_connection_test.rb || die
70 ${RUBY} -S rake test_sqlite3 || die "sqlite3 tests failed"