method

rakefile

rakefile(filename, data = nil)
public

Creates a Rake tasks file in lib/tasks/. The code can be specified as an argument or as the return value of the block.

rakefile "bootstrap.rake", <<~RUBY
  task :bootstrap do
    puts "Boots! Boots! Boots!"
  end
RUBY

rakefile "bootstrap.rake" do
  project = ask("What is the UNIX name of your project?")

  <<~RUBY
    namespace :#{project} do
      task :bootstrap do
        puts "Boots! Boots! Boots!"
      end
    end
  RUBY
end