ramaze 0.3.0 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -2
- data/bin/ramaze +9 -3
- data/doc/AUTHORS +6 -2
- data/doc/CHANGELOG +272 -66
- data/doc/GPL +12 -13
- data/doc/README.html +729 -0
- data/doc/changes.txt +5757 -0
- data/doc/changes.xml +5759 -0
- data/doc/meta/announcement.txt +48 -39
- data/doc/tutorial/todolist.mkd +10 -12
- data/examples/blog/start.rb +1 -0
- data/examples/caching.rb +1 -0
- data/examples/element.rb +3 -0
- data/examples/hello.rb +1 -3
- data/examples/identity.rb +5 -8
- data/examples/layout.rb +1 -0
- data/examples/linking.rb +1 -0
- data/examples/memleak_detector.rb +1 -0
- data/examples/nitro_form.rb +1 -0
- data/examples/rammit/start.rb +1 -0
- data/examples/rapaste/Rakefile +7 -0
- data/examples/rapaste/{src/controller.rb → controller/paste.rb} +28 -3
- data/examples/rapaste/{src/model.rb → model/paste.rb} +0 -4
- data/examples/rapaste/public/css/display.css +17 -0
- data/examples/rapaste/spec/rapaste.rb +2 -2
- data/examples/rapaste/start.rb +9 -4
- data/examples/rapaste/{template → view}/copy.xhtml +0 -0
- data/examples/rapaste/{template → view}/index.xhtml +0 -0
- data/examples/rapaste/{template → view}/layout.xhtml +3 -0
- data/examples/rapaste/{template → view}/list.xhtml +4 -3
- data/examples/rapaste/view/search.xhtml +41 -0
- data/examples/rapaste/{template → view}/view.xhtml +0 -0
- data/examples/simple.rb +3 -3
- data/examples/templates/template/external.amrita +9 -9
- data/examples/templates/template/external.redcloth +19 -0
- data/examples/templates/template_amrita2.rb +40 -7
- data/examples/templates/template_erubis.rb +3 -3
- data/examples/templates/template_ezamar.rb +1 -3
- data/examples/templates/template_haml.rb +1 -3
- data/examples/templates/template_liquid.rb +3 -3
- data/examples/templates/template_markaby.rb +1 -3
- data/examples/templates/template_nagoro.rb +1 -3
- data/examples/templates/template_redcloth.rb +59 -0
- data/examples/templates/template_remarkably.rb +1 -3
- data/examples/templates/template_xslt.rb +1 -4
- data/examples/todolist/src/controller/main.rb +1 -1
- data/examples/todolist/start.rb +1 -2
- data/examples/upload/start.rb +19 -0
- data/examples/upload/view/index.xhtml +25 -0
- data/examples/whywiki/start.rb +1 -3
- data/examples/wikore/start.rb +3 -0
- data/examples/wiktacular/mkd/newpagename/current.mkd +1 -0
- data/examples/wiktacular/mkd/newpagename/current.mkd.bak +1 -0
- data/examples/wiktacular/start.rb +1 -0
- data/lib/proto/controller/main.rb +0 -3
- data/lib/proto/public/js/jquery.js +106 -93
- data/lib/proto/spec/main.rb +2 -5
- data/lib/proto/start.rb +0 -3
- data/lib/ramaze.rb +3 -2
- data/lib/ramaze/action.rb +6 -10
- data/lib/ramaze/adapter/lsws.rb +19 -0
- data/lib/ramaze/contrib/email.rb +84 -0
- data/lib/ramaze/contrib/email.rb-darcs-backup0 +81 -0
- data/lib/ramaze/contrib/gettext.rb +1 -0
- data/lib/ramaze/contrib/gettext/parser.rb +46 -0
- data/lib/ramaze/contrib/route.rb +3 -36
- data/lib/ramaze/controller.rb +4 -6
- data/lib/ramaze/controller/resolve.rb +28 -1
- data/lib/ramaze/dispatcher.rb +1 -1
- data/lib/ramaze/dispatcher/file.rb +17 -0
- data/lib/ramaze/global/globalstruct.rb +7 -4
- data/lib/ramaze/helper/auth.rb +1 -1
- data/lib/ramaze/helper/identity.rb +25 -15
- data/lib/ramaze/helper/link.rb +29 -8
- data/lib/ramaze/helper/maruku.rb +7 -0
- data/lib/ramaze/helper/partial.rb +25 -10
- data/lib/ramaze/route.rb +56 -0
- data/lib/ramaze/snippets/metaid.rb +17 -0
- data/lib/ramaze/spec/helper.rb +0 -2
- data/lib/ramaze/spec/helper/mock_http.rb +6 -0
- data/lib/ramaze/spec/helper/pretty_output.rb +5 -1
- data/lib/ramaze/store/default.rb +3 -1
- data/lib/ramaze/template.rb +1 -1
- data/lib/ramaze/template/amrita2.rb +21 -15
- data/lib/ramaze/template/bijou.rb +39 -0
- data/lib/ramaze/template/builder.rb +28 -0
- data/lib/ramaze/template/redcloth.rb +24 -0
- data/lib/ramaze/template/sass.rb +3 -1
- data/lib/ramaze/tool/create.rb +2 -1
- data/lib/ramaze/tool/localize.rb +6 -1
- data/lib/ramaze/trinity/request.rb +8 -0
- data/lib/ramaze/trinity/session.rb +8 -5
- data/lib/ramaze/version.rb +1 -1
- data/rake_tasks/gem.rake +0 -1
- data/rake_tasks/maintenance.rake +4 -1
- data/spec/contrib/route.rb +14 -63
- data/spec/examples/linking.rb +2 -2
- data/spec/examples/templates/template_redcloth.rb +28 -0
- data/spec/ramaze/controller/subclass.rb +21 -0
- data/spec/ramaze/dispatcher/file.rb +31 -0
- data/spec/ramaze/helper/link.rb +46 -0
- data/spec/ramaze/helper/partial.rb +22 -1
- data/spec/ramaze/helper/template/locals.xhtml +1 -0
- data/spec/ramaze/helper/template/recursive_locals.xhtml +7 -0
- data/spec/ramaze/params.rb +8 -0
- data/spec/ramaze/request.rb +14 -0
- data/spec/ramaze/route.rb +107 -0
- data/spec/ramaze/session.rb +4 -2
- data/spec/ramaze/template/amrita2.rb +21 -7
- data/spec/ramaze/template/amrita2/external.amrita +6 -0
- data/spec/ramaze/template/amrita2/sum.amrita +1 -1
- data/spec/ramaze/template/bijou.rb +25 -0
- data/spec/ramaze/template/builder.rb +55 -0
- data/spec/ramaze/template/builder/external.rxml +3 -0
- data/spec/ramaze/template/haml.rb +15 -0
- data/spec/ramaze/template/haml/locals.haml +1 -0
- data/spec/ramaze/template/redcloth.rb +38 -0
- data/spec/ramaze/template/redcloth/external.redcloth +1 -0
- metadata +472 -442
- data/examples/rapaste/rapaste.sqlite +0 -0
- data/spec/ramaze/template/amrita2/data.amrita +0 -6
- data/spec/ramaze/template/amrita2/index.amrita +0 -1
@@ -7,9 +7,10 @@
|
|
7
7
|
<div class="item">
|
8
8
|
<div class="item_meta">
|
9
9
|
<a href="/#{paste.id}">
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
<span class="paste_id">#{paste.id}</span>
|
11
|
+
<span class="syntax">#{paste.syntax_name}</span>
|
12
|
+
<span class="created">created #{time_diff(paste.created)} ago</span>
|
13
|
+
</a>
|
13
14
|
</div>
|
14
15
|
<div class="fragment">#{paste.text_fragment(@style)}</div>
|
15
16
|
<?r if paste.lines[11,1] ?>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<?r if @pastes ?>
|
2
|
+
|
3
|
+
<h3>Search Results</h3>
|
4
|
+
|
5
|
+
<?r if @pastes.empty? ?>
|
6
|
+
<div>
|
7
|
+
No pastes matched your search criteria.
|
8
|
+
</div>
|
9
|
+
<?r if Paste.empty? ?>
|
10
|
+
<p class="list_empty">
|
11
|
+
There are no pastes at all yet! Go on and <a href="#{Rs(:/)}">Add one</a>.
|
12
|
+
</p>
|
13
|
+
<?r end ?>
|
14
|
+
<?r else ?>
|
15
|
+
|
16
|
+
<div id="list_head">
|
17
|
+
Total search results: #{@pastes.size}
|
18
|
+
<?r if @hit_limit ?>(maximum)<?r end ?>
|
19
|
+
</div>
|
20
|
+
<div class="list">
|
21
|
+
<?r @pastes.each do |paste| ?>
|
22
|
+
<div class="item">
|
23
|
+
<div class="item_meta">
|
24
|
+
<a href="/#{paste.id}">
|
25
|
+
<span class="syntax">#{paste.syntax_name}</span>
|
26
|
+
<span class="created">created #{time_diff(paste.created)} ago</span>
|
27
|
+
</a>
|
28
|
+
</div>
|
29
|
+
<div class="fragment">#{paste.text_fragment(@style)}</div>
|
30
|
+
<?r if paste.lines[11,1] ?>
|
31
|
+
<div class="more"><a href="/#{paste.id}">more...</a></div>
|
32
|
+
<?r else ?>
|
33
|
+
<div class="more"><a href="/#{paste.id}">show...</a></div>
|
34
|
+
<?r end ?>
|
35
|
+
</div>
|
36
|
+
<?r end ?>
|
37
|
+
</table>
|
38
|
+
|
39
|
+
<?r end ?>
|
40
|
+
|
41
|
+
<?r end ?>
|
File without changes
|
data/examples/simple.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
-
|
1
|
+
require 'rubygems'
|
4
2
|
require 'ramaze'
|
5
3
|
|
6
4
|
# A very simple little application, you can simply run it and
|
@@ -54,3 +52,5 @@ class OtherController < Ramaze::Controller
|
|
54
52
|
"Hello, World from #{self.class.name}"
|
55
53
|
end
|
56
54
|
end
|
55
|
+
|
56
|
+
Ramaze.start
|
@@ -3,17 +3,17 @@
|
|
3
3
|
<title>Template::Amrita2 external</title>
|
4
4
|
</head>
|
5
5
|
<body>
|
6
|
-
<h1
|
7
|
-
|
6
|
+
<h1 am:src="title" />
|
7
|
+
<%= link_home %>
|
8
8
|
<p>
|
9
9
|
Here you can pass some stuff if you like, parameters are just passed like this:<br />
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
<%= link_one %><br />
|
11
|
+
<%= link_two %><br />
|
12
|
+
<%= link_three %>
|
13
13
|
</p>
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
<<div<
|
15
|
+
<<:args<
|
16
|
+
<span><%= $_ %></span>
|
17
|
+
<%= inspect_parameters %>
|
18
18
|
</body>
|
19
19
|
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
h1. The <%= @place %> Template for RedCloth
|
2
|
+
|
3
|
+
"Home":<%= Rs(:/) %>
|
4
|
+
|
5
|
+
Here you can pass some stuff if you like, parameters are just passed like this:<br />
|
6
|
+
"<%= @place %>/one":<%= Rs(@place, :one) %><br />
|
7
|
+
"<%= @place %>/two/three":<%= Rs(@place, :two, :three) %><br />
|
8
|
+
"<%= @place %>/one?foo=bar":<%= Rs(@place, :foo => :bar) %>
|
9
|
+
|
10
|
+
The arguments you have passed to this action are:<br />
|
11
|
+
<% if @args.empty? %>
|
12
|
+
none
|
13
|
+
<% else %>
|
14
|
+
<% @args.each do |arg| %>
|
15
|
+
<span><%= arg %></span>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%= request.params.inspect %>
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
-
|
1
|
+
require 'rubygems'
|
4
2
|
require 'ramaze'
|
5
3
|
|
6
4
|
# TODO:
|
@@ -10,10 +8,45 @@ class MainController < Ramaze::Controller
|
|
10
8
|
template_root __DIR__/:template
|
11
9
|
engine :Amrita2
|
12
10
|
|
11
|
+
def index
|
12
|
+
%{ #{A 'Home', :href => :/} | #{A(:internal)} | #{A(:external)} }
|
13
|
+
end
|
14
|
+
|
15
|
+
def internal(*args)
|
16
|
+
@data = binding
|
17
|
+
@place = :internal
|
18
|
+
<<__AMRITA2__
|
19
|
+
<html>
|
20
|
+
<head>
|
21
|
+
<title>Template::Amrita2 external</title>
|
22
|
+
</head>
|
23
|
+
<body>
|
24
|
+
<h1 am:src="title" />
|
25
|
+
<%= link_home %>
|
26
|
+
<p>
|
27
|
+
Here you can pass some stuff if you like, parameters are just passed like this:<br />
|
28
|
+
<%= link_one %><br />
|
29
|
+
<%= link_two %><br />
|
30
|
+
<%= link_three %>
|
31
|
+
</p>
|
32
|
+
<<div<
|
33
|
+
<<:args<
|
34
|
+
<span><%= $_ %></span>
|
35
|
+
<%= inspect_parameters %>
|
36
|
+
</body>
|
37
|
+
</html>
|
38
|
+
__AMRITA2__
|
39
|
+
end
|
40
|
+
|
41
|
+
def external(*args)
|
42
|
+
@data = binding
|
43
|
+
@place = :external
|
44
|
+
end
|
45
|
+
|
13
46
|
private
|
14
47
|
|
15
48
|
def title
|
16
|
-
"The
|
49
|
+
"The #{@place} Template for Amrita2"
|
17
50
|
end
|
18
51
|
|
19
52
|
def link_home
|
@@ -21,15 +54,15 @@ class MainController < Ramaze::Controller
|
|
21
54
|
end
|
22
55
|
|
23
56
|
def link_one
|
24
|
-
A(
|
57
|
+
A("/#{@place}/one", :href => Rs(@place, :one))
|
25
58
|
end
|
26
59
|
|
27
60
|
def link_two
|
28
|
-
A("/
|
61
|
+
A("/#{@place}/one/two/three", :href => Rs(@place, :one, :two, :three))
|
29
62
|
end
|
30
63
|
|
31
64
|
def link_three
|
32
|
-
A("
|
65
|
+
A("/#{@place}?foo=bar", :href => Rs(@place, :one, :foo => :bar))
|
33
66
|
end
|
34
67
|
|
35
68
|
def inspect_parameters
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
-
|
1
|
+
require 'rubygems'
|
4
2
|
require 'ramaze'
|
5
3
|
|
6
4
|
class MainController < Ramaze::Controller
|
@@ -51,3 +49,5 @@ class MainController < Ramaze::Controller
|
|
51
49
|
@place = :external
|
52
50
|
end
|
53
51
|
end
|
52
|
+
|
53
|
+
Ramaze.start
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
-
|
1
|
+
require 'rubygems'
|
4
2
|
require 'ramaze'
|
5
3
|
|
6
4
|
class MainController < Ramaze::Controller
|
@@ -63,3 +61,5 @@ class MainController < Ramaze::Controller
|
|
63
61
|
@hash = liquid_hash(:external, *args)
|
64
62
|
end
|
65
63
|
end
|
64
|
+
|
65
|
+
Ramaze.start
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'ramaze'
|
3
|
+
|
4
|
+
class MainController < Ramaze::Controller
|
5
|
+
template_root __DIR__/:template
|
6
|
+
engine :RedCloth
|
7
|
+
layout :layout
|
8
|
+
|
9
|
+
def index
|
10
|
+
@place = :home
|
11
|
+
%{ #{A 'Home', :href => :/} | #{A(:internal)} | #{A(:external)} }
|
12
|
+
end
|
13
|
+
|
14
|
+
def internal(*args)
|
15
|
+
@place = :internal
|
16
|
+
@args = args
|
17
|
+
<<__REDCLOTH__
|
18
|
+
h1. The <%= @place %> Template for RedCloth
|
19
|
+
|
20
|
+
"Home":<%= Rs(:/) %>
|
21
|
+
|
22
|
+
Here you can pass some stuff if you like, parameters are just passed like this:<br />
|
23
|
+
"<%= @place %>/one":<%= Rs(@place, :one) %><br />
|
24
|
+
"<%= @place %>/two/three":<%= Rs(@place, :two, :three) %><br />
|
25
|
+
"<%= @place %>/one?foo=bar":<%= Rs(@place, :one, :foo => :bar) %>
|
26
|
+
|
27
|
+
The arguments you have passed to this action are:<br />
|
28
|
+
<% if @args.empty? %>
|
29
|
+
none
|
30
|
+
<% else %>
|
31
|
+
<% @args.each do |arg| %>
|
32
|
+
<span><%= arg %></span>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<%= request.params.inspect %>
|
37
|
+
__REDCLOTH__
|
38
|
+
end
|
39
|
+
|
40
|
+
def external(*args)
|
41
|
+
@place = :external
|
42
|
+
@args = args
|
43
|
+
end
|
44
|
+
|
45
|
+
def layout
|
46
|
+
<<__HTML__
|
47
|
+
<html>
|
48
|
+
<head>
|
49
|
+
<title>Template::RedCloth <%= @place %></title>
|
50
|
+
</head>
|
51
|
+
<body>
|
52
|
+
#{@content}
|
53
|
+
</body>
|
54
|
+
</html>
|
55
|
+
__HTML__
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
Ramaze.start
|
@@ -1,7 +1,4 @@
|
|
1
|
-
|
2
|
-
# Copyright (c) 2007 Stephan Maka stephan@spaceboyz.net
|
3
|
-
# All files in this distribution are subject to the terms of the Ruby license.
|
4
|
-
|
1
|
+
require 'rubygems'
|
5
2
|
require 'ramaze'
|
6
3
|
require 'ramaze/gestalt'
|
7
4
|
|
data/examples/todolist/start.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
2
2
|
# All files in this distribution are subject to the terms of the Ruby license.
|
3
3
|
|
4
|
+
require 'rubygems'
|
4
5
|
require 'ramaze'
|
5
6
|
|
6
|
-
include Ramaze
|
7
|
-
|
8
7
|
require 'src/controller/main'
|
9
8
|
require 'src/element/page'
|
10
9
|
require 'src/model'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'ramaze'
|
3
|
+
|
4
|
+
class MainController < Ramaze::Controller
|
5
|
+
def index
|
6
|
+
return unless request.post?
|
7
|
+
@inspection = h(request.params.pretty_inspect)
|
8
|
+
tempfile, filename, @type =
|
9
|
+
request[:file].values_at(:tempfile, :filename, :type)
|
10
|
+
@extname, @basename = File.extname(filename), File.basename(filename)
|
11
|
+
@file_size = tempfile.size
|
12
|
+
|
13
|
+
FileUtils.move(tempfile.path, Ramaze::Global.public_root/@basename)
|
14
|
+
|
15
|
+
@is_image = @type.split('/').first == 'image'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
Ramaze.start
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<html>
|
2
|
+
|
3
|
+
<body>
|
4
|
+
<form method="POST" enctype="multipart/form-data">
|
5
|
+
Upload file: <input type="file" name="file" /><br />
|
6
|
+
<input type="submit" name="submit" value="Submit" />
|
7
|
+
</form>
|
8
|
+
|
9
|
+
<?r if @inspection ?>
|
10
|
+
<h3>#{@basename}</h3>
|
11
|
+
File size: #{@file_size} bytes
|
12
|
+
|
13
|
+
<?r if @is_image ?>
|
14
|
+
<h4>Uploaded Image</h4>
|
15
|
+
<img src="#{@basename}" alt="Uploaded Image"/><br/>
|
16
|
+
<?r else ?>
|
17
|
+
<p>You uploaded a #{@type} file. Upload an image file to see it here.</p>
|
18
|
+
<?r end ?>
|
19
|
+
|
20
|
+
<h4>request.params.inspect:</h4>
|
21
|
+
<pre>#{@inspection}</pre>
|
22
|
+
<?r end ?>
|
23
|
+
</body>
|
24
|
+
|
25
|
+
</html>
|
data/examples/whywiki/start.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
2
|
-
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
-
|
4
1
|
# written as an example of how to implement the minimal _why wiki
|
5
2
|
|
3
|
+
require 'rubygems'
|
6
4
|
require 'ramaze'
|
7
5
|
require 'bluecloth'
|
8
6
|
|
data/examples/wikore/start.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
first text
|
@@ -0,0 +1 @@
|
|
1
|
+
second text
|