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

marutosijp's avatar
marutosijp committed
3
gem "rails", "3.2.19"
4
gem "jquery-rails", "~> 3.1.1"
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.4"
8
gem "request_store", "1.0.5"
9
gem "mime-types"
10
gem "rbpdf", "~> 1.18.1"
11 12 13

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

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

23
platforms :mri, :mingw do
jplang's avatar
jplang committed
24
  # Optional gem for exporting the gantt to a PNG file, not supported with jruby
25 26 27 28 29 30
  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
jplang's avatar
jplang committed
31 32 33 34 35 36

  # Optional Markdown support, not for JRuby
  group :markdown do
    # TODO: upgrade to redcarpet 3.x when ruby1.8 support is dropped
    gem "redcarpet", "~> 2.3.0"
  end
37 38 39
end

platforms :jruby do
40 41
  # jruby-openssl is bundled with JRuby 1.7.0
  gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
42
  gem "activerecord-jdbc-adapter", "~> 1.3.2"
43
end
44

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

group :development do
  gem "rdoc", ">= 2.4.2"
emassip's avatar
emassip committed
84
  gem "yard"
85 86 87
end

group :test do
jplang's avatar
jplang committed
88
  gem "shoulda", "~> 3.3.2"
89
  gem "shoulda-matchers", "1.4.1"
90
  gem "mocha", "~> 1.0.0", :require => 'mocha/api'
91
  if RUBY_VERSION >= '1.9.3'
tmaruyama's avatar
tmaruyama committed
92 93 94
    gem "capybara", "~> 2.1.0"
    gem "selenium-webdriver"
  end
95 96
end

97 98
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
if File.exists?(local_gemfile)
jplang's avatar
jplang committed
99
  puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
100
  instance_eval File.read(local_gemfile)
jplang's avatar
jplang committed
101 102
end

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