Ruby 中的 Rake 与 Warbler?
我已经使用 Warble 来制作 .war 文件。效果非常好。
一些在线教程建议在不同时间使用“rake”命令。如果rake是为了编译,我认为Ruby不需要编译。它是 Warble 的替代品吗?或者说这两者发挥着不同的作用?
什么时候需要使用耙子?
I have used Warble to make .war files. That worked pretty well.
Some of the tutorials online suggest using the "rake" command at various times. If rake is for compilation, I thought Ruby didn't need compilation. Is it a substitute for Warble? Or do these two play different functions?
When is rake meant to be used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Rake 是一个用 Ruby 编写的用于自动执行任务的工具,您也可以使用 Ruby 语法编写该工具。 Ruby 程序不必构建,但开发中仍然涉及许多其他任务,您可以将其自动化,而不必每次都自己完成。
Rails 的一些示例包括将数据库迁移到新架构或创建新数据库。
Rake 允许您使用 Ruby 语法编写任务,您还可以指定任务之间的依赖关系,这样运行一个任务将导致其所有依赖关系首先运行。
Rake is a tool written in Ruby for automating tasks, which you also write using a Ruby syntax. Ruby program's don't have to be built, but there are still plenty of other tasks involved in development that you can automate instead of doing yourself each time.
Some examples from Rails include migrating your database to a new schema or creating a new database.
Rake lets you write tasks with a Ruby syntax, and you can also specify dependencies between tasks, so that running one task will cause all of its dependencies to be ran first.
将
rake
视为 Ruby 的make
。例如,对于我开发的其中一个 gem,Rakefile
包含多个任务,例如运行所有测试 (rake test
) 或构建 gem (rake gem:构建
)。更多信息请访问网站:http://rake.rubyforge.org/
Think of
rake
as amake
for Ruby. For example for one of the gems I develop, theRakefile
includes several tasks, like running all the tests (rake test
) or building the gem (rake gem:build
). More info on the web site:http://rake.rubyforge.org/