* Rack applications now need to subclass from
Org::Chneukirchen::Rack::AbstractApplication and implement these
methods: #init, #service, #destroy. Instead of getting an env hash
and returning a tuple, #service now gets two opaque objects,
instances of Org::Chneukirchen::Rack::AbstractRequest and
Org::Chneukirchen::Rack::AbstractResponse. To generate output,
simply run response.getWriter.println("foo"). Imperative
programmers will love it! Don't forget to #close the writer, though.
* Rackup, which obviously was just a quick hack, gets converted from a
DSL to a proper XML configuration file, for example:
<?xml version="1.0" encoding="UTF-8"?>
<rackup id="hello-rack" version="2.4" xmlns="http://chneukirchen.org/xml/ns/rackup"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://chneukirchen.org/xml/ns/rackup.xsd">
<display-name>A Rack 2.0 application</display-name>
<filter>
<filter-name>ServletMappedDoFilter_Filter</filter-name>
<filter-class>tests.Filter.DoFilter_Filter</filter-class>
<init-param>
<param-name>attribute</param-name>
<param-value>tests.Filter.DoFilter_Filter.SERVLET_MAPPED</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ServletMappedDoFilter_Filter</filter-name>
<url-pattern>/DoFilterTest</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<listener>
<listener-class>tests.ServletRequestListener.RequestListener</listener-class>
</listener>
<servlet>
<servlet-name>welcome</servlet-name>
<servlet-class>WelcomeServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ServletErrorPage</servlet-name>
<servlet-class>tests.Error.ServletErrorPage</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>welcome</servlet-name>
<url-pattern>/hello.welcome</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServletErrorPage</servlet-name>
<url-pattern>/ServletErrorPage</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>hello.welcome</welcome-file>
</welcome-file-list>
<error-page>
<exception-type>IndexError</exception-type>
<location>/ServletErrorPage</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error404.html</location>
<error-page>
</rackup>
This belongs to WEB-INF/rack.xml in the .rar file (see below).
* To generate Rack application sceletons, a new tool called "raven" is
introduced. Creating a new Rack application is as simple as
rvn archetype:create -U \
-DarchetypeGroupId=org.chneukirchen.rack \
-DarchetypeArtifactId=rack-archetype-basic \
-DarchetypeVersion=1.0 \
-DremoteRepositories=http://chneukirchen.org/repos/rack \
-DgroupId=org.chneukirchen.rack.hello -DartifactId=hello-rack
* For deployment, we now use .rar files that contain Rubygems and the
stuff generated by raven. Just stuff everything in there and pay
people to deploy it to you. This will create a whole new Ruby
industry.
I hope you'll enjoy these new features and Rack 2.0 will become
popular in The Enterprise.
--
Christian Neukirchen <chneuk...@gmail.com> http://chneukirchen.org
Adrian Madrid
My eBiz, Developer
3082 W. Maple Loop Dr
Lehi, UT 84043
801-341-3824
> (In case someone comes along later reading this, notice the date on
> the message!)
Or look in the headers. ;-)