Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Ruby 中似乎没有 main 函数。那么 Ruby 中 main 的等价物是什么?
Ruby 中没有这样的东西。解释器从上到下执行代码,因此您的主脚本隐含地是“main”的主体。例如,假设您有两个文件script_a.rb和script_b.rb. 并假设内容script_a.rb如下:
script_a.rb
script_b.rb
require_relative './script_b' puts 1 + 1
现在,如果您运行ruby script_a.rb,您将得到的实际代码执行如下:查找script_b.rb、执行的内容script_b.rb、执行puts 1 + 1。
ruby script_a.rb
puts 1 + 1
我们在客户的服务器上部署了一个 .NET 4.0 应用程序,虽然该站点的 URL 在技术上是公开的,但它不被任何其他站点(我们知道的)引用,包括搜索引擎。但是,时不时地(有时一天两次或三次,有时一周一次),我们会抛出异常并报告;
2013-07-21 13:33:40