nitro 0.31.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/nitro +135 -37
- data/doc/CHANGELOG.1 +108 -108
- data/doc/CHANGELOG.2 +89 -89
- data/doc/CHANGELOG.3 +105 -105
- data/{CHANGELOG → doc/CHANGELOG.4} +509 -509
- data/doc/{AUTHORS → CONTRIBUTORS} +49 -37
- data/doc/LIBRARIES +13 -0
- data/doc/LICENSE +2 -3
- data/doc/MIGRATION +45 -0
- data/doc/RELEASES +131 -11
- data/doc/TODO +67 -0
- data/lib/glue/magick.rb +0 -3
- data/lib/glue/sweeper.rb +30 -15
- data/lib/glue/thumbnails.rb +0 -2
- data/lib/glue/webfile.rb +23 -11
- data/lib/nitro.rb +37 -44
- data/lib/nitro/adapter/cgi.rb +0 -3
- data/lib/nitro/adapter/console.rb +0 -2
- data/lib/nitro/adapter/fastcgi.rb +6 -3
- data/lib/nitro/adapter/mongrel.rb +97 -58
- data/lib/nitro/adapter/script.rb +4 -6
- data/lib/nitro/adapter/webrick.rb +33 -87
- data/lib/nitro/adapter/webrick/vcr.rb +85 -0
- data/lib/nitro/caching.rb +0 -2
- data/lib/nitro/caching/actions.rb +0 -2
- data/lib/nitro/caching/fragments.rb +0 -2
- data/lib/nitro/caching/output.rb +45 -16
- data/lib/nitro/caching/proxy.rb +49 -0
- data/lib/nitro/cgi.rb +3 -6
- data/lib/nitro/cgi/cookie.rb +0 -3
- data/lib/nitro/cgi/request.rb +67 -24
- data/lib/nitro/cgi/response.rb +0 -2
- data/lib/nitro/cgi/{sendfile.rb → send_file.rb} +7 -6
- data/lib/nitro/compiler.rb +62 -55
- data/lib/nitro/compiler/cleanup.rb +0 -3
- data/lib/nitro/compiler/elements.rb +31 -28
- data/lib/nitro/compiler/errors.rb +2 -5
- data/lib/nitro/compiler/include.rb +10 -8
- data/lib/nitro/compiler/layout.rb +0 -2
- data/lib/nitro/compiler/localization.rb +0 -2
- data/lib/nitro/compiler/markup.rb +14 -6
- data/lib/nitro/compiler/morphing.rb +1 -5
- data/lib/nitro/compiler/script.rb +2 -4
- data/lib/nitro/compiler/squeeze.rb +0 -2
- data/lib/nitro/compiler/xslt.rb +0 -2
- data/lib/nitro/context.rb +10 -5
- data/lib/nitro/control.rb +18 -0
- data/lib/nitro/control/attribute.rb +88 -0
- data/lib/nitro/control/attribute/checkbox.rb +19 -0
- data/lib/nitro/control/attribute/datetime.rb +21 -0
- data/lib/nitro/control/attribute/file.rb +20 -0
- data/lib/nitro/control/attribute/fixnum.rb +26 -0
- data/lib/nitro/control/attribute/float.rb +26 -0
- data/lib/nitro/control/attribute/options.rb +38 -0
- data/lib/nitro/control/attribute/password.rb +16 -0
- data/lib/nitro/control/attribute/text.rb +16 -0
- data/lib/nitro/control/attribute/textarea.rb +16 -0
- data/lib/nitro/control/none.rb +16 -0
- data/lib/nitro/control/relation.rb +53 -0
- data/lib/nitro/control/relation/belongs_to.rb +0 -0
- data/lib/nitro/control/relation/has_many.rb +97 -0
- data/lib/nitro/control/relation/joins_many.rb +0 -0
- data/lib/nitro/control/relation/many_to_many.rb +0 -0
- data/lib/nitro/control/relation/refers_to.rb +29 -0
- data/lib/nitro/controller.rb +7 -296
- data/lib/nitro/dispatcher.rb +72 -34
- data/lib/nitro/element.rb +36 -10
- data/lib/nitro/element/javascript.rb +0 -2
- data/lib/nitro/flash.rb +23 -10
- data/lib/nitro/global.rb +36 -11
- data/lib/nitro/helper.rb +22 -8
- data/lib/nitro/helper/benchmark.rb +0 -2
- data/lib/nitro/helper/buffer.rb +0 -3
- data/lib/nitro/helper/css.rb +12 -0
- data/lib/nitro/helper/debug.rb +1 -3
- data/lib/nitro/helper/default.rb +1 -0
- data/lib/nitro/helper/feed.rb +400 -386
- data/lib/nitro/helper/form.rb +246 -116
- data/lib/nitro/helper/javascript.rb +28 -2
- data/lib/nitro/helper/javascript/morphing.rb +0 -2
- data/lib/nitro/helper/javascript/prototype.rb +0 -2
- data/lib/nitro/helper/javascript/scriptaculous.rb +0 -1
- data/lib/nitro/helper/layout.rb +0 -2
- data/lib/nitro/helper/navigation.rb +87 -0
- data/lib/nitro/helper/pager.rb +11 -22
- data/lib/nitro/helper/table.rb +9 -32
- data/lib/nitro/helper/url.rb +104 -0
- data/lib/nitro/helper/xhtml.rb +20 -4
- data/lib/nitro/helper/xml.rb +0 -2
- data/lib/nitro/markup.rb +131 -0
- data/lib/nitro/part.rb +52 -7
- data/lib/nitro/publishable.rb +328 -0
- data/lib/nitro/render.rb +30 -61
- data/lib/nitro/router.rb +12 -4
- data/lib/nitro/sanitize.rb +48 -0
- data/lib/nitro/scaffold.rb +9 -11
- data/lib/nitro/scaffold/controller.rb +25 -0
- data/lib/nitro/scaffold/model.rb +150 -0
- data/lib/nitro/scaffolding.rb +1 -3
- data/lib/nitro/server.rb +57 -32
- data/lib/nitro/server/drb.rb +16 -2
- data/lib/nitro/server/runner.rb +80 -102
- data/lib/nitro/service.rb +0 -1
- data/lib/nitro/service/xmlrpc.rb +0 -2
- data/lib/nitro/session.rb +26 -18
- data/lib/nitro/session/drb.rb +2 -16
- data/lib/nitro/session/memory.rb +0 -2
- data/lib/nitro/template.rb +219 -0
- data/lib/nitro/test/assertions.rb +1 -3
- data/lib/nitro/test/context.rb +0 -1
- data/lib/nitro/test/testcase.rb +0 -1
- data/lib/nitro/version.rb +6 -0
- data/lib/part/admin.rb +16 -0
- data/lib/part/admin/controller.rb +19 -0
- data/lib/part/admin/helper.rb +30 -0
- data/lib/part/admin/og/controller.rb +114 -0
- data/lib/part/admin/og/customize.rb +4 -0
- data/lib/part/admin/og/template/index.xhtml +27 -0
- data/lib/part/admin/og/template/list.xhtml +38 -0
- data/lib/part/admin/og/template/search.xhtml +20 -0
- data/lib/part/admin/og/template/update.xhtml +25 -0
- data/lib/part/admin/skin.rb +207 -0
- data/lib/part/admin/template/denied.xhtml +13 -0
- data/lib/part/admin/template/index.xhtml +12 -0
- data/lib/part/admin/todo.txt +2 -0
- data/proto/public/error.xhtml +4 -2
- data/proto/run.rb +0 -2
- data/test/glue/tc_webfile.rb +1 -0
- data/test/nitro/cgi/tc_request.rb +23 -0
- data/test/nitro/helper/tc_feed.rb +0 -3
- data/test/nitro/helper/tc_navbar.rb +74 -0
- data/test/nitro/helper/tc_table.rb +2 -0
- data/test/nitro/tc_cgi.rb +72 -19
- data/test/nitro/tc_controller.rb +35 -26
- data/test/nitro/tc_controller_aspect.rb +1 -0
- data/test/nitro/tc_controller_params.rb +864 -0
- data/test/nitro/tc_dispatcher.rb +2 -2
- data/test/nitro/tc_element.rb +16 -16
- data/test/nitro/tc_flash.rb +3 -3
- data/test/nitro/tc_markup.rb +31 -0
- data/test/nitro/tc_render.rb +12 -14
- data/test/nitro/tc_session.rb +9 -7
- data/test/nitro/tc_template.rb +34 -0
- metadata +217 -198
- data/INSTALL +0 -121
- data/ProjectInfo +0 -74
- data/README +0 -555
- data/doc/apache.txt +0 -9
- data/doc/config.txt +0 -28
- data/doc/faq.txt +0 -7
- data/doc/lhttpd.txt +0 -7
- data/lib/nitro/adapter/scgi.rb +0 -239
- data/lib/nitro/helper/form/builder.rb +0 -144
- data/lib/nitro/helper/form/controls.rb +0 -389
- data/lib/nitro/helper/rss.rb +0 -72
- data/proto/conf/apache.conf +0 -51
- data/proto/public/scaffold/advanced_search.xhtml +0 -30
- data/proto/public/scaffold/edit.xhtml +0 -11
- data/proto/public/scaffold/form.xhtml +0 -1
- data/proto/public/scaffold/index.xhtml +0 -20
- data/proto/public/scaffold/list.xhtml +0 -32
- data/proto/public/scaffold/new.xhtml +0 -11
- data/proto/public/scaffold/search.xhtml +0 -29
- data/proto/public/scaffold/view.xhtml +0 -8
- data/proto/script/scgi_ctl +0 -221
- data/proto/script/scgi_service +0 -128
- data/setup.rb +0 -1585
- data/src/part/admin.rb +0 -16
- data/src/part/admin/controller.rb +0 -81
- data/src/part/admin/skin.rb +0 -21
- data/src/part/admin/system.css +0 -135
- data/src/part/admin/template/denied.xhtml +0 -1
- data/src/part/admin/template/index.xhtml +0 -43
- data/test/nitro/helper/tc_rss.rb +0 -24
data/INSTALL
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
= Instalation with RubyGems
|
|
2
|
-
|
|
3
|
-
1. Download and install RubyGems:
|
|
4
|
-
|
|
5
|
-
http://rubygems.rubyforge.org
|
|
6
|
-
|
|
7
|
-
2. Install the distribution:
|
|
8
|
-
|
|
9
|
-
gem install nitro
|
|
10
|
-
|
|
11
|
-
If you wish to install Og only:
|
|
12
|
-
|
|
13
|
-
gem install og
|
|
14
|
-
|
|
15
|
-
(make sure you have the latest stable versions of Ruby and RubyGems
|
|
16
|
-
installed)
|
|
17
|
-
|
|
18
|
-
When asked about the dependencies to include, only accept
|
|
19
|
-
the dependencies for the RDBMS backends you are planning
|
|
20
|
-
to use.
|
|
21
|
-
|
|
22
|
-
3. Set environment variable (required to load RubyGems):
|
|
23
|
-
|
|
24
|
-
export RUBYOPT=-rubygems
|
|
25
|
-
|
|
26
|
-
You can add this in you .bashrc in Unix.
|
|
27
|
-
|
|
28
|
-
Alternatively you can run your applications with the -rubygem
|
|
29
|
-
option:
|
|
30
|
-
|
|
31
|
-
ruby -rubygem xxx.rb
|
|
32
|
-
|
|
33
|
-
4. To verify that everything works ok, run the command
|
|
34
|
-
|
|
35
|
-
nitro
|
|
36
|
-
|
|
37
|
-
= Installation without RubyGems using script.
|
|
38
|
-
|
|
39
|
-
Installation without RubyGems is *strongly* discouraged.
|
|
40
|
-
However, as Nitro is all about freedom and possibilities,
|
|
41
|
-
a standard installation script is provided.
|
|
42
|
-
|
|
43
|
-
1. Switch to an administrator account
|
|
44
|
-
|
|
45
|
-
For example in Unix:
|
|
46
|
-
|
|
47
|
-
$ su -
|
|
48
|
-
|
|
49
|
-
2. Run the installation script.
|
|
50
|
-
|
|
51
|
-
$ ruby setup.rb
|
|
52
|
-
|
|
53
|
-
This installation script also installs some vendor libraries
|
|
54
|
-
that you possibly have allready installed. Use with caution.
|
|
55
|
-
|
|
56
|
-
Dependencies needed: See 'ProjectInfo' file located in the
|
|
57
|
-
current directory
|
|
58
|
-
|
|
59
|
-
= Manual installation.
|
|
60
|
-
|
|
61
|
-
Uncompress your distribution (Unix example):
|
|
62
|
-
|
|
63
|
-
$ cd my_dir
|
|
64
|
-
$ tar xvfz nitro-x.x.x.tar.gz
|
|
65
|
-
|
|
66
|
-
Put the libray dir in the Ruby path (Unix example):
|
|
67
|
-
|
|
68
|
-
$ export RUBYOPT='-I path/to/nitro/lib'
|
|
69
|
-
|
|
70
|
-
or, at windows
|
|
71
|
-
|
|
72
|
-
> set RUBYOPT=Ic:\dev\nitro\lib;c:\dev\og\lib;c:\dev\glue\lib
|
|
73
|
-
|
|
74
|
-
You also may have to manualy install the following libraries:
|
|
75
|
-
|
|
76
|
-
* Nano
|
|
77
|
-
* Mega
|
|
78
|
-
* RedCloth
|
|
79
|
-
|
|
80
|
-
= Additional libraries
|
|
81
|
-
|
|
82
|
-
Nitro uses a number of additional libraries. RubyGems
|
|
83
|
-
installs most of them, but here is the complete
|
|
84
|
-
list for your reference. Please not that most of these
|
|
85
|
-
libraries are optional.
|
|
86
|
-
|
|
87
|
-
* PostgreSQL
|
|
88
|
-
http://www.postgres.org
|
|
89
|
-
Used for Database driven web applications.
|
|
90
|
-
|
|
91
|
-
* MySQL
|
|
92
|
-
http://www.mysql.org
|
|
93
|
-
Used for Database driven web applications.
|
|
94
|
-
|
|
95
|
-
* Ruby-psql
|
|
96
|
-
http://www.postgresql.jp/interfaces/ruby/archive/ruby-postgres-0.7.1.tar.gz
|
|
97
|
-
Ruby interface to the PostgreSQL RDBMS.
|
|
98
|
-
|
|
99
|
-
* Ruby-mysql
|
|
100
|
-
http://tmtm.org/ja/ruby/mysql/README_en.html
|
|
101
|
-
Ruby interface to the MySQL RDBMS.
|
|
102
|
-
|
|
103
|
-
* Ruby-XSLT
|
|
104
|
-
http://gregoire.lejeune.free.fr/ruby-xslt_0.4.0.tar.gz
|
|
105
|
-
Used for XSLT based templates.
|
|
106
|
-
|
|
107
|
-
* Apache 2.0
|
|
108
|
-
http://www.apache.org
|
|
109
|
-
Used to host application in production environments.
|
|
110
|
-
|
|
111
|
-
* Lighttpd
|
|
112
|
-
http://www.lighttpd.net/
|
|
113
|
-
A lean and efficient web server. A perfect companion to Nitro.
|
|
114
|
-
|
|
115
|
-
* Ruby-fcgi
|
|
116
|
-
http://www.moonwolf.com/ruby/archive/ruby-fcgi-0.8.5.tar.gz
|
|
117
|
-
Used for FCGI based applications.
|
|
118
|
-
|
|
119
|
-
* FastCGI development kit
|
|
120
|
-
http://www.fastcgi.com/dist/fcgi.tar.gz
|
|
121
|
-
Needed to compile the C-version of the ruby fcgi library.
|
data/ProjectInfo
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
--- %YAML:1.0
|
|
2
|
-
|
|
3
|
-
TITLE : &title Nitro
|
|
4
|
-
NAME : &pkg nitro
|
|
5
|
-
VERSION : '0.31.0'
|
|
6
|
-
STATUS : beta
|
|
7
|
-
|
|
8
|
-
AUTHOR : George Moschovitis
|
|
9
|
-
EMAIL : &email gm@navel.gr
|
|
10
|
-
HOMEPAGE : "http://www.nitroproject.org"
|
|
11
|
-
|
|
12
|
-
SUMMARY: Everything you need to create Web 2.0 applications with Ruby and Javascript
|
|
13
|
-
|
|
14
|
-
DESCRIPTION: >
|
|
15
|
-
Nitro provides everything you need to develop professional Web
|
|
16
|
-
applications using Ruby and Javascript. Nitro redefines Rapid
|
|
17
|
-
Application Development by providing a clean, yet efficient API,
|
|
18
|
-
a layer of domain specific languages implemented on top of
|
|
19
|
-
Ruby and the most powerful and elegant object relational
|
|
20
|
-
mapping solution available everywhere. Nitro is Web 2.0 ready,
|
|
21
|
-
featuring excellent support for AJAX, XML, Syndication while
|
|
22
|
-
staying standards compliant.
|
|
23
|
-
|
|
24
|
-
RUBYFORGE:
|
|
25
|
-
PROJECT: 'nitro'
|
|
26
|
-
USERNAME: 'gmosx'
|
|
27
|
-
|
|
28
|
-
DEPENDENCIES:
|
|
29
|
-
- [ og, '= 0.31.0' ]
|
|
30
|
-
- [ gen, '= 0.31.0' ]
|
|
31
|
-
- [ glue, '= 0.31.0' ]
|
|
32
|
-
- [ RedCloth, '= 3.0.3' ]
|
|
33
|
-
- [ ruby-breakpoint, '~> 0.5' ]
|
|
34
|
-
- [ daemons, '~> 0.4' ]
|
|
35
|
-
|
|
36
|
-
EXECUTABLES:
|
|
37
|
-
- nitro
|
|
38
|
-
|
|
39
|
-
PACKAGE: !!package
|
|
40
|
-
distribute: [ gem, tgz, zip ]
|
|
41
|
-
|
|
42
|
-
RDOC: !!rdoc
|
|
43
|
-
dir: rdoc
|
|
44
|
-
options: ['--all', '--inline-source']
|
|
45
|
-
include:
|
|
46
|
-
- 'lib/nitro/**/*'
|
|
47
|
-
- '[A-Z]*'
|
|
48
|
-
|
|
49
|
-
PUBLISH: !!publish
|
|
50
|
-
host: rubyforge
|
|
51
|
-
type: web
|
|
52
|
-
username: gmosx
|
|
53
|
-
project: nitro
|
|
54
|
-
dir: 'web'
|
|
55
|
-
|
|
56
|
-
TEST: !!test
|
|
57
|
-
libs:
|
|
58
|
-
- '../glue/lib'
|
|
59
|
-
- '../og/lib'
|
|
60
|
-
|
|
61
|
-
ANNOUNCE: !!announce
|
|
62
|
-
to: george.moschovitis@gmail.com
|
|
63
|
-
from: gm@navel.gr
|
|
64
|
-
domain: navel.gr
|
|
65
|
-
server: mail
|
|
66
|
-
port: 25 #587
|
|
67
|
-
account: gm@navel.gr
|
|
68
|
-
authtype: login #cram_md5 #plain
|
|
69
|
-
sectype: tls # ~, tls, ssl (tls is broke)
|
|
70
|
-
file: ANN
|
|
71
|
-
slogan: Nitro Web Engine
|
|
72
|
-
links:
|
|
73
|
-
- http://www.nitroproject.org
|
|
74
|
-
|
data/README
DELETED
|
@@ -1,555 +0,0 @@
|
|
|
1
|
-
= Nitro 0.30.0 README
|
|
2
|
-
|
|
3
|
-
Nitro provides everything you need to develop professional Web
|
|
4
|
-
applications using Ruby and Javascript.
|
|
5
|
-
|
|
6
|
-
Nitro redefines Rapid Application Development by providing a
|
|
7
|
-
clean, yet efficient API, a layer of domain specific languages
|
|
8
|
-
implemented on top of Ruby and the most powerful and elegant
|
|
9
|
-
object relational mapping solution available everywhere.
|
|
10
|
-
|
|
11
|
-
Nitro is Web 2.0 ready, featuring excellent support for AJAX,
|
|
12
|
-
XML, Syndication while staying standards compliant.
|
|
13
|
-
|
|
14
|
-
Nitro gives choice to the developer: Multiple paradigms are
|
|
15
|
-
implemented, incorporating ideas from Rails, CherryPy, Catalyst,
|
|
16
|
-
Wee, PHP, JSP and Microsoft.NET and more. The developer is free
|
|
17
|
-
to choose the pattern that better fits his application. This
|
|
18
|
-
kind of freedom makes Nitro applicable to a wide range of
|
|
19
|
-
applications, spanning from big, scalable web sites with thousands
|
|
20
|
-
of concurrent users to simple solutions for deployment on intranet
|
|
21
|
-
desktops.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
== Features
|
|
25
|
-
|
|
26
|
-
A short summary of the major features:
|
|
27
|
-
|
|
28
|
-
* Multiparadigm web applications.
|
|
29
|
-
|
|
30
|
-
You can write applications in the ASP/JSP/PHP style, ie by
|
|
31
|
-
writting server pages that are automatically translated to Ruby
|
|
32
|
-
code by Nitro.
|
|
33
|
-
|
|
34
|
-
Or, you can write MVC style applications (like Rails) by
|
|
35
|
-
utilizing the powerfull Object publishing/Controller mechanism.
|
|
36
|
-
|
|
37
|
-
Alternatively, you can use stateful components and/or programmatic
|
|
38
|
-
rendering: Nitro is the premium container for Wee applications.
|
|
39
|
-
|
|
40
|
-
* Advanced Code generation.
|
|
41
|
-
|
|
42
|
-
Nitro in essence writes the Web application for you. The system
|
|
43
|
-
provides a number of domain spefic language extensions (meta-languages)
|
|
44
|
-
to automate the generation of common code (OR mapping, validation,
|
|
45
|
-
forms generation, syndication, markup and more).
|
|
46
|
-
|
|
47
|
-
* Object-Relational Mapping
|
|
48
|
-
|
|
49
|
-
Nitro integrates the Og (ObjectGraph) object-relational mapping
|
|
50
|
-
library. Og manages the lifecycle of Ruby objects and provides
|
|
51
|
-
transparent serialization of object graphs to stores (typically
|
|
52
|
-
RDBM systems)/.
|
|
53
|
-
|
|
54
|
-
Unlike other similar solutions Og maps standard Ruby objects
|
|
55
|
-
to SQL tables and not vice versa. Og provides a domain specific
|
|
56
|
-
language to describe the relations between objects, a flexible
|
|
57
|
-
and intuitive api for querieng the database, raw access to the
|
|
58
|
-
SQL language if needed (for example to fine tune the automatically
|
|
59
|
-
generated SQL tables, or for custom queries), provides automatic
|
|
60
|
-
validation, suports deserialization to Ruby objects or tuples,
|
|
61
|
-
automatically generates join tables for many_to_many relations
|
|
62
|
-
and provides a collection of usefull Mixins to synthesize
|
|
63
|
-
common Entities.
|
|
64
|
-
|
|
65
|
-
Adapters for PostgreSQL, MySQL, SQLite3, Memory, KirbyBase,
|
|
66
|
-
Filesystem, Oracle and SQL Server are included.
|
|
67
|
-
|
|
68
|
-
* XML server pages (.xhtml)
|
|
69
|
-
|
|
70
|
-
Nitro uses standard, fully xml compliant xhtml pages with logic
|
|
71
|
-
code, thus combining the power of embededed Ruby (like erb, eruby)
|
|
72
|
-
with the xml compliance of Amrita. Even though it is a 'Callback'
|
|
73
|
-
style templating system it is flexible enough to run as 'Pipeline'
|
|
74
|
-
style system if the developer prefers this mode of operation.
|
|
75
|
-
|
|
76
|
-
<!-- example page -->
|
|
77
|
-
<html>
|
|
78
|
-
|
|
79
|
-
<?r
|
|
80
|
-
title = 'Example'
|
|
81
|
-
version = params['version']
|
|
82
|
-
?>
|
|
83
|
-
|
|
84
|
-
<h1>#{title}</h1>
|
|
85
|
-
|
|
86
|
-
<?r if version > 1 ?>
|
|
87
|
-
<b>Version:</b> #{version}
|
|
88
|
-
<?r end ?>
|
|
89
|
-
|
|
90
|
-
</html>
|
|
91
|
-
|
|
92
|
-
* Action / Fragment Synthesis
|
|
93
|
-
|
|
94
|
-
Nitro actions and templates can include other actions or templates
|
|
95
|
-
to allow for component-based development.
|
|
96
|
-
|
|
97
|
-
Here is an example of including an action from a template:
|
|
98
|
-
|
|
99
|
-
<render href="list" />
|
|
100
|
-
|
|
101
|
-
or
|
|
102
|
-
|
|
103
|
-
<inject href="list" />
|
|
104
|
-
|
|
105
|
-
or from an action:
|
|
106
|
-
|
|
107
|
-
list()
|
|
108
|
-
|
|
109
|
-
Nitro server pages can include fragments at 'Compile' time or at
|
|
110
|
-
'RunTime' time.
|
|
111
|
-
|
|
112
|
-
<!-- compile time include (static include) -->
|
|
113
|
-
<?include href="myfile.inc" ?>
|
|
114
|
-
|
|
115
|
-
<!-- run time include (dynamic include) -->
|
|
116
|
-
<include href="myfile.inc" />
|
|
117
|
-
|
|
118
|
-
* Nitro provides full support for Aspect Oriented programming.
|
|
119
|
-
You can use aspects to intercept and customize any component
|
|
120
|
-
of the Nitro system.
|
|
121
|
-
|
|
122
|
-
* Fully customizable Compile time and Render time pipeline.
|
|
123
|
-
Nitro features a fully programmable source transformation pipeline.
|
|
124
|
-
For example a pipeline component transforms a standard XHTML
|
|
125
|
-
document with embeded ruby-code processing instructions to Ruby
|
|
126
|
-
code. Another component could apply XSLT transformation at compile
|
|
127
|
-
time to avoid the performance hit. Using the advanced AOP features
|
|
128
|
-
or standard OOP practice you can customize the pipeline to your
|
|
129
|
-
needs.
|
|
130
|
-
|
|
131
|
-
The same is true for the run time render pipeline. Nitro makes
|
|
132
|
-
it exteremely easy to add filters or customize the behaviour
|
|
133
|
-
of actions. Example filters are the autologin filter,
|
|
134
|
-
a gzip filter etc.
|
|
135
|
-
|
|
136
|
-
* Excellent support for AJAX and Javascript. Nitro integrates
|
|
137
|
-
a set of powerful javascript libraries:
|
|
138
|
-
|
|
139
|
-
Prototype
|
|
140
|
-
Script.aculo.us
|
|
141
|
-
Behaviour
|
|
142
|
-
|
|
143
|
-
These libraries are transparently integrated in the rendering
|
|
144
|
-
pipeline.
|
|
145
|
-
|
|
146
|
-
* Elements subsystem. This is Tag libraries on steroids. You can
|
|
147
|
-
define xhtml tags that generate calls to associated Ruby classes
|
|
148
|
-
to handle rendering special fx, skins and more.
|
|
149
|
-
|
|
150
|
-
* Multiple Platforms
|
|
151
|
-
|
|
152
|
-
Runs on Linux, Windows and Mac OSX. It will probably run on other
|
|
153
|
-
Unix based system with minor modifications.
|
|
154
|
-
|
|
155
|
-
* Multiple Adapters
|
|
156
|
-
|
|
157
|
-
Nitro supports multiple web server configurations. Out of the box
|
|
158
|
-
it supports WEBrick (pure ruby), Lighttpd (fastcgi/scgi),
|
|
159
|
-
Apache (fastcgi / scgi). The prefered adapter is SCGI.
|
|
160
|
-
More options will be available in the future.
|
|
161
|
-
|
|
162
|
-
* Minimum configuration
|
|
163
|
-
|
|
164
|
-
Configuration files are kept to the absolute minimum. The target
|
|
165
|
-
is to have no configuration files at all.
|
|
166
|
-
|
|
167
|
-
* Scaffolding
|
|
168
|
-
|
|
169
|
-
This enables the developer to get started as fast as possible.
|
|
170
|
-
|
|
171
|
-
* Auto administration system.
|
|
172
|
-
|
|
173
|
-
Just one line of code automagically creates an administration
|
|
174
|
-
system for your web application:
|
|
175
|
-
|
|
176
|
-
require 'part/admin'
|
|
177
|
-
|
|
178
|
-
* Distributed State
|
|
179
|
-
|
|
180
|
-
Nitro provides a powerfull distributed state mechanism that utilizes
|
|
181
|
-
the DRb library. A typicall use of this infrastructure is to provide
|
|
182
|
-
distributed sessions when running your application over a server
|
|
183
|
-
cluster. Distributed sessions are fully transparent to the developer.
|
|
184
|
-
|
|
185
|
-
* Scalability.
|
|
186
|
-
|
|
187
|
-
Nitro promotes the 'share-nothing' architecture pioneered in sites
|
|
188
|
-
like Yahoo, LiveJournal, Slashdot, etc to facilate easy scaling
|
|
189
|
-
through hardware.
|
|
190
|
-
|
|
191
|
-
* Parts
|
|
192
|
-
|
|
193
|
-
Parts are organized modules of web services. A Web Framework that
|
|
194
|
-
integrates a large collection of parts (User management, Blog,
|
|
195
|
-
Fora, CMS, Personalization, ..) will be released by Navel.
|
|
196
|
-
|
|
197
|
-
* Web services
|
|
198
|
-
|
|
199
|
-
Nitro automates the process of web service development. Just let
|
|
200
|
-
Nitro's advanced scaffolding algorithms to generate the boilerplate
|
|
201
|
-
code for you.
|
|
202
|
-
|
|
203
|
-
* Fine-grained Caching
|
|
204
|
-
|
|
205
|
-
Nitro provides a well designed and efficient caching mechanism. Caching
|
|
206
|
-
will be provided at the following levels:
|
|
207
|
-
|
|
208
|
-
Object Cache (deserialized objects) (coming soon)
|
|
209
|
-
Fragment Caching (cache generated sub-parts of a page, or a page)
|
|
210
|
-
Action Caching (full pages)
|
|
211
|
-
Output Caching (the whole page is stored as html and served by
|
|
212
|
-
the front web server, thus completely bypassing Nitro)
|
|
213
|
-
HTTP 1.1 Caching (downstream caching of whole pages)
|
|
214
|
-
|
|
215
|
-
A variety of invalidation strategies can be implemented.
|
|
216
|
-
|
|
217
|
-
* Programmatic xhtml rendering.
|
|
218
|
-
|
|
219
|
-
labels = ['George', 'Stella', 'Renos']
|
|
220
|
-
html {
|
|
221
|
-
head {
|
|
222
|
-
title 'A simple test'
|
|
223
|
-
}
|
|
224
|
-
body {
|
|
225
|
-
10.times {
|
|
226
|
-
strong 'Hello World'
|
|
227
|
-
i 'Hello World222'
|
|
228
|
-
}
|
|
229
|
-
select(:id => 'names') {
|
|
230
|
-
options :labels => labels, :selected => 1
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
* Automatic validation.
|
|
235
|
-
|
|
236
|
-
class User
|
|
237
|
-
prop_accessor :name, :password, String
|
|
238
|
-
validate_confirmation :password
|
|
239
|
-
validate_length :name, :range => 2..12
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
u = User.new(...)
|
|
243
|
-
unless u.valid?
|
|
244
|
-
p u.errors.on(:name)
|
|
245
|
-
p u.errors[:password]
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
* Excellent support for Test Driven Development and Testing.
|
|
249
|
-
Nitro provides full support for fixtures, mocking and a set
|
|
250
|
-
of custom assertions for testing everything, from controller
|
|
251
|
-
logic to your models.
|
|
252
|
-
|
|
253
|
-
* Implicit nice urls. Nitro automatically generates nice urls
|
|
254
|
-
for your actions. However, if you want to customize the defaults,
|
|
255
|
-
a powerful routing mechanism is provided.
|
|
256
|
-
|
|
257
|
-
* Advanced debuging features
|
|
258
|
-
|
|
259
|
-
When running in debug mode, all exceptions raised are logged
|
|
260
|
-
to a special debug panel in the current page. Find out the offending
|
|
261
|
-
file and line from the exception dump, fix the bug, refresh the page.
|
|
262
|
-
|
|
263
|
-
in-process console: inject an irb session to a running application
|
|
264
|
-
server. You can use the irb console to investigate all variables
|
|
265
|
-
and code in your running server process.
|
|
266
|
-
|
|
267
|
-
integrates the 'breakpoint' library by Florian Gross. The Breakpoint
|
|
268
|
-
library provides the convenience of being able to inspect and modify
|
|
269
|
-
state, diagnose bugs all via IRB by simply setting breakpoints in
|
|
270
|
-
your applications by the call of a method.
|
|
271
|
-
|
|
272
|
-
* Helper mixins
|
|
273
|
-
|
|
274
|
-
Nitro is distributed with a collection of usefull mixins
|
|
275
|
-
to make form based application development easier (for example
|
|
276
|
-
an efficient, database-aware Pager component).
|
|
277
|
-
|
|
278
|
-
* Localization
|
|
279
|
-
|
|
280
|
-
Nitro supports efficient and fully transparent localization of
|
|
281
|
-
web applications.
|
|
282
|
-
|
|
283
|
-
* Morphing
|
|
284
|
-
|
|
285
|
-
Nitro provides revolutionary morphing capabilities. You can
|
|
286
|
-
easily add extra attributes to standard html tags or create
|
|
287
|
-
new tags.
|
|
288
|
-
|
|
289
|
-
Here are some example morpher (included by default):
|
|
290
|
-
|
|
291
|
-
<div id="mydiv" draggable="true">...
|
|
292
|
-
|
|
293
|
-
makes this div draggable using Scriptaculous.
|
|
294
|
-
|
|
295
|
-
<li for="photo in photos">#{photo.title}</li>
|
|
296
|
-
|
|
297
|
-
generates
|
|
298
|
-
|
|
299
|
-
<? for photo in photos ?>
|
|
300
|
-
<li>#{photo.title}</li>
|
|
301
|
-
<? end ?>
|
|
302
|
-
|
|
303
|
-
and much much more. Your imagination is the limit.
|
|
304
|
-
|
|
305
|
-
* Mailer
|
|
306
|
-
|
|
307
|
-
Nitro provides excellent support for handling emails in your
|
|
308
|
-
Web application. Both incoming and outgoing email support is
|
|
309
|
-
provided.
|
|
310
|
-
|
|
311
|
-
* Wee integration.
|
|
312
|
-
|
|
313
|
-
Nitro is the premium container for Wee stateful components.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
== What's new
|
|
317
|
-
|
|
318
|
-
For information about the latest changes please consult the
|
|
319
|
-
file
|
|
320
|
-
|
|
321
|
-
doc/RELEASES
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
== Download
|
|
325
|
-
|
|
326
|
-
The latest version of Nitro can be found at
|
|
327
|
-
|
|
328
|
-
* http://www.nitroproject.org
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
== Documentation
|
|
332
|
-
|
|
333
|
-
Documentation for Nitro can be found at
|
|
334
|
-
|
|
335
|
-
* http://www.nitroproject.org
|
|
336
|
-
|
|
337
|
-
Don't forget to read the file doc/RELEASES for usefull
|
|
338
|
-
documentation bits. Also, have a look at the test cases in
|
|
339
|
-
the test directory for examples of usage.
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
== Videos / Screencasts
|
|
343
|
-
|
|
344
|
-
A number of videos that demonstrate Nitro in practical usage
|
|
345
|
-
are available here:
|
|
346
|
-
|
|
347
|
-
http://www.nitroproject.org/view/Videos
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
== Requirements
|
|
351
|
-
|
|
352
|
-
Nitro requires the following applications or libraries:
|
|
353
|
-
|
|
354
|
-
* Ruby 1.8.1 and greater
|
|
355
|
-
http://www.ruby-lang.org
|
|
356
|
-
Version 1.8.2 is recomended
|
|
357
|
-
|
|
358
|
-
* Nano Methods / Mega classes
|
|
359
|
-
http://nano.rubyforge.org
|
|
360
|
-
http://mega.rubyforge.org
|
|
361
|
-
|
|
362
|
-
The following applications or libraries are OPTIONAL:
|
|
363
|
-
|
|
364
|
-
* PostgreSQL
|
|
365
|
-
http://www.postgres.org
|
|
366
|
-
Used for Database driven web applications.
|
|
367
|
-
|
|
368
|
-
* MySQL
|
|
369
|
-
http://www.mysql.org
|
|
370
|
-
Used for Database driven web applications.
|
|
371
|
-
|
|
372
|
-
* Ruby-psql
|
|
373
|
-
http://www.postgresql.jp/interfaces/ruby/archive/ruby-postgres-0.7.1.tar.gz
|
|
374
|
-
Ruby interface to the PostgreSQL RDBMS.
|
|
375
|
-
|
|
376
|
-
* Ruby-mysql
|
|
377
|
-
http://tmtm.org/ja/ruby/mysql/README_en.html
|
|
378
|
-
Ruby interface to the MySQL RDBMS.
|
|
379
|
-
|
|
380
|
-
* Ruby-XSLT
|
|
381
|
-
http://gregoire.lejeune.free.fr/ruby-xslt_0.4.0.tar.gz
|
|
382
|
-
Used for XSLT based templates.
|
|
383
|
-
|
|
384
|
-
* Apache 2.0
|
|
385
|
-
http://www.apache.org
|
|
386
|
-
Used to host application in production environments.
|
|
387
|
-
|
|
388
|
-
* Lighttpd
|
|
389
|
-
http://www.lighttpd.net/
|
|
390
|
-
A lean and efficient web server. A perfect companion to Nitro.
|
|
391
|
-
|
|
392
|
-
* Ruby-fcgi
|
|
393
|
-
http://www.moonwolf.com/ruby/archive/ruby-fcgi-0.8.5.tar.gz
|
|
394
|
-
Used for FCGI based applications.
|
|
395
|
-
|
|
396
|
-
* FastCGI development kit
|
|
397
|
-
http://www.fastcgi.com/dist/fcgi.tar.gz
|
|
398
|
-
Needed to compile the C-version of the ruby fcgi library.
|
|
399
|
-
|
|
400
|
-
* RedCloth
|
|
401
|
-
http://rubyforge.org/projects/redcloth/
|
|
402
|
-
|
|
403
|
-
Please install the required applications and libraries before continuing
|
|
404
|
-
with the installation of Nitro.
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
== Instalation
|
|
408
|
-
|
|
409
|
-
Nitro is distributed as a RubyGem. First of all make sure you have
|
|
410
|
-
installed RubyGems on your system. Then run the following command:
|
|
411
|
-
|
|
412
|
-
gem install nitro
|
|
413
|
-
|
|
414
|
-
(make sure you have the latest stable versions of Ruby and RubyGems
|
|
415
|
-
installed)
|
|
416
|
-
|
|
417
|
-
Then try to run the examples/tiny Example application.
|
|
418
|
-
|
|
419
|
-
A tar.gz distribution is also available on http://www.rubyforge.com/projects/nitro
|
|
420
|
-
This distribution is intended to allow developers to get a
|
|
421
|
-
quick look at the platform. For real development please use
|
|
422
|
-
the gem distribution.
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
== Running the example applications
|
|
426
|
-
|
|
427
|
-
* examples/tiny
|
|
428
|
-
|
|
429
|
-
A simple application that requires no external applications
|
|
430
|
-
|
|
431
|
-
$ cd nitro/examples/tiny
|
|
432
|
-
|
|
433
|
-
$ vi conf/apache.conf
|
|
434
|
-
|
|
435
|
-
edit user, group,DocumentRoot root as needed.
|
|
436
|
-
|
|
437
|
-
or
|
|
438
|
-
|
|
439
|
-
$vi conf/lhttpd.conf
|
|
440
|
-
|
|
441
|
-
edit as needed, or edit
|
|
442
|
-
|
|
443
|
-
$ vi run.rb
|
|
444
|
-
|
|
445
|
-
$ ruby run.rb
|
|
446
|
-
|
|
447
|
-
browse http://127.0.0.1:9999
|
|
448
|
-
|
|
449
|
-
* examples/blog
|
|
450
|
-
|
|
451
|
-
A simple Blog application to demonstrate xsl skins, Og models,
|
|
452
|
-
xml dispatchers and more.
|
|
453
|
-
|
|
454
|
-
$ cd nitro/examples/blog
|
|
455
|
-
|
|
456
|
-
$ vi conf/apache.conf
|
|
457
|
-
$ vi conf/lhttpd.conf
|
|
458
|
-
|
|
459
|
-
edit the configuration as needed.
|
|
460
|
-
|
|
461
|
-
$ vi run.rb
|
|
462
|
-
|
|
463
|
-
edit the postgresql user and password
|
|
464
|
-
|
|
465
|
-
if you wan to run this application with MySQL
|
|
466
|
-
edit the configuration file to include
|
|
467
|
-
|
|
468
|
-
{
|
|
469
|
-
...
|
|
470
|
-
:backend => "mysql"
|
|
471
|
-
...
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
instead.
|
|
475
|
-
|
|
476
|
-
there is no need to initialize the database, Og automatically
|
|
477
|
-
takes cate of this.
|
|
478
|
-
|
|
479
|
-
$ ruby run.rb
|
|
480
|
-
|
|
481
|
-
this script starts the the blog application using the WEBrick
|
|
482
|
-
adapter.
|
|
483
|
-
|
|
484
|
-
browse http://127.0.0.1:9999
|
|
485
|
-
|
|
486
|
-
You can run the application in debug mode with the following
|
|
487
|
-
command:
|
|
488
|
-
|
|
489
|
-
$ ruby run.rb --debug
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
== Debuging Nitro applications
|
|
493
|
-
|
|
494
|
-
Have "tail -f" commands running on log/app.log in your application
|
|
495
|
-
directory. Nitro will automatically display debugging and runtime
|
|
496
|
-
information to these files. Debugging info will also be shown in the
|
|
497
|
-
browser when running in debug mode.
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
== Description of contents
|
|
501
|
-
|
|
502
|
-
bin
|
|
503
|
-
Commands and wizards.
|
|
504
|
-
|
|
505
|
-
examples/
|
|
506
|
-
Various examples. 'tiny' is a minimal example, 'blog' is a
|
|
507
|
-
fully working and nice looking Blog implementation, 'no_xsl_blog'
|
|
508
|
-
is the same example without using XSLT, 'og' contains some Og
|
|
509
|
-
examples and 'flash' is an example for generating binary content
|
|
510
|
-
for a Nitro response.
|
|
511
|
-
|
|
512
|
-
lib/nitro
|
|
513
|
-
Nitro library source files.
|
|
514
|
-
|
|
515
|
-
test
|
|
516
|
-
Unit and functional tests.
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
== Running Tests
|
|
520
|
-
|
|
521
|
-
The easiest way to run the included unit tests is through Rake:
|
|
522
|
-
|
|
523
|
-
$ rake test_all
|
|
524
|
-
|
|
525
|
-
runs all the tests including database tests.
|
|
526
|
-
|
|
527
|
-
$ rake test
|
|
528
|
-
|
|
529
|
-
runs all tests except the database tests.
|
|
530
|
-
|
|
531
|
-
Rake can be found at http://rake.rubyforge.org
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
== Support
|
|
535
|
-
|
|
536
|
-
For any questions regarding Nitro, feel free to ask on the ruby-talk
|
|
537
|
-
mailing list (which is mirrored to comp.lang.ruby) or contact
|
|
538
|
-
mailto:gm@navel.gr.
|
|
539
|
-
|
|
540
|
-
A Nitro specific mailing list is also available. Please subscribe
|
|
541
|
-
to nitro-general@rubyforge.com. The homepage for this list
|
|
542
|
-
is available here:
|
|
543
|
-
|
|
544
|
-
http://rubyforge.org/mailman/listinfo/nitro-general
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
== Licence
|
|
548
|
-
|
|
549
|
-
Copyright (c) 2004-2006, George 'gmosx' Moschovitis (http://www.gmosx.com)
|
|
550
|
-
Copyright (c) 2004-2006, Navel Ltd (http://www.navel.gr)
|
|
551
|
-
|
|
552
|
-
Nitro (http://www.nitroproject.org) is copyrighted free software
|
|
553
|
-
created and maintained by George Moschovitis (mailto:gm@navel.gr)
|
|
554
|
-
and released under the standard BSD Licence. For details consult
|
|
555
|
-
the file LICENCE.
|