instance method
rakefile
Ruby on Rails 3.0.20
Since v3.0.20Signature
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/generators/actions.rb, line 193
def rakefile(filename, data=nil, &block)
log :rakefile, filename
create_file("lib/tasks/#{filename}", data, :verbose => false, &block)
end
Defined in railties/lib/rails/generators/actions.rb line 193
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions