Create a new file
in the lib/ directory. Code can be specified in a block or a data
string can be given.
lib("crypto.rb")do"crypted_special_value = '#{rand}--#{Time.now}--#{rand(1337)}--'"endlib("foreign.rb","# Foreign code is fun")
# File railties/lib/rails/generators/actions.rb, line 161
def lib(filename, data = nil)
log :lib, filename
data ||= yield if block_given?
create_file("lib/#{filename}", optimize_indentation(data), verbose: false)
end