1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove add_gem_entry_filter from GeneratorAppBase:

The add_gem_entry_filter was introduce in
f7e0758714 and doesn't work this
feature
This commit is contained in:
Rodrigo Ramírez Norambuena 2020-09-29 16:49:17 -03:00
parent bb69d1967f
commit 3b9f5e3f4b
2 changed files with 0 additions and 30 deletions

View file

@ -122,12 +122,6 @@ module Rails
cable_gemfile_entry].flatten.find_all(&@gem_filter) cable_gemfile_entry].flatten.find_all(&@gem_filter)
end end
def add_gem_entry_filter # :doc:
@gem_filter = lambda { |next_filter, entry|
yield(entry) && next_filter.call(entry)
}.curry[@gem_filter]
end
def builder # :doc: def builder # :doc:
@builder ||= begin @builder ||= begin
builder_class = get_builder_class builder_class = get_builder_class

View file

@ -15,7 +15,6 @@ module Rails
include(Module.new { include(Module.new {
def gemfile_entries; super; end def gemfile_entries; super; end
def invoke_all; super; self; end def invoke_all; super; self; end
def add_gem_entry_filter; super; end
}) })
end end
end end
@ -25,29 +24,6 @@ module Rails
assert klass.start(["new", "blah"]) assert klass.start(["new", "blah"])
end end
def test_filter
klass = make_builder_class
generator = klass.start(["new", "blah"])
gems = generator.gemfile_entries
generator.add_gem_entry_filter { |gem|
gem.name != gems.first.name
}
assert_equal gems.drop(1), generator.gemfile_entries
end
def test_two_filters
klass = make_builder_class
generator = klass.start(["new", "blah"])
gems = generator.gemfile_entries
generator.add_gem_entry_filter { |gem|
gem.name != gems.first.name
}
generator.add_gem_entry_filter { |gem|
gem.name != gems[1].name
}
assert_equal gems.drop(2), generator.gemfile_entries
end
def test_recommended_rails_versions def test_recommended_rails_versions
klass = make_builder_class klass = make_builder_class
generator = klass.start(["new", "blah"]) generator = klass.start(["new", "blah"])