aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-14 11:03:31 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2012-03-14 12:46:25 -0300
commit96aea58f2256ce977e3209f3ebc5d87e5035063f (patch)
tree0fbbefa70ef90af35ce08d4e1d8e417eb0010b7f /railties/lib
parent570cc89bad00a0df20e11196fa34d3119327a7d6 (diff)
downloadrails-96aea58f2256ce977e3209f3ebc5d87e5035063f.tar.gz
rails-96aea58f2256ce977e3209f3ebc5d87e5035063f.tar.bz2
rails-96aea58f2256ce977e3209f3ebc5d87e5035063f.zip
Do not generate app/views and sprockets entries on http app
[Carlos Antonio da Silva & Santiago Pastorino]
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/rails/app/app_generator.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index 947ab82d00..ffdfb32aba 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -159,6 +159,10 @@ module Rails
if !options[:skip_active_record] && !DATABASES.include?(options[:database])
raise Error, "Invalid value for --database option. Supported for preconfiguration are: #{DATABASES.join(", ")}."
end
+
+ # Force sprockets to be skipped when generating http only app.
+ # Can't modify options hash as it's frozen by default.
+ self.options = options.merge(:skip_sprockets => true).freeze if options.http?
end
public_task :create_root
@@ -173,6 +177,7 @@ module Rails
def create_app_files
build(:app)
+ remove_file("app/views") if options.http?
end
def create_config_files