##// END OF EJS Templates
Ruby2.0: add "require 'yaml'" to Gemfile...
Toshi MARUYAMA -
r11258:bf917a61e716
parent child
Show More
@@ -1,92 +1,93
1 1 source 'https://rubygems.org'
2 2
3 3 gem 'rails', '3.2.12'
4 4 gem "jquery-rails", "~> 2.0.2"
5 5 gem "i18n", "~> 0.6.0"
6 6 gem "coderay", "~> 1.0.6"
7 7 gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
8 8 gem "builder", "3.0.0"
9 9
10 10 # Optional gem for LDAP authentication
11 11 group :ldap do
12 12 gem "net-ldap", "~> 0.3.1"
13 13 end
14 14
15 15 # Optional gem for OpenID authentication
16 16 group :openid do
17 17 gem "ruby-openid", "~> 2.1.4", :require => "openid"
18 18 gem "rack-openid"
19 19 end
20 20
21 21 # Optional gem for exporting the gantt to a PNG file, not supported with jruby
22 22 platforms :mri, :mingw do
23 23 group :rmagick do
24 24 # RMagick 2 supports ruby 1.9
25 25 # RMagick 1 would be fine for ruby 1.8 but Bundler does not support
26 26 # different requirements for the same gem on different platforms
27 27 gem "rmagick", ">= 2.0.0"
28 28 end
29 29 end
30 30
31 31 platforms :jruby do
32 32 # jruby-openssl is bundled with JRuby 1.7.0
33 33 gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
34 34 gem "activerecord-jdbc-adapter", "1.2.5"
35 35 end
36 36
37 37 # Include database gems for the adapters found in the database
38 38 # configuration file
39 39 require 'erb'
40 require 'yaml'
40 41 database_file = File.join(File.dirname(__FILE__), "config/database.yml")
41 42 if File.exist?(database_file)
42 43 database_config = YAML::load(ERB.new(IO.read(database_file)).result)
43 44 adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
44 45 if adapters.any?
45 46 adapters.each do |adapter|
46 47 case adapter
47 48 when /mysql/
48 49 gem "mysql", "~> 2.8.1", :platforms => [:mri_18, :mingw_18]
49 50 gem "mysql2", "~> 0.3.11", :platforms => [:mri_19, :mingw_19]
50 51 gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
51 52 when /postgresql/
52 53 gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
53 54 gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby
54 55 when /sqlite3/
55 56 gem "sqlite3", :platforms => [:mri, :mingw]
56 57 gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
57 58 when /sqlserver/
58 59 gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw]
59 60 gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw]
60 61 else
61 62 warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
62 63 end
63 64 end
64 65 else
65 66 warn("No adapter found in config/database.yml, please configure it first")
66 67 end
67 68 else
68 69 warn("Please configure your config/database.yml first")
69 70 end
70 71
71 72 group :development do
72 73 gem "rdoc", ">= 2.4.2"
73 74 gem "yard"
74 75 end
75 76
76 77 group :test do
77 78 gem "shoulda", "~> 3.3.2"
78 79 gem "mocha"
79 80 gem 'capybara', '~> 2.0.0'
80 81 end
81 82
82 83 local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
83 84 if File.exists?(local_gemfile)
84 85 puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
85 86 instance_eval File.read(local_gemfile)
86 87 end
87 88
88 89 # Load plugins' Gemfiles
89 90 Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
90 91 puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
91 92 instance_eval File.read(file)
92 93 end
General Comments 0
You need to be logged in to leave comments. Login now