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

marutosijp's avatar
marutosijp committed
3
gem "rails", "3.2.16"
4
gem "jquery-rails", "~> 2.0.2"
jplang's avatar
jplang committed
5
gem "coderay", "~> 1.1.0"
6
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
7
gem "builder", "3.0.0"
8 9
# TODO: upgrade to redcarpet 3.x when ruby1.8 support is dropped
gem "redcarpet", "~> 2.3.0"
10 11 12

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

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

22 23 24 25 26 27 28 29
# 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
30 31 32
end

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

38 39
# Include database gems for the adapters found in the database
# configuration file
40
require 'erb'
41
require 'yaml'
42 43
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
if File.exist?(database_file)
44
  database_config = YAML::load(ERB.new(IO.read(database_file)).result)
45 46 47 48
  adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
  if adapters.any?
    adapters.each do |adapter|
      case adapter
49 50 51 52 53
      when 'mysql2'
        gem "mysql2", "~> 0.3.11", :platforms => [:mri, :mingw]
        gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
      when 'mysql'
        gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw]
54 55 56 57 58 59 60 61 62 63 64
        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
65
        warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
66 67 68
      end
    end
  else
69
    warn("No adapter found in config/database.yml, please configure it first")
70
  end
71
else
72
  warn("Please configure your config/database.yml first")
73 74 75 76
end

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

group :test do
jplang's avatar
jplang committed
81
  gem "shoulda", "~> 3.3.2"
82
  gem "mocha", ">= 0.14", :require => 'mocha/api'
83
  if RUBY_VERSION >= '1.9.3'
tmaruyama's avatar
tmaruyama committed
84 85 86
    gem "capybara", "~> 2.1.0"
    gem "selenium-webdriver"
  end
87 88
end

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

95
# Load plugins' Gemfiles
96
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
97
  puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
98 99
  #TODO: switch to "eval_gemfile file" when bundler >= 1.2.0 will be required (rails 4)
  instance_eval File.read(file), file
100
end