instance method
rakefile
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Signature
rakefile(filename, data = nil, &block)
Create a new Rakefile with the provided code (either in a block or a string).
Examples
rakefile("bootstrap.rake") do project = ask("What is the UNIX name of your project?") <<-TASK namespace :#{project} do task :bootstrap do puts "i like boots!" end end TASK end rakefile("seed.rake", "puts 'im plantin ur seedz'")
Parameters
-
filenamereq -
dataopt = nil -
blockblock
Source
# File railties/lib/rails_generator/generators/applications/app/template_runner.rb, line 194
def rakefile(filename, data = nil, &block)
log 'rakefile', filename
file("lib/tasks/#{filename}", data, false, &block)
end
Defined in railties/lib/rails_generator/generators/applications/app/template_runner.rb line 194
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::TemplateRunner