Skip to content
Browse files

Make edge and dev options use edge mysql2

  • Loading branch information...
1 parent 0e1fed5 commit b023bcf71b685c0088b2b1f79bc52e8797ce3538 @spastorino spastorino committed Mar 27, 2011
Showing with 14 additions and 6 deletions.
  1. +14 −6 railties/lib/rails/generators/app_base.rb
View
20 railties/lib/rails/generators/app_base.rb
@@ -112,30 +112,38 @@ def set_default_accessors!
end
def database_gemfile_entry
- options[:skip_active_record] ? "" : "gem '#{gem_for_database}'"
+ entry = options[:skip_active_record] ? "" : "gem '#{gem_for_database}'"
+ if options[:database] == 'mysql'
+ if options.dev? || options.edge?
+ entry += ", :git => 'git://github.com/brianmario/mysql2.git'"
+ else
+ entry += "\n# gem 'mysql2', :git => 'git://github.com/brianmario/mysql2.git'"
+ end
+ end
+ entry
end
def rails_gemfile_entry
if options.dev?
<<-GEMFILE
gem 'rails', :path => '#{Rails::Generators::RAILS_DEV_PATH}'
gem 'arel', :git => 'git://github.com/rails/arel.git'
-gem "rack", :git => "git://github.com/rack/rack.git"
+gem 'rack', :git => 'git://github.com/rack/rack.git'
GEMFILE
elsif options.edge?
<<-GEMFILE
gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'arel', :git => 'git://github.com/rails/arel.git'
-gem "rack", :git => "git://github.com/rack/rack.git"
+gem 'rack', :git => 'git://github.com/rack/rack.git'
GEMFILE
else
<<-GEMFILE
gem 'rails', '#{Rails::VERSION::STRING}'
# Bundle edge Rails instead:
-# gem 'rails', :git => 'git://github.com/rails/rails.git'
-# gem 'arel', :git => 'git://github.com/rails/arel.git'
-# gem "rack", :git => "git://github.com/rack/rack.git"
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+# gem 'arel', :git => 'git://github.com/rails/arel.git'
+# gem 'rack', :git => 'git://github.com/rack/rack.git'
GEMFILE
end
end

0 comments on commit b023bcf

Please sign in to comment.
Something went wrong with that request. Please try again.