nitro 0.28.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +382 -0
- data/ProjectInfo +4 -4
- data/README +1 -1
- data/doc/AUTHORS +15 -15
- data/doc/MIGRATION +13 -0
- data/doc/RELEASES +102 -0
- data/lib/glue/sweeper.rb +1 -1
- data/lib/nitro.rb +38 -9
- data/lib/nitro/adapter/acgi.rb +1 -3
- data/lib/nitro/adapter/cgi.rb +1 -1
- data/lib/nitro/adapter/fastcgi.rb +1 -3
- data/lib/nitro/adapter/mongrel.rb +8 -6
- data/lib/nitro/adapter/webrick.rb +1 -2
- data/lib/nitro/cgi.rb +1 -1
- data/lib/nitro/compiler.rb +21 -40
- data/lib/nitro/compiler/elements.rb +72 -32
- data/lib/nitro/compiler/errors.rb +92 -42
- data/lib/nitro/compiler/include.rb +47 -17
- data/lib/nitro/compiler/morphing.rb +1 -3
- data/lib/nitro/compiler/script.rb +2 -2
- data/lib/nitro/context.rb +36 -0
- data/lib/nitro/controller.rb +140 -31
- data/lib/nitro/dispatcher.rb +27 -28
- data/lib/nitro/element.rb +52 -15
- data/lib/nitro/flash.rb +44 -0
- data/lib/nitro/helper/buffer.rb +0 -2
- data/lib/nitro/helper/form.rb +2 -2
- data/lib/nitro/helper/form/controls.rb +14 -3
- data/lib/nitro/helper/pager.rb +1 -1
- data/lib/nitro/helper/table.rb +4 -3
- data/lib/nitro/helper/xml.rb +1 -1
- data/lib/nitro/part.rb +20 -0
- data/lib/nitro/render.rb +44 -5
- data/lib/nitro/router.rb +81 -0
- data/lib/nitro/scaffolding.rb +24 -23
- data/lib/nitro/server.rb +12 -1
- data/lib/nitro/server/runner.rb +12 -0
- data/lib/nitro/session.rb +3 -12
- data/lib/nitro/session/drb.rb +2 -5
- data/lib/nitro/session/file.rb +2 -2
- data/lib/nitro/session/memcached.rb +14 -0
- data/lib/nitro/session/memory.rb +3 -26
- data/lib/nitro/session/og.rb +1 -1
- data/lib/nitro/test/assertions.rb +1 -1
- data/lib/nitro/test/context.rb +8 -2
- data/lib/nitro/test/testcase.rb +16 -7
- data/proto/public/error.xhtml +58 -21
- data/proto/public/js/controls.js +60 -15
- data/proto/public/js/dragdrop.js +105 -16
- data/proto/public/js/effects.js +19 -12
- data/proto/public/js/scriptaculous.js +1 -1
- data/proto/public/js/slider.js +2 -2
- data/proto/public/js/unittest.js +29 -20
- data/proto/public/scaffold/edit.xhtml +1 -1
- data/proto/public/scaffold/index.xhtml +2 -2
- data/proto/public/scaffold/list.xhtml +2 -2
- data/proto/public/scaffold/new.xhtml +1 -1
- data/proto/public/scaffold/search.xhtml +1 -1
- data/src/part/admin/controller.rb +5 -5
- data/src/part/admin/template/index.xhtml +2 -2
- data/test/nitro/compiler/tc_compiler.rb +23 -0
- data/test/nitro/helper/tc_table.rb +35 -0
- data/test/nitro/tc_cgi.rb +1 -1
- data/test/nitro/tc_controller.rb +3 -3
- data/test/nitro/tc_controller_aspect.rb +2 -0
- data/test/nitro/tc_dispatcher.rb +10 -1
- data/test/nitro/tc_flash.rb +14 -0
- data/test/nitro/tc_router.rb +58 -0
- data/test/nitro/tc_session.rb +26 -9
- metadata +13 -12
- data/lib/nitro/routing.rb +0 -41
- data/test/nitro/caching/tc_stores.rb +0 -17
- data/test/nitro/tc_table.rb +0 -66
data/test/nitro/tc_table.rb
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'nitro/helper/table'
|
5
|
-
|
6
|
-
class TC_TableHelper < Test::Unit::TestCase # :nodoc: all
|
7
|
-
include Nitro
|
8
|
-
include TableHelper
|
9
|
-
|
10
|
-
User = Struct.new(:name, :password, :email)
|
11
|
-
|
12
|
-
def setup
|
13
|
-
@headers = %w{Name Password Email}
|
14
|
-
@users = [
|
15
|
-
User.new('gmosx', 'huh?', 'gm@nowhere.com'),
|
16
|
-
User.new('renos', 'nah', 'renos@nowhere.com'),
|
17
|
-
User.new('stella', 'hoh', 'stella@love.com')
|
18
|
-
]
|
19
|
-
end
|
20
|
-
|
21
|
-
def teardown
|
22
|
-
@users = nil
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_table
|
26
|
-
values = @users.collect { |u| [u.name, u.password, u.email] }
|
27
|
-
table = build_table(:id => 'test', :headers => @headers, :values => values)
|
28
|
-
res = %|<table id="test"><tr><th>Name</th><th>Password</th><th>Email</th></tr><tr><td>gmosx</td><td>huh?</td><td>gm@nowhere.com</td></tr><tr><td>renos</td><td>nah</td><td>renos@nowhere.com</td></tr><tr><td>stella</td><td>hoh</td><td>stella@love.com</td></tr></table>|
|
29
|
-
assert_equal res, table
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_table_footer
|
33
|
-
values = @users.collect { |u| [u.name, u.password, u.email] }
|
34
|
-
footers = ["#{@users.size}users", '', '']
|
35
|
-
|
36
|
-
table = build_table(:id => 'test2', :headers => @headers, :values => values, :footers => footers)
|
37
|
-
|
38
|
-
res = %|<table id="test2"><thead><tr><th>Name</th><th>Password</th><th>Email</th></tr></thead><tfoot><tr><td>3users</td><td></td><td></td></tr></tfoot><tr><td>gmosx</td><td>huh?</td><td>gm@nowhere.com</td></tr><tr><td>renos</td><td>nah</td><td>renos@nowhere.com</td></tr><tr><td>stella</td><td>hoh</td><td>stella@love.com</td></tr></table>|
|
39
|
-
assert_equal res, table
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_table_tbody
|
43
|
-
values = []
|
44
|
-
values << @users[0...1].collect { |u| [u.name, u.password, u.email] }
|
45
|
-
values << @users[1..2].collect { |u| [u.name, u.password, u.email] }
|
46
|
-
table = build_table(:id => 'test', :headers => @headers, :values => values)
|
47
|
-
res = %|<table id="test"><thead><tr><th>Name</th><th>Password</th><th>Email</th></tr></thead><tbody><tr><td>gmosx</td><td>huh?</td><td>gm@nowhere.com</td></tr></tbody><tbody><tr><td>renos</td><td>nah</td><td>renos@nowhere.com</td></tr><tr><td>stella</td><td>hoh</td><td>stella@love.com</td></tr></tbody></table>|
|
48
|
-
assert_equal res, table
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_table_alternating_rows
|
52
|
-
values = @users.collect { |u| [u.name, u.password, u.email] }
|
53
|
-
table = build_table(:id => 'test', :headers => @headers, :values => values, :alternating_rows => true)
|
54
|
-
res = %|<table id="test"><tr><th>Name</th><th>Password</th><th>Email</th></tr><tr class="row_odd"><td>gmosx</td><td>huh?</td><td>gm@nowhere.com</td></tr><tr class="row_even"><td>renos</td><td>nah</td><td>renos@nowhere.com</td></tr><tr class="row_odd"><td>stella</td><td>hoh</td><td>stella@love.com</td></tr></table>|
|
55
|
-
assert_equal res, table
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_table_alternating_rows_tbody
|
59
|
-
values = []
|
60
|
-
values << @users[0...1].collect { |u| [u.name, u.password, u.email] }
|
61
|
-
values << @users[1..2].collect { |u| [u.name, u.password, u.email] }
|
62
|
-
table = build_table(:id => 'test', :headers => @headers, :values => values, :alternating_rows => true)
|
63
|
-
res = %|<table id="test"><thead><tr><th>Name</th><th>Password</th><th>Email</th></tr></thead><tbody><tr class="row_odd"><td>gmosx</td><td>huh?</td><td>gm@nowhere.com</td></tr></tbody><tbody><tr class="row_even"><td>renos</td><td>nah</td><td>renos@nowhere.com</td></tr><tr class="row_odd"><td>stella</td><td>hoh</td><td>stella@love.com</td></tr></tbody></table>|
|
64
|
-
assert_equal res, table
|
65
|
-
end
|
66
|
-
end
|