boilerplate_gems = <<-BOILERPLATE gem 'rack' if RUBY_PLATFORM == 'java' gem "activerecord-jdbcmysql-adapter" else gem 'mysql2', '~> 0.3.20' end BOILERPLATE if RUBY_VERSION >= '2.2.2' && RUBY_PLATFORM != 'java' gemfile <<-RB gem 'activerecord', '~> 5.0.0' gem 'minitest', '~> 5.2.3' #{boilerplate_gems} RB end if RUBY_VERSION < '2.4.0' gemfile <<-RB gem 'activerecord', '~> 4.2.0' gem 'minitest', '~> 5.2.3' #{boilerplate_gems} RB gemfile <<-RB gem 'activerecord', '~> 4.1.6' gem 'minitest', '~> 5.2.3' #{boilerplate_gems} RB gemfile <<-RB gem 'activerecord', '~> 4.0.11' #{boilerplate_gems} RB end # AR 3.x does not have official support for Ruby 2.2, and there are several # known issues, including https://github.com/rails/rails/issues/18991, so # skip 3.x versions on 2.2. # if RUBY_VERSION < '2.2.0' gemfile <<-RB gem 'activerecord', '~> 3.2.19' #{boilerplate_gems} RB gemfile <<-RB gem 'activerecord', '~> 3.1.12' #{boilerplate_gems} RB gemfile <<-RB gem 'activerecord', '~> 3.0.20' gem 'activerecord-mysql2-adapter' if RUBY_PLATFORM != 'java' #{boilerplate_gems} RB end # vim: ft=ruby