Creates a file in lib/. The contents can be specified as an
argument or as the return value of the block.
lib"foreign.rb",<<~RUBY# Foreign code is funRUBYlib"foreign.rb"do"# Foreign code is fun"end
# File railties/lib/rails/generators/actions.rb, line 275
def lib(filename, data = nil)
log :lib, filename
data ||= yield if block_given?
create_file("lib/#{filename}", optimize_indentation(data), verbose: false)
end