Gemfile 2.92 KB
Newer Older
tmaruyama's avatar
tmaruyama committed
1
source 'https://rubygems.org'
2

tmaruyama's avatar
tmaruyama committed
3
gem 'rails', '3.2.12'
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
# Include database gems for the adapters found in the database
# configuration file
39
require 'erb'
40 41
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
if File.exist?(database_file)
42
  database_config = YAML::load(ERB.new(IO.read(database_file)).result)
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
  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
61
        warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
62 63 64
      end
    end
  else
65
    warn("No adapter found in config/database.yml, please configure it first")
66
  end
67
else
68
  warn("Please configure your config/database.yml first")
69 70 71 72
end

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

group :test do
jplang's avatar
jplang committed
77
  gem "shoulda", "~> 3.3.2"
tmaruyama's avatar
tmaruyama committed
78
  gem "mocha"
jplang's avatar
jplang committed
79
  gem 'capybara', '~> 2.0.0'
80 81
end

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

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