Gemfile 3.02 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
require 'yaml'
41 42
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
if File.exist?(database_file)
43
  database_config = YAML::load(ERB.new(IO.read(database_file)).result)
44 45 46 47 48 49
  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]
50 51
        mysql2_platforms = RUBY_VERSION >= '2.0' ? [:mri_20, :mingw_20] : [:mri_19, :mingw_19]
        gem "mysql2", "~> 0.3.11", :platforms => mysql2_platforms
52 53 54 55 56 57 58 59 60 61 62
        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
63
        warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
64 65 66
      end
    end
  else
67
    warn("No adapter found in config/database.yml, please configure it first")
68
  end
69
else
70
  warn("Please configure your config/database.yml first")
71 72 73 74
end

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

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

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

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