autoreload:自动库重新加载

时间:2021-06-07 19:32:05
【文件属性】:
文件名称:autoreload:自动库重新加载
文件大小:36KB
文件格式:ZIP
更新时间:2021-06-07 19:32:05
Ruby 自动重装 | | 描述 Autoreload 会在更新后自动重新加载库文件。 它在测试无状态服务(例如 Web 应用程序)时特别有用。 重要的! 1.0+ 版有一个新的 API。 它也适用于 Ruby 1.9 或更高版本。 在 Ruby 1.8 或更旧的文件中,无论自上次加载后是否实际更改,都会重新加载文件。 而在 Ruby 1.9+ 中,它们仅在文件上的 mtime 比上一次更新时才重新加载。 概要 假设我们的加载路径中有一个库foo.rb : def foo 1 end 然后我们可以运行以下脚本example.rb : require 'autoreload' autoreload(:interval=>2, :verbose=>true) do require 'foo.rb' end loop { puts foo sleep 2 } 当它正在运行时,我们
【文件预览】:
autoreload-master
----autoreload.gemspec(7KB)
----lib()
--------autoreload.rb(495B)
--------autoreload()
----Gemfile(211B)
----work()
--------autoreload.rb(3KB)
--------deprecated()
--------consider()
----Manifest.txt(278B)
----spec()
--------require_spec.rb(836B)
--------autoreload_spec.rb(719B)
--------helper.rb(421B)
----Rakefile(261B)
----.travis.yml(161B)
----Assembly(434B)
----LICENSE.md(2KB)
----HISTORY.md(2KB)
----try()
--------tryme.rb(312B)
--------changeme.rb(81B)
----README.md(2KB)
----.yardopts(95B)
----.gitignore(53B)
----Index.rb(905B)
----.index(1KB)

网友评论