diff options
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 07ec5e1873..aee5712643 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -78,6 +78,7 @@ module Rails def initialize(*args) @original_wd = Dir.pwd + @gem_filter = lambda { |gem| true } super convert_database_option_for_jruby end @@ -85,14 +86,19 @@ module Rails protected def gemfile_entries - @gemfile_entries ||= [ - rails_gemfile_entry, + [ rails_gemfile_entry, database_gemfile_entry, assets_gemfile_entry, javascript_gemfile_entry, jbuilder_gemfile_entry, webconsole_gemfile_entry, - sdoc_gemfile_entry].flatten + sdoc_gemfile_entry].flatten.find_all(&@gem_filter) + end + + def add_gem_entry_filter + @gem_filter = lambda { |next_filter,entry| + yield(entry) && next_filter.call(entry) + }.curry[@gem_filter] end def builder |