Gemfile 3.13 KB
Newer Older
jplang's avatar
jplang committed
1
source 'http://rubygems.org'
2

tmaruyama's avatar
tmaruyama committed
3
gem 'rails', '3.2.11'
4
gem "jquery-rails", "~> 2.0.2"
tmaruyama's avatar
tmaruyama committed
5
gem "i18n", "~> 0.6.0"
emassip's avatar
emassip committed
6
gem "coderay", "~> 1.0.6"
7
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
8
gem "builder", "3.0.0"
9 10 11

# Optional gem for LDAP authentication
group :ldap do
jplang's avatar
jplang committed
12
  gem "net-ldap", "~> 0.3.1"
13 14 15 16 17
end

# Optional gem for OpenID authentication
group :openid do
  gem "ruby-openid", "~> 2.1.4", :require => "openid"
jplang's avatar
jplang committed
18
  gem "rack-openid"
19 20
end

21 22 23 24 25 26 27 28
# Optional gem for exporting the gantt to a PNG file, not supported with jruby
platforms :mri, :mingw do
  group :rmagick do
    # RMagick 2 supports ruby 1.9
    # RMagick 1 would be fine for ruby 1.8 but Bundler does not support
    # different requirements for the same gem on different platforms
    gem "rmagick", ">= 2.0.0"
  end
29 30 31
end

platforms :jruby do
32 33
  # jruby-openssl is bundled with JRuby 1.7.0
  gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
34
  gem "activerecord-jdbc-adapter", "1.2.5"
35
end
36

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
# Include database gems for the adapters found in the database
# configuration file
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
if File.exist?(database_file)
  database_config = YAML.load_file(database_file)
  adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
  if adapters.any?
    adapters.each do |adapter|
      case adapter
      when /mysql/
        gem "mysql", "~> 2.8.1", :platforms => [:mri_18, :mingw_18]
        gem "mysql2", "~> 0.3.11", :platforms => [:mri_19, :mingw_19]
        gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
      when /postgresql/
        gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
        gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby
      when /sqlite3/
        gem "sqlite3", :platforms => [:mri, :mingw]
        gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
      when /sqlserver/
        gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw]
        gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw]
      else
jplang's avatar
jplang committed
60
        warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
61 62 63
      end
    end
  else
64
    warn("No adapter found in config/database.yml, please configure it first")
65
  end
66
else
67
  warn("Please configure your config/database.yml first")
68 69 70 71
end

group :development do
  gem "rdoc", ">= 2.4.2"
emassip's avatar
emassip committed
72
  gem "yard"
73 74 75
end

group :test do
tmaruyama's avatar
tmaruyama committed
76
  gem "shoulda", "~> 2.11"
77 78
  # Shoulda does not work nice on Ruby 1.9.3 and JRuby 1.7.
  # It seems to need test-unit explicitely.
79 80 81
  platforms = [:mri_19]
  platforms << :jruby if defined?(JRUBY_VERSION) && JRUBY_VERSION >= "1.7"
  gem "test-unit", :platforms => platforms
tmaruyama's avatar
tmaruyama committed
82
  gem "mocha", "0.12.3"
jplang's avatar
jplang committed
83
  gem 'capybara', '~> 2.0.0'
84 85
end

86 87
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
if File.exists?(local_gemfile)
jplang's avatar
jplang committed
88
  puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
89
  instance_eval File.read(local_gemfile)
jplang's avatar
jplang committed
90 91
end

92
# Load plugins' Gemfiles
93
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
94 95 96
  puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
  instance_eval File.read(file)
end