【文件属性】:
文件名称:古巴:基于RUM的Web开发微框架
文件大小:36KB
文件格式:ZIP
更新时间:2021-02-01 00:53:14
ruby rack micro-framework lesscode RubyRuby
古巴
n 。 Web开发的微框架。
社区
在IRC上与我们见面: 上的#cuba.rb。
描述
Cuba是用于Web开发的微框架,最初是受启发的, 是一个用于应用程序的微型但功能强大的映射器。
它通过集成了许多模板,并通过和测试。
安装
$ gem install cuba
用法
这是一个简单的应用程序:
# cat hello_world.rb
require "cuba"
require "cuba/safe"
Cuba . use Rack :: Session :: Cookie , :secret => "__a_very_long_string__"
Cuba . plugin Cuba :: Safe
Cuba . define do
on get do
on "hello" do
res . write "Hello world!"
end
on root do
res . redirect "/hello"
end
end
end
和测试文件:
# cat hello_world_test.rb
【文件预览】:
cuba-master
----.gems(64B)
----CONTRIBUTING(1KB)
----lib()
--------cuba()
--------cuba.rb(9KB)
----examples()
--------rack-response.ru(311B)
--------config.ru(243B)
--------views()
--------measure.rb(287B)
----LICENSE(1KB)
----test()
--------captures.rb(3KB)
--------middleware.rb(682B)
--------integration.rb(2KB)
--------views()
--------composition.rb(2KB)
--------match.rb(1KB)
--------run.rb(512B)
--------path.rb(1KB)
--------safe.rb(1KB)
--------session.rb(289B)
--------csrf.rb(2KB)
--------settings.rb(1KB)
--------rack.rb(365B)
--------render.rb(3KB)
--------helper.rb(267B)
--------on.rb(3KB)
--------extension.rb(386B)
--------segment.rb(826B)
--------accept.rb(2KB)
--------host.rb(519B)
--------root.rb(1KB)
--------plugin.rb(830B)
--------param.rb(2KB)
--------redirect.rb(415B)
--------cookie.rb(736B)
--------number.rb(614B)
--------with.rb(850B)
----README.md(18KB)
----cuba.gemspec(611B)
----makefile(40B)
----.gitignore(16B)
----CHANGELOG(1KB)