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

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

  # 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
36 37 38
end

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

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

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

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

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

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