ramaze 0.3.5 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -20
- data/bin/ramaze +0 -4
- data/doc/AUTHORS +5 -0
- data/doc/meta/announcement.txt +2 -1
- data/doc/tutorial/todolist.html +20 -21
- data/doc/tutorial/todolist.mkd +10 -9
- data/examples/blog/{src/controller.rb → controller/main.rb} +2 -0
- data/examples/blog/{src/model.rb → model/entry.rb} +0 -0
- data/examples/blog/spec/blog.rb +3 -3
- data/examples/blog/start.rb +2 -3
- data/examples/blog/view/edit.xhtml +17 -0
- data/examples/blog/view/index.xhtml +17 -0
- data/examples/blog/view/layout.xhtml +11 -0
- data/examples/blog/view/new.xhtml +16 -0
- data/examples/facebook.rb +15 -8
- data/examples/identity.rb +1 -1
- data/examples/memleak_detector.rb +1 -1
- data/examples/rammit/src/model.rb +1 -1
- data/examples/rapaste/controller/paste.rb +7 -7
- data/examples/rapaste/model/paste.rb +1 -3
- data/examples/rapaste/public/css/display.css +2 -1
- data/examples/rapaste/start.rb +2 -3
- data/examples/sourceview/sourceview.rb +1 -1
- data/examples/templates/template/external.tenjin +28 -0
- data/examples/templates/template_amrita2.rb +0 -3
- data/examples/templates/template_tenjin.rb +57 -0
- data/examples/todolist/spec/todolist.rb +13 -2
- data/examples/todolist/src/controller/main.rb +1 -1
- data/examples/todolist/template/index.xhtml +1 -1
- data/examples/wiktacular/spec/wiktacular.rb +18 -0
- data/examples/wiktacular/src/controller.rb +2 -2
- data/examples/wiktacular/src/model.rb +8 -2
- data/lib/proto/public/css/ramaze_error.css +4 -0
- data/lib/proto/public/dispatch.fcgi +11 -0
- data/lib/proto/spec/main.rb +1 -1
- data/lib/proto/start.ru +8 -0
- data/lib/proto/view/error.xhtml +2 -0
- data/lib/ramaze.rb +28 -5
- data/lib/ramaze/action.rb +9 -2
- data/lib/ramaze/action/render.rb +40 -24
- data/lib/ramaze/adapter.rb +10 -17
- data/lib/ramaze/adapter/base.rb +8 -12
- data/lib/ramaze/adapter/cgi.rb +14 -13
- data/lib/ramaze/adapter/ebb.rb +34 -0
- data/lib/ramaze/adapter/evented_mongrel.rb +1 -1
- data/lib/ramaze/adapter/fcgi.rb +14 -14
- data/lib/ramaze/adapter/lsws.rb +15 -11
- data/lib/ramaze/adapter/mongrel.rb +2 -1
- data/lib/ramaze/adapter/scgi.rb +24 -0
- data/lib/ramaze/adapter/swiftiplied_mongrel.rb +1 -1
- data/lib/ramaze/adapter/thin.rb +4 -5
- data/lib/ramaze/adapter/webrick.rb +5 -5
- data/lib/ramaze/cache.rb +1 -1
- data/lib/ramaze/cache/memcached.rb +1 -1
- data/lib/ramaze/contrib.rb +70 -10
- data/lib/ramaze/contrib/auto_params.rb +1 -1
- data/lib/ramaze/contrib/email.rb +15 -15
- data/lib/ramaze/contrib/facebook.rb +2 -2
- data/lib/ramaze/contrib/facebook/facebook.rb +7 -4
- data/lib/ramaze/contrib/file_cache.rb +65 -0
- data/lib/ramaze/contrib/gettext.rb +56 -55
- data/lib/ramaze/contrib/profiling.rb +36 -0
- data/lib/ramaze/contrib/sequel_cache.rb +92 -0
- data/lib/ramaze/controller.rb +80 -47
- data/lib/ramaze/controller/error.rb +10 -5
- data/lib/ramaze/controller/resolve.rb +36 -48
- data/lib/ramaze/current.rb +70 -0
- data/lib/ramaze/{trinity → current}/request.rb +62 -15
- data/lib/ramaze/current/response.rb +19 -0
- data/lib/ramaze/{trinity → current}/session.rb +32 -110
- data/lib/ramaze/current/session/flash.rb +67 -0
- data/lib/ramaze/current/session/hash.rb +65 -0
- data/lib/ramaze/dispatcher.rb +1 -28
- data/lib/ramaze/dispatcher/action.rb +6 -3
- data/lib/ramaze/dispatcher/directory.rb +1 -1
- data/lib/ramaze/dispatcher/error.rb +26 -5
- data/lib/ramaze/dispatcher/file.rb +13 -2
- data/lib/ramaze/gestalt.rb +3 -1
- data/lib/ramaze/global.rb +6 -3
- data/lib/ramaze/global/globalstruct.rb +3 -1
- data/lib/ramaze/helper.rb +66 -20
- data/lib/ramaze/helper/aspect.rb +25 -17
- data/lib/ramaze/helper/auth.rb +4 -3
- data/lib/ramaze/helper/cache.rb +5 -4
- data/lib/ramaze/helper/cgi.rb +11 -9
- data/lib/ramaze/helper/flash.rb +28 -3
- data/lib/ramaze/helper/formatting.rb +1 -3
- data/lib/ramaze/helper/identity.rb +2 -3
- data/lib/ramaze/helper/inform.rb +7 -6
- data/lib/ramaze/helper/link.rb +15 -17
- data/lib/ramaze/helper/markaby.rb +2 -4
- data/lib/ramaze/helper/maruku.rb +1 -1
- data/lib/ramaze/helper/nitroform.rb +4 -4
- data/lib/ramaze/helper/pager.rb +4 -6
- data/lib/ramaze/helper/partial.rb +24 -21
- data/lib/ramaze/helper/redirect.rb +8 -5
- data/lib/ramaze/helper/{file.rb → sendfile.rb} +1 -3
- data/lib/ramaze/helper/sequel.rb +1 -3
- data/lib/ramaze/helper/stack.rb +1 -3
- data/lib/ramaze/helper/tagz.rb +19 -0
- data/lib/ramaze/helper/user.rb +63 -0
- data/lib/ramaze/inform.rb +2 -24
- data/lib/ramaze/log.rb +28 -0
- data/lib/ramaze/{inform → log}/analogger.rb +3 -3
- data/lib/ramaze/{inform → log}/growl.rb +2 -2
- data/lib/ramaze/{inform → log}/hub.rb +4 -6
- data/lib/ramaze/{inform → log}/informer.rb +4 -4
- data/lib/ramaze/{inform → log}/knotify.rb +2 -2
- data/lib/ramaze/log/logger.rb +22 -0
- data/lib/ramaze/{inform/informing.rb → log/logging.rb} +16 -16
- data/lib/ramaze/{inform → log}/syslog.rb +0 -0
- data/lib/ramaze/{inform → log}/xosd.rb +2 -2
- data/lib/ramaze/route.rb +64 -36
- data/lib/ramaze/snippets/array/put_within.rb +13 -0
- data/lib/ramaze/snippets/binding/locals.rb +13 -0
- data/lib/ramaze/snippets/kernel/__dir__.rb +10 -8
- data/lib/ramaze/snippets/kernel/aquire.rb +1 -1
- data/lib/ramaze/snippets/kernel/constant.rb +1 -1
- data/lib/ramaze/snippets/object/pretty.rb +6 -0
- data/lib/ramaze/snippets/object/scope.rb +11 -0
- data/lib/ramaze/snippets/object/thread_accessor.rb +5 -0
- data/lib/ramaze/snippets/ordered_set.rb +1 -1
- data/lib/ramaze/snippets/proc/locals.rb +11 -0
- data/lib/ramaze/snippets/ramaze/thread_accessor.rb +44 -0
- data/lib/ramaze/snippets/string/esc.rb +29 -0
- data/lib/ramaze/snippets/string/start_with.rb +7 -0
- data/lib/ramaze/snippets/string/unindent.rb +6 -1
- data/lib/ramaze/snippets/struct/values_at.rb +1 -5
- data/lib/ramaze/sourcereload.rb +16 -14
- data/lib/ramaze/spec.rb +1 -0
- data/lib/ramaze/spec/helper.rb +11 -3
- data/lib/ramaze/spec/helper/browser.rb +25 -1
- data/lib/ramaze/spec/helper/pretty_output.rb +11 -11
- data/lib/ramaze/template.rb +5 -4
- data/lib/ramaze/template/amrita2.rb +2 -3
- data/lib/ramaze/template/ezamar/element.rb +2 -3
- data/lib/ramaze/template/ezamar/morpher.rb +1 -2
- data/lib/ramaze/template/ezamar/render_partial.rb +1 -1
- data/lib/ramaze/template/haml.rb +5 -2
- data/lib/ramaze/template/markaby.rb +2 -0
- data/lib/ramaze/template/tagz.rb +79 -0
- data/lib/ramaze/template/tenjin.rb +34 -0
- data/lib/ramaze/tool/create.rb +0 -3
- data/lib/ramaze/tool/localize.rb +107 -105
- data/lib/ramaze/tool/mime.rb +0 -2
- data/lib/ramaze/trinity.rb +1 -26
- data/lib/ramaze/version.rb +1 -1
- data/lib/vendor/bacon.rb +47 -41
- data/rake_tasks/conf.rake +18 -0
- data/rake_tasks/darcs.rake +5 -0
- data/rake_tasks/maintenance.rake +37 -24
- data/rake_tasks/spec.rake +1 -1
- data/spec/contrib/auto_params.rb +3 -1
- data/spec/contrib/profiling.rb +26 -0
- data/spec/examples/templates/template_redcloth.rb +1 -1
- data/spec/examples/templates/template_tenjin.rb +28 -0
- data/spec/helper.rb +0 -1
- data/spec/ramaze/action/layout.rb +28 -0
- data/spec/ramaze/controller/actionless_templates.rb +32 -0
- data/spec/ramaze/controller/template/other_wrapper.xhtml +1 -0
- data/spec/ramaze/controller/template_resolving.rb +37 -0
- data/spec/ramaze/{trinity → current}/request.rb +12 -2
- data/spec/ramaze/current/session.rb +97 -0
- data/spec/ramaze/dispatcher/directory.rb +2 -1
- data/spec/ramaze/dispatcher/file.rb +8 -3
- data/spec/ramaze/dispatcher/public/file name.txt +1 -0
- data/spec/ramaze/gestalt.rb +11 -0
- data/spec/ramaze/helper/aspect.rb +28 -22
- data/spec/ramaze/helper/cgi.rb +2 -2
- data/spec/ramaze/helper/flash.rb +33 -15
- data/spec/ramaze/helper/formatting.rb +2 -2
- data/spec/ramaze/helper/link.rb +46 -18
- data/spec/ramaze/helper/pager.rb +8 -5
- data/spec/ramaze/helper/partial.rb +8 -1
- data/spec/ramaze/helper/template/recursive_local_ivars.xhtml +7 -0
- data/spec/ramaze/helper/user.rb +46 -0
- data/spec/ramaze/{inform → log}/informer.rb +0 -0
- data/spec/ramaze/{inform → log}/syslog.rb +1 -1
- data/spec/ramaze/request.rb +14 -10
- data/spec/ramaze/route.rb +23 -0
- data/spec/ramaze/template.rb +48 -1
- data/spec/ramaze/template/haml.rb +6 -16
- data/spec/ramaze/template/haml/locals.haml +2 -1
- data/spec/ramaze/template/tagz.rb +62 -0
- data/spec/ramaze/template/tagz/external.tagz +8 -0
- data/spec/ramaze/template/tagz/sum.tagz +1 -0
- data/spec/ramaze/template/tenjin.rb +49 -0
- data/spec/ramaze/template/tenjin/external.tenjin +1 -0
- data/spec/snippets/string/unindent.rb +15 -0
- metadata +509 -475
- data/doc/README.html +0 -729
- data/doc/changes.txt +0 -5757
- data/doc/changes.xml +0 -5759
- data/examples/blog/src/view.rb +0 -16
- data/examples/blog/template/edit.xhtml +0 -19
- data/examples/blog/template/index.xhtml +0 -19
- data/examples/blog/template/new.xhtml +0 -18
- data/examples/wiktacular/mkd/newpagename/current.mkd +0 -1
- data/examples/wiktacular/mkd/newpagename/current.mkd.bak +0 -1
- data/lib/ramaze/contrib/email.rb-darcs-backup0 +0 -81
- data/lib/ramaze/template/bijou.rb +0 -39
- data/lib/ramaze/trinity/response.rb +0 -32
- data/spec/ramaze/template/bijou.rb +0 -25
- data/spec/ramaze/trinity/session.rb +0 -29
data/examples/identity.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
Ramaze::
|
2
|
-
Ramaze::
|
3
|
-
Ramaze::
|
4
|
-
Ramaze::
|
5
|
-
Ramaze::
|
6
|
-
# Ramaze::
|
1
|
+
Ramaze::Route[%r!^/(\d+)\.(?:te?xt|plain|rb|css|js)$!] = '/plain/%d'
|
2
|
+
Ramaze::Route[%r!^/(?:te?xt|plain|rb|css|js)/(\d+)$!] = '/plain/%d'
|
3
|
+
Ramaze::Route[%r!^/(\d+)\.(\w+)$!] = '/view/%d/%s'
|
4
|
+
Ramaze::Route[%r!^/(\d+)$!] = '/view/%d/html'
|
5
|
+
Ramaze::Route[%r!^/list/page/(\d+)$!] = '/list/%d'
|
6
|
+
# Ramaze::Route[%r!^/list/?(.*)!] = '/%s'
|
7
7
|
|
8
8
|
class PasteController < Ramaze::Controller
|
9
9
|
map :/
|
@@ -15,7 +15,7 @@ class PasteController < Ramaze::Controller
|
|
15
15
|
def list(start = 1)
|
16
16
|
ordered = Paste.order(:created.DESC)
|
17
17
|
@paginated = ordered.paginate(start.to_i, 10)
|
18
|
-
@pager = paginator(@paginated, '/list
|
18
|
+
@pager = paginator(@paginated, '/list')
|
19
19
|
@pastes = @paginated
|
20
20
|
@style = style
|
21
21
|
end
|
data/examples/rapaste/start.rb
CHANGED
@@ -5,7 +5,7 @@ require 'ramaze'
|
|
5
5
|
require 'sequel'
|
6
6
|
require 'uv'
|
7
7
|
|
8
|
-
Ramaze::
|
8
|
+
Ramaze::Log.debug "Initializing UltraViolet..."
|
9
9
|
|
10
10
|
Uv.copy_files "xhtml", __DIR__/"public"
|
11
11
|
Uv.init_syntaxes
|
@@ -14,8 +14,7 @@ UV_PRIORITY_NAMES = %w[ ruby plain_text html css javascript yaml diff ]
|
|
14
14
|
|
15
15
|
STYLE = 'iplastic'
|
16
16
|
|
17
|
-
Ramaze::
|
18
|
-
Ramaze.contrib :route
|
17
|
+
Ramaze::Log.debug "done."
|
19
18
|
|
20
19
|
DB = Sequel.sqlite
|
21
20
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Template::Tenjin #{@place}</title>
|
4
|
+
</head>
|
5
|
+
<body>
|
6
|
+
<h1>The #{@place} Template for Tenjin</h1>
|
7
|
+
<a href="#{Rs(:/)}">Home</a>
|
8
|
+
<p>
|
9
|
+
Here you can pass some stuff if you like, parameters are just passed like this:<br />
|
10
|
+
<a href="#{Rs(@place, :one)}">#{Rs(@place, :one)}</a><br />
|
11
|
+
<a href="#{Rs(@place, :two, :three)}">#{Rs(@place, :two, :three)}</a><br />
|
12
|
+
<a href="#{Rs(@place, :one, :foo => :bar)}">#{Rs(@place, :one, :foo => :bar)}</a>
|
13
|
+
</p>
|
14
|
+
|
15
|
+
<div>
|
16
|
+
The arguments you have passed to this action are:<br />
|
17
|
+
<?rb if @args.empty? ?>
|
18
|
+
none
|
19
|
+
<?rb else ?>
|
20
|
+
<?rb @args.each do |arg| ?>
|
21
|
+
<span>#{arg}</span>
|
22
|
+
<?rb end ?>
|
23
|
+
<?rb end ?>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div>#{request.params.inspect}</div>
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "ramaze"
|
3
|
+
|
4
|
+
class MainController < Ramaze::Controller
|
5
|
+
template_root __DIR__/:template
|
6
|
+
engine :Tenjin
|
7
|
+
|
8
|
+
def index
|
9
|
+
%{ #{A 'Home', :href => :/} | #{A(:internal)} | #{A(:external)} }
|
10
|
+
end
|
11
|
+
|
12
|
+
def internal(*args)
|
13
|
+
@context = {
|
14
|
+
:args => args,
|
15
|
+
:place => :internal
|
16
|
+
}
|
17
|
+
<<'__TENJIN__'
|
18
|
+
<html>
|
19
|
+
<head>
|
20
|
+
<title>Template::Tenjin #{@place}</title>
|
21
|
+
</head>
|
22
|
+
<body>
|
23
|
+
<h1>The #{@place} Template for Tenjin</h1>
|
24
|
+
<a href="#{Rs(:/)}">Home</a>
|
25
|
+
<p>
|
26
|
+
Here you can pass some stuff if you like, parameters are just passed like this:<br />
|
27
|
+
<a href="#{Rs(@place, :one)}">#{Rs(@place, :one)}</a><br />
|
28
|
+
<a href="#{Rs(@place, :two, :three)}">#{Rs(@place, :two, :three)}</a><br />
|
29
|
+
<a href="#{Rs(@place, :one, :foo => :bar)}">#{Rs(@place, :one, :foo => :bar)}</a>
|
30
|
+
</p>
|
31
|
+
|
32
|
+
<div>
|
33
|
+
The arguments you have passed to this action are:<br />
|
34
|
+
<?rb if @args.empty? ?>
|
35
|
+
none
|
36
|
+
<?rb else ?>
|
37
|
+
<?rb @args.each do |arg| ?>
|
38
|
+
<span>#{arg}</span>
|
39
|
+
<?rb end ?>
|
40
|
+
<?rb end ?>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div>#{request.params.inspect}</div>
|
44
|
+
</body>
|
45
|
+
</html>
|
46
|
+
__TENJIN__
|
47
|
+
end
|
48
|
+
|
49
|
+
def external(*args)
|
50
|
+
@context = {
|
51
|
+
:args => args,
|
52
|
+
:place => :external
|
53
|
+
}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
Ramaze.start
|
@@ -23,15 +23,19 @@ describe 'todolist' do
|
|
23
23
|
(h_get('/')/:tr)
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
26
|
+
def task(name)
|
27
27
|
tasks.find do |task|
|
28
28
|
(task/:td).find do |td|
|
29
29
|
td['class'] == 'title' and
|
30
|
-
td.inner_html.strip ==
|
30
|
+
td.inner_html.strip == name
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
def spectask
|
36
|
+
task('spectask')
|
37
|
+
end
|
38
|
+
|
35
39
|
def spectask_status
|
36
40
|
spectask.search("td[@class='status']").inner_html.strip
|
37
41
|
end
|
@@ -117,5 +121,12 @@ describe 'todolist' do
|
|
117
121
|
error_on_page('/new', response).should == 'Please enter a title'
|
118
122
|
end
|
119
123
|
|
124
|
+
it 'should escape harmful titles' do
|
125
|
+
response = post('/create', 'title' => '#{puts "gotcha"}')
|
126
|
+
|
127
|
+
task('#{puts "gotcha"}').should.be.nil
|
128
|
+
task('#{puts "gotcha"}').should.not.be.nil
|
129
|
+
end
|
130
|
+
|
120
131
|
FileUtils.rm('todolist.db') rescue nil
|
121
132
|
end
|
@@ -133,6 +133,24 @@ describe 'wiktacular' do
|
|
133
133
|
doc.at('div#text').inner_html.strip.should == '<p>first text</p>'
|
134
134
|
end
|
135
135
|
|
136
|
+
it "should convert [[#{NEWPAGE}]] to existing link" do
|
137
|
+
edit_page(NEWPAGE, "Link: [[#{NEWPAGE}]]")
|
138
|
+
doc = check_page(NEWPAGE)
|
139
|
+
a = doc.at('div#text>p>a')
|
140
|
+
a['class'].should == 'exists'
|
141
|
+
a['href'].should == NEWPAGE
|
142
|
+
a.inner_html.should == NEWPAGE
|
143
|
+
end
|
144
|
+
|
145
|
+
it "should convert [[chunky bacon]] to nonexisting link" do
|
146
|
+
edit_page(NEWPAGE, "Link: [[chunky bacon]]")
|
147
|
+
doc = check_page(NEWPAGE)
|
148
|
+
a = doc.at('div#text>p>a')
|
149
|
+
a['class'].should == 'nonexists'
|
150
|
+
a['href'].should == "chunky+bacon"
|
151
|
+
a.inner_html.should == "chunky bacon"
|
152
|
+
end
|
153
|
+
|
136
154
|
after do
|
137
155
|
WikiEntry.new(NEWPAGE).delete
|
138
156
|
end
|
@@ -17,7 +17,7 @@ class MainController < Ramaze::Controller
|
|
17
17
|
|
18
18
|
def edit handle
|
19
19
|
@handle = handle
|
20
|
-
@entry = WikiEntry
|
20
|
+
@entry = WikiEntry.new(handle)
|
21
21
|
@text = @entry.content
|
22
22
|
end
|
23
23
|
|
@@ -39,7 +39,7 @@ class MainController < Ramaze::Controller
|
|
39
39
|
def save
|
40
40
|
redirect_referer unless request.post?
|
41
41
|
handle = request['handle']
|
42
|
-
entry = WikiEntry
|
42
|
+
entry = WikiEntry.new(handle)
|
43
43
|
entry.save(request['text'])
|
44
44
|
redirect Rs(:index, handle)
|
45
45
|
end
|
@@ -5,7 +5,9 @@ class WikiEntry
|
|
5
5
|
ENTRIES_DIR = __DIR__/'../mkd'
|
6
6
|
class << self
|
7
7
|
def [](name)
|
8
|
-
|
8
|
+
if File.exist?(ENTRIES_DIR/File.basename(File.expand_path(name)))
|
9
|
+
new(name)
|
10
|
+
end
|
9
11
|
end
|
10
12
|
def titles
|
11
13
|
Dir[ENTRIES_DIR/'*'].entries
|
@@ -79,7 +81,11 @@ class WikiEntry
|
|
79
81
|
end
|
80
82
|
|
81
83
|
class EntryView
|
84
|
+
include Ramaze::Helper::Methods
|
85
|
+
helper :cgi, :link
|
86
|
+
|
82
87
|
class << self
|
88
|
+
|
83
89
|
def render content
|
84
90
|
mkd2html(content || "No Entry")
|
85
91
|
end
|
@@ -88,7 +94,7 @@ class EntryView
|
|
88
94
|
html = BlueCloth.new(text).to_html
|
89
95
|
html.gsub!(/\[\[(.*?)\]\]/) do |m|
|
90
96
|
exists = WikiEntry[$1] ? 'exists' : 'nonexists'
|
91
|
-
|
97
|
+
A(h($1), :href => $1, :class => exists)
|
92
98
|
end
|
93
99
|
html
|
94
100
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'ramaze'
|
5
|
+
|
6
|
+
# FCGI doesn't like you writing to stdout
|
7
|
+
Ramaze::Log.loggers = [ Ramaze::Informer.new( File.join(__DIR__, '..', 'ramaze.fcgi.log') ) ]
|
8
|
+
Ramaze::Global.adapter = :fcgi
|
9
|
+
|
10
|
+
$0 = File.join(__DIR__, '..', 'start.rb')
|
11
|
+
require $0
|
data/lib/proto/spec/main.rb
CHANGED
data/lib/proto/start.ru
ADDED
data/lib/proto/view/error.xhtml
CHANGED
data/lib/ramaze.rb
CHANGED
@@ -1,13 +1,34 @@
|
|
1
1
|
# Copyright (c) 2008 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
|
+
# StdLib
|
5
|
+
require 'abbrev'
|
6
|
+
require 'benchmark'
|
7
|
+
require 'cgi'
|
8
|
+
require 'digest/md5'
|
4
9
|
require 'fileutils'
|
10
|
+
require 'ipaddr'
|
11
|
+
require 'optparse'
|
12
|
+
require 'ostruct'
|
13
|
+
require 'pathname'
|
14
|
+
require 'pp'
|
15
|
+
require 'set'
|
16
|
+
require 'socket'
|
17
|
+
require 'timeout'
|
18
|
+
require 'tmpdir'
|
19
|
+
require 'yaml'
|
5
20
|
|
6
21
|
begin
|
7
22
|
require 'rubygems'
|
8
23
|
rescue LoadError
|
9
24
|
end
|
10
25
|
|
26
|
+
# Rack
|
27
|
+
require 'rack'
|
28
|
+
require 'rack/utils'
|
29
|
+
require 'rack/request'
|
30
|
+
require 'rack/response'
|
31
|
+
|
11
32
|
# The main namespace for Ramaze
|
12
33
|
module Ramaze
|
13
34
|
SEEED = $0.dup
|
@@ -22,28 +43,30 @@ Thread.abort_on_exception = true
|
|
22
43
|
# Bootstrap
|
23
44
|
require 'ramaze/version'
|
24
45
|
require 'ramaze/snippets'
|
25
|
-
require 'ramaze/
|
26
|
-
require 'ramaze/
|
46
|
+
require 'ramaze/log'
|
47
|
+
require 'ramaze/trinity'
|
48
|
+
require 'ramaze/current'
|
49
|
+
require 'ramaze/adapter'
|
27
50
|
require 'ramaze/global'
|
28
51
|
require 'ramaze/cache'
|
29
52
|
require 'ramaze/tool'
|
30
53
|
|
31
54
|
# Startup
|
32
55
|
require 'ramaze/controller'
|
33
|
-
require 'ramaze/adapter'
|
34
56
|
require 'ramaze/sourcereload'
|
35
57
|
|
36
58
|
# Complete
|
37
59
|
require 'ramaze/dispatcher'
|
38
60
|
require 'ramaze/template/ezamar'
|
39
61
|
require 'ramaze/contrib'
|
62
|
+
require 'ramaze/route'
|
40
63
|
|
41
64
|
module Ramaze
|
42
65
|
|
43
66
|
# Each of these classes will be called ::startup upon Ramaze.startup
|
44
67
|
|
45
68
|
trait :essentials => [
|
46
|
-
Global, Cache, Controller, Session, SourceReload, Adapter
|
69
|
+
Global, Cache, Contrib, Controller, Session, SourceReload, Adapter
|
47
70
|
]
|
48
71
|
|
49
72
|
class << self
|
@@ -56,7 +79,7 @@ module Ramaze
|
|
56
79
|
runner = options.delete(:runner) || runner_from_caller
|
57
80
|
|
58
81
|
if $0 == runner or options.delete(:force)
|
59
|
-
|
82
|
+
Log.info("Starting up Ramaze (Version #{VERSION})")
|
60
83
|
SEEED.replace(runner)
|
61
84
|
APPDIR.replace(File.dirname(File.expand_path(runner)))
|
62
85
|
|