Feature #5638 » redmine-bundler-20110618.diff
.gitignore | ||
---|---|---|
23 | 23 |
/tmp/test/* |
24 | 24 |
/vendor/rails |
25 | 25 |
*.rbc |
26 | ||
27 |
/.bundle |
|
28 |
/Gemfile.lock |
|
29 |
.hgignore | ||
---|---|---|
25 | 25 |
tmp/test/* |
26 | 26 |
vendor/rails |
27 | 27 |
*.rbc |
28 | ||
28 | 29 |
.svn/ |
29 | 30 |
.git/ |
31 | ||
32 |
.bundle |
|
33 |
Gemfile.lock |
|
34 |
Gemfile | ||
---|---|---|
1 |
source :rubygems |
|
2 |
source :rubyforge |
|
3 |
source :gemcutter |
|
4 | ||
5 |
gem 'bundler', '~> 1.0.0' |
|
6 |
gem 'rails', '2.3.11' |
|
7 |
gem 'rack' , '~> 1.1.1' |
|
8 |
gem 'i18n', '>= 0.4.2' |
|
9 |
gem 'rubytree', '0.5.2', :require => 'tree' |
|
10 |
gem 'coderay', '~> 0.9.7' |
|
11 | ||
12 |
# Please uncomment lines for your databases. |
|
13 |
# Alternatively you may want to add these lines to specific groups below. |
|
14 |
# gem 'sqlite3-ruby', :require => 'sqlite3' # for SQLite 3 |
|
15 |
# gem 'mysql' # MySQL |
|
16 |
# gem 'pg' # PostgreSQL |
|
17 |
gem 'pg' |
|
18 | ||
19 |
group :development do |
|
20 |
end |
|
21 | ||
22 |
group :production do |
|
23 |
end |
|
24 | ||
25 |
group :test do |
|
26 |
gem 'shoulda' |
|
27 |
gem 'mocha' |
|
28 |
gem 'edavis10-object_daddy', :require => 'object_daddy' |
|
29 |
end |
|
30 | ||
31 |
# Load plugins Gemfiles |
|
32 |
Dir.glob(File.join(File.dirname(__FILE__), %w(vendor plugins * Gemfile))) do |file| |
|
33 |
puts "Loading #{file} ..." |
|
34 |
instance_eval File.read(file) |
|
35 |
end |
config/boot.rb | ||
---|---|---|
36 | 36 |
class Boot |
37 | 37 |
def run |
38 | 38 |
load_initializer |
39 | ||
40 |
Rails::Initializer.class_eval do |
|
41 |
def load_gems |
|
42 |
@bundler_loaded ||= Bundler.require :default, Rails.env |
|
43 |
end |
|
44 |
end |
|
45 | ||
39 | 46 |
Rails::Initializer.run(:set_load_path) |
40 | 47 |
end |
41 | 48 |
end |
... | ... | |
106 | 113 |
end |
107 | 114 |
end |
108 | 115 | |
109 |
# TODO: Workaround for #7013 to be removed for 1.2.0 |
|
110 |
# Loads i18n 0.4.2 before Rails loads any more recent gem |
|
111 |
# 0.5.0 is not compatible with the old interpolation syntax |
|
112 |
# Plugins will have to migrate to the new syntax for 1.2.0 |
|
113 |
require 'rubygems' |
|
114 |
begin |
|
115 |
gem 'i18n', '0.4.2' |
|
116 |
rescue Gem::LoadError => load_error |
|
117 |
$stderr.puts %(Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n`) |
|
118 |
exit 1 |
|
119 |
end |
|
120 | ||
121 | 116 |
# All that for this: |
122 | 117 |
Rails.boot! |
config/environment.rb | ||
---|---|---|
49 | 49 |
# Define your email configuration in configuration.yml instead. |
50 | 50 |
# It will automatically turn deliveries on |
51 | 51 |
config.action_mailer.perform_deliveries = false |
52 | ||
53 |
config.gem 'rubytree', :lib => 'tree' |
|
54 |
config.gem 'coderay', :version => '~>0.9.7' |
|
55 | 52 |
|
56 | 53 |
# Load any local configuration that is kept out of source control |
57 | 54 |
# (e.g. gems, patches). |
config/preinitializer.rb | ||
---|---|---|
1 |
begin |
|
2 |
require "rubygems" |
|
3 |
require "bundler" |
|
4 |
rescue LoadError |
|
5 |
raise "Could not load the bundler gem. Install it with `gem install bundler`." |
|
6 |
end |
|
7 | ||
8 |
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.25") |
|
9 |
raise RuntimeError, "Your bundler version is too old for Rails 2.3." + |
|
10 |
"Run `gem install bundler` to upgrade." |
|
11 |
end |
|
12 | ||
13 |
begin |
|
14 |
# Set up load paths for all bundled gems |
|
15 |
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__) |
|
16 |
Bundler.setup |
|
17 |
rescue Bundler::GemNotFound |
|
18 |
raise RuntimeError, "Bundler couldn't find some gems." + |
|
19 |
"Did you run `bundle install`?" |
|
20 |
end |
Gemfile | ||
---|---|---|
2 | 2 |
source :rubyforge |
3 | 3 |
source :gemcutter |
4 | 4 | |
5 |
gem "ruby-openid" |
|
5 | 6 |
gem 'bundler', '~> 1.0.0' |
6 | 7 |
gem 'rails', '2.3.11' |
7 | 8 |
gem 'rack' , '~> 1.1.1' |
... | ... | |
9 | 10 |
gem 'rubytree', '0.5.2', :require => 'tree' |
10 | 11 |
gem 'coderay', '~> 0.9.7' |
11 | 12 | |
12 |
# Please uncomment lines for your databases. |
|
13 |
# Alternatively you may want to add these lines to specific groups below. |
|
14 |
# gem 'sqlite3-ruby', :require => 'sqlite3' # for SQLite 3 |
|
15 |
# gem 'mysql' # MySQL |
|
16 |
# gem 'pg' # PostgreSQL |
|
17 |
gem 'pg' |
|
18 | ||
19 | 13 |
group :development do |
20 | 14 |
end |
21 | 15 | |
... | ... | |
23 | 17 |
end |
24 | 18 | |
25 | 19 |
group :test do |
26 |
gem 'shoulda' |
|
20 |
gem 'shoulda', '~> 2.10.3'
|
|
27 | 21 |
gem 'mocha' |
28 | 22 |
gem 'edavis10-object_daddy', :require => 'object_daddy' |
29 | 23 |
end |
30 | 24 | |
25 | ||
26 |
# Use the commented pure ruby gems, if you have not the needed prerequisites on |
|
27 |
# board to compile the native ones. Note, that their use is discouraged, since |
|
28 |
# their integration is propbably not that well tested and their are slower in |
|
29 |
# orders of magnitude compared to their native counterparts. You have been |
|
30 |
# warned. |
|
31 |
# |
|
32 |
platforms :mri do |
|
33 |
group :mysql do |
|
34 |
gem "mysql" |
|
35 |
# gem "ruby-mysql" |
|
36 |
end |
|
37 | ||
38 |
group :mysql2 do |
|
39 |
gem "mysql2" |
|
40 |
end |
|
41 | ||
42 |
group :postgres do |
|
43 |
gem "pg", "~> 0.9.0" |
|
44 |
# gem "postgres-pr" |
|
45 |
end |
|
46 | ||
47 |
group :sqlite do |
|
48 |
gem "sqlite3-ruby", "< 1.3", :require => "sqlite3" |
|
49 |
# please tell me, if you are fond of a pure ruby sqlite3 binding |
|
50 |
end |
|
51 |
end |
|
52 | ||
53 |
platforms :jruby do |
|
54 |
gem "jruby-openssl" |
|
55 | ||
56 |
group :mysql do |
|
57 |
gem "activerecord-jdbcmysql-adapter" |
|
58 |
end |
|
59 | ||
60 |
group :postgres do |
|
61 |
gem "activerecord-jdbcpostgresql-adapter" |
|
62 |
end |
|
63 | ||
64 |
group :sqlite do |
|
65 |
gem "activerecord-jdbcsqlite3-adapter" |
|
66 |
end |
|
67 |
end |
|
68 | ||
31 | 69 |
# Load plugins Gemfiles |
32 | 70 |
Dir.glob(File.join(File.dirname(__FILE__), %w(vendor plugins * Gemfile))) do |file| |
33 | 71 |
puts "Loading #{file} ..." |
config/boot.rb | ||
---|---|---|
37 | 37 |
def run |
38 | 38 |
load_initializer |
39 | 39 | |
40 |
# This block was added for bundler support while following setup |
|
41 |
# instructions from http://gembundler.com/rails23.html |
|
40 | 42 |
Rails::Initializer.class_eval do |
41 | 43 |
def load_gems |
42 | 44 |
@bundler_loaded ||= Bundler.require :default, Rails.env |
config/environments/test.rb | ||
---|---|---|
23 | 23 | |
24 | 24 |
# Skip protect_from_forgery in requests http://m.onkey.org/2007/9/28/csrf-protection-for-your-existing-rails-application |
25 | 25 |
config.action_controller.allow_forgery_protection = false |
26 | ||
27 |
config.gem "shoulda", :version => "~> 2.10.3" |
|
28 |
config.gem "edavis10-object_daddy", :lib => "object_daddy" |
|
29 |
config.gem "mocha" |
Gemfile | ||
---|---|---|
2 | 2 |
source :rubyforge |
3 | 3 |
source :gemcutter |
4 | 4 | |
5 |
gem "ruby-openid" |
|
6 | 5 |
gem 'bundler', '~> 1.0.0' |
7 | 6 |
gem 'rails', '2.3.11' |
8 | 7 |
gem 'rack' , '~> 1.1.1' |
... | ... | |
22 | 21 |
gem 'edavis10-object_daddy', :require => 'object_daddy' |
23 | 22 |
end |
24 | 23 | |
24 |
group :openid do |
|
25 |
gem "ruby-openid", '~> 2.1.4', :require => 'openid' |
|
26 |
end |
|
25 | 27 | |
26 | 28 |
# Use the commented pure ruby gems, if you have not the needed prerequisites on |
27 | 29 |
# board to compile the native ones. Note, that their use is discouraged, since |
Gemfile | ||
---|---|---|
25 | 25 |
gem "ruby-openid", '~> 2.1.4', :require => 'openid' |
26 | 26 |
end |
27 | 27 | |
28 |
group :rmagick do |
|
29 |
gem "rmagick", "~> 1.15.17" |
|
30 |
end |
|
31 | ||
28 | 32 |
# Use the commented pure ruby gems, if you have not the needed prerequisites on |
29 | 33 |
# board to compile the native ones. Note, that their use is discouraged, since |
30 | 34 |
# their integration is propbably not that well tested and their are slower in |
Gemfile | ||
---|---|---|
42 | 42 |
end |
43 | 43 | |
44 | 44 |
group :mysql2 do |
45 |
gem "mysql2" |
|
45 |
gem "mysql2", "~> 0.2.7"
|
|
46 | 46 |
end |
47 | 47 | |
48 | 48 |
group :postgres do |
Gemfile | ||
---|---|---|
74 | 74 | |
75 | 75 |
# Load plugins Gemfiles |
76 | 76 |
Dir.glob(File.join(File.dirname(__FILE__), %w(vendor plugins * Gemfile))) do |file| |
77 |
puts "Loading #{file} ..." |
|
77 |
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
|
78 | 78 |
instance_eval File.read(file) |
79 | 79 |
end |