aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators
diff options
context:
space:
mode:
authorFred Wu <ifredwu@gmail.com>2012-06-05 15:49:40 +1000
committerFred Wu <ifredwu@gmail.com>2012-06-05 15:49:40 +1000
commit126586a5e61ec2026843c14606d1b7e2f8bbe7b7 (patch)
tree9592fad6c186cea4a5c4aa8104e1f6c14ba6f9eb /railties/lib/rails/generators
parent2186540f9160b47e075b9926d12d3a6843e95d31 (diff)
downloadrails-126586a5e61ec2026843c14606d1b7e2f8bbe7b7.tar.gz
rails-126586a5e61ec2026843c14606d1b7e2f8bbe7b7.tar.bz2
rails-126586a5e61ec2026843c14606d1b7e2f8bbe7b7.zip
Fixed the Gemfile when gemspec is skipped in the 'rails plugin new' command
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/templates/Gemfile15
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/Gemfile b/railties/lib/rails/generators/rails/plugin_new/templates/Gemfile
index 9399c9cb77..7448b386c5 100644
--- a/railties/lib/rails/generators/rails/plugin_new/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/plugin_new/templates/Gemfile
@@ -1,17 +1,32 @@
source "http://rubygems.org"
+<% if options[:skip_gemspec] -%>
+<%= '# ' if options.dev? || options.edge? -%>gem "rails", "~> <%= Rails::VERSION::STRING %>"
+<% if full? && !options[:skip_javascript] -%>
+# gem "<%= "#{options[:javascript]}-rails" %>"
+<% end -%>
+<% else -%>
# Declare your gem's dependencies in <%= name %>.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec
+<% end -%>
+<% unless options[:javascript] == 'jquery' -%>
# jquery-rails is used by the dummy application
gem "jquery-rails"
+<% end -%>
+<% if options[:skip_gemspec] -%>
+group :development do
+ gem "<%= gem_for_database %>"
+end
+<% else -%>
# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.
+<% end -%>
<% if options.dev? || options.edge? -%>
# Your gem is dependent on dev or edge Rails. Once you can lock this