ramaze 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +14 -259
- data/bin/ramaze +52 -25
- data/doc/AUTHORS +6 -0
- data/doc/CHANGELOG +1363 -42
- data/doc/INSTALL +1 -1
- data/doc/README +48 -35
- data/doc/README.html +637 -0
- data/doc/TODO +7 -16
- data/doc/allison/allison.css +6 -7
- data/doc/allison/allison.gif +0 -0
- data/doc/allison/cache/STYLE +1 -2
- data/doc/changes.txt +3375 -0
- data/doc/changes.xml +3378 -0
- data/doc/meta/announcement.txt +47 -0
- data/doc/meta/configuration.txt +179 -0
- data/doc/meta/internals.txt +111 -0
- data/doc/readme_chunks/features.txt +8 -16
- data/doc/readme_chunks/installing.txt +7 -1
- data/doc/tutorial/todolist.txt +2 -3
- data/examples/blog/main.rb +9 -8
- data/examples/blog/public/styles/blog.css +132 -0
- data/examples/blog/src/controller.rb +14 -41
- data/examples/blog/src/model.rb +12 -13
- data/examples/blog/src/view.rb +16 -0
- data/examples/blog/template/edit.xhtml +19 -8
- data/examples/blog/template/index.xhtml +14 -22
- data/examples/blog/template/new.xhtml +18 -5
- data/examples/caching.rb +5 -8
- data/examples/element.rb +3 -3
- data/examples/hello.rb +3 -5
- data/examples/simple.rb +4 -7
- data/examples/templates/template/external.haml +8 -7
- data/examples/templates/template/external.mab +11 -8
- data/examples/templates/template_amrita2.rb +4 -4
- data/examples/templates/template_erubis.rb +3 -3
- data/examples/templates/template_ezamar.rb +1 -2
- data/examples/templates/template_haml.rb +24 -23
- data/examples/templates/template_liquid.rb +3 -1
- data/examples/templates/template_markaby.rb +15 -9
- data/examples/todolist/src/element/page.rb +1 -1
- data/lib/proto/conf/benchmark.yaml +6 -20
- data/lib/proto/conf/debug.yaml +6 -19
- data/lib/proto/conf/live.yaml +7 -19
- data/lib/proto/conf/silent.yaml +6 -16
- data/lib/proto/conf/stage.yaml +6 -18
- data/lib/proto/public/error.zmr +2 -2
- data/lib/ramaze.rb +34 -72
- data/lib/ramaze/adapter.rb +21 -18
- data/lib/ramaze/adapter/mongrel.rb +0 -3
- data/lib/ramaze/adapter/webrick.rb +6 -6
- data/lib/ramaze/cache/memcached.rb +3 -0
- data/lib/ramaze/controller.rb +227 -183
- data/lib/ramaze/dispatcher.rb +34 -129
- data/lib/ramaze/dispatcher/action.rb +28 -0
- data/lib/ramaze/dispatcher/error.rb +43 -0
- data/lib/ramaze/dispatcher/file.rb +34 -0
- data/lib/ramaze/global.rb +89 -48
- data/lib/ramaze/helper/aspect.rb +8 -6
- data/lib/ramaze/helper/auth.rb +3 -3
- data/lib/ramaze/helper/cache.rb +2 -2
- data/lib/ramaze/helper/file.rb +14 -0
- data/lib/ramaze/helper/inform.rb +36 -0
- data/lib/ramaze/helper/link.rb +7 -3
- data/lib/ramaze/helper/markaby.rb +30 -0
- data/lib/ramaze/helper/redirect.rb +2 -0
- data/lib/ramaze/inform.rb +8 -182
- data/lib/ramaze/inform/analogger.rb +19 -0
- data/lib/ramaze/inform/growl.rb +28 -0
- data/lib/ramaze/inform/hub.rb +26 -0
- data/lib/ramaze/inform/informer.rb +92 -0
- data/lib/ramaze/inform/informing.rb +44 -0
- data/lib/ramaze/inform/syslog.rb +27 -0
- data/lib/ramaze/inform/xosd.rb +42 -0
- data/lib/ramaze/snippets.rb +6 -2
- data/lib/ramaze/snippets/object/traits.rb +13 -1
- data/lib/ramaze/snippets/ramaze/autoreload.rb +58 -2
- data/lib/ramaze/snippets/string/color.rb +27 -0
- data/lib/ramaze/snippets/string/each.rb +6 -0
- data/lib/ramaze/snippets/struct/fill.rb +15 -0
- data/lib/ramaze/template/ezamar.rb +13 -22
- data/lib/ramaze/template/ezamar/element.rb +12 -12
- data/lib/ramaze/template/liquid.rb +19 -18
- data/lib/ramaze/template/markaby.rb +37 -58
- data/lib/ramaze/tool/localize.rb +128 -0
- data/lib/ramaze/tool/tidy.rb +51 -21
- data/lib/ramaze/trinity.rb +3 -3
- data/lib/ramaze/trinity/request.rb +41 -23
- data/lib/ramaze/trinity/response.rb +10 -5
- data/lib/ramaze/trinity/session.rb +17 -3
- data/lib/ramaze/version.rb +2 -2
- data/rake_tasks/conf.rake +56 -0
- data/rake_tasks/gem.rake +44 -0
- data/rake_tasks/maintaince.rake +187 -0
- data/spec/all.rb +32 -0
- data/spec/examples/caching.rb +19 -0
- data/spec/examples/element.rb +15 -0
- data/spec/examples/hello.rb +11 -0
- data/spec/examples/simple.rb +51 -0
- data/spec/examples/templates/template_amrita2.rb +14 -0
- data/spec/examples/templates/template_erubis.rb +21 -0
- data/spec/examples/templates/template_ezamar.rb +22 -0
- data/spec/examples/templates/template_haml.rb +23 -0
- data/spec/examples/templates/template_liquid.rb +24 -0
- data/spec/examples/templates/template_markaby.rb +21 -0
- data/spec/helper.rb +81 -0
- data/spec/{spec_helper_context.rb → helper/context.rb} +1 -1
- data/spec/helper/layout.rb +55 -0
- data/spec/helper/mock_http.rb +66 -0
- data/spec/{spec_helper_requester.rb → helper/requester.rb} +0 -6
- data/spec/{spec_helper_simple_http.rb → helper/simple_http.rb} +57 -57
- data/spec/helper/wrap.rb +193 -0
- data/spec/{adapter_spec.rb → ramaze/adapter.rb} +7 -5
- data/spec/{tc_adapter_mongrel.rb → ramaze/adapter/mongrel.rb} +2 -2
- data/spec/{tc_adapter_webrick.rb → ramaze/adapter/webrick.rb} +2 -2
- data/spec/{tc_cache.rb → ramaze/cache.rb} +16 -16
- data/spec/ramaze/conf/locale_de.yaml +6 -0
- data/spec/ramaze/conf/locale_en.yaml +6 -0
- data/spec/ramaze/controller.rb +184 -0
- data/spec/ramaze/controller/template/greet.xhtml +1 -0
- data/spec/ramaze/controller/template_resolving.rb +54 -0
- data/spec/ramaze/dependencies.rb +16 -0
- data/spec/{tc_element.rb → ramaze/element.rb} +21 -19
- data/spec/ramaze/error.rb +64 -0
- data/spec/{tc_gestalt.rb → ramaze/gestalt.rb} +10 -10
- data/spec/{tc_global.rb → ramaze/global.rb} +7 -7
- data/spec/{tc_helper_aspect.rb → ramaze/helper/aspect.rb} +22 -14
- data/spec/{tc_helper_auth.rb → ramaze/helper/auth.rb} +9 -7
- data/spec/{tc_helper_cache.rb → ramaze/helper/cache.rb} +14 -24
- data/spec/{tc_helper_feed.rb → ramaze/helper/feed.rb} +12 -12
- data/spec/ramaze/helper/file.rb +17 -0
- data/spec/{tc_helper_flash.rb → ramaze/helper/flash.rb} +16 -17
- data/spec/{tc_helper_form.rb → ramaze/helper/form.rb} +25 -26
- data/spec/{tc_helper_link.rb → ramaze/helper/link.rb} +9 -9
- data/spec/{tc_helper_redirect.rb → ramaze/helper/redirect.rb} +11 -10
- data/spec/{tc_helper_stack.rb → ramaze/helper/stack.rb} +10 -11
- data/spec/ramaze/inform/informer.rb +40 -0
- data/spec/ramaze/inform/syslog.rb +10 -0
- data/spec/ramaze/localize.rb +40 -0
- data/spec/ramaze/morpher.rb +82 -0
- data/spec/ramaze/params.rb +124 -0
- data/spec/{public → ramaze/public}/error404.xhtml +0 -0
- data/spec/{public → ramaze/public}/favicon.ico +0 -0
- data/spec/{public → ramaze/public}/ramaze.png +0 -0
- data/spec/{public → ramaze/public}/test_download.css +0 -0
- data/spec/ramaze/request.rb +129 -0
- data/spec/{tc_request_mongrel.rb → ramaze/request/mongrel.rb} +2 -2
- data/spec/{tc_request_webrick.rb → ramaze/request/webrick.rb} +1 -1
- data/spec/{tc_session.rb → ramaze/session.rb} +18 -18
- data/spec/{tc_store.rb → ramaze/store/default.rb} +10 -10
- data/spec/{tc_store_yaml.rb → ramaze/store/yaml.rb} +9 -9
- data/spec/ramaze/template.rb +86 -0
- data/spec/{tc_template_amrita2.rb → ramaze/template/amrita2.rb} +5 -5
- data/spec/{template → ramaze/template}/amrita2/data.amrita +0 -0
- data/spec/{template → ramaze/template}/amrita2/index.amrita +0 -0
- data/spec/{template → ramaze/template}/amrita2/sum.amrita +0 -0
- data/spec/{tc_template_erubis.rb → ramaze/template/erubis.rb} +9 -9
- data/spec/{template → ramaze/template}/erubis/sum.rhtml +0 -0
- data/spec/ramaze/template/ezamar.rb +62 -0
- data/spec/{template → ramaze/template}/ezamar/another/long/action.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/combined.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/file_only.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/index.zmr +0 -0
- data/spec/ramaze/template/ezamar/nested.zmr +1 -0
- data/spec/{template → ramaze/template}/ezamar/some__long__action.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/sum.zmr +0 -0
- data/spec/{tc_template_haml.rb → ramaze/template/haml.rb} +7 -7
- data/spec/{template → ramaze/template}/haml/index.haml +0 -0
- data/spec/{template → ramaze/template}/haml/with_vars.haml +0 -0
- data/spec/{tc_template_liquid.rb → ramaze/template/liquid.rb} +7 -7
- data/spec/{template → ramaze/template}/liquid/index.liquid +0 -0
- data/spec/{template → ramaze/template}/liquid/products.liquid +0 -0
- data/spec/ramaze/template/markaby.rb +59 -0
- data/spec/{template → ramaze/template}/markaby/external.mab +0 -0
- data/spec/{template → ramaze/template}/markaby/sum.mab +0 -0
- data/spec/ramaze/template/ramaze/external.test +1 -0
- data/spec/{tc_tidy.rb → ramaze/tidy.rb} +3 -3
- metadata +145 -81
- data/examples/blog/public/screen.css +0 -106
- data/examples/blog/src/element.rb +0 -58
- data/examples/blog/template/view.xhtml +0 -15
- data/examples/blog/test/tc_entry.rb +0 -18
- data/lib/proto/public/404.jpg +0 -0
- data/spec/request_tc_helper.rb +0 -135
- data/spec/spec_all.rb +0 -118
- data/spec/spec_helper.rb +0 -66
- data/spec/tc_controller.rb +0 -49
- data/spec/tc_dependencies.rb +0 -13
- data/spec/tc_error.rb +0 -43
- data/spec/tc_morpher.rb +0 -88
- data/spec/tc_params.rb +0 -125
- data/spec/tc_template_ezamar.rb +0 -64
- data/spec/tc_template_markaby.rb +0 -72
- data/spec/template/ezamar/nested.zmr +0 -1
data/Rakefile
CHANGED
@@ -10,63 +10,11 @@ require 'pp'
|
|
10
10
|
include FileUtils
|
11
11
|
|
12
12
|
$:.unshift File.join(File.dirname(__FILE__), "lib")
|
13
|
-
require 'ramaze/version'
|
14
|
-
|
15
|
-
AUTHOR = "manveru"
|
16
|
-
EMAIL = "m.fellinger@gmail.com"
|
17
|
-
DESCRIPTION = "Ramaze tries to be a very simple Webframework without the voodoo"
|
18
|
-
HOMEPATH = 'http://ramaze.rubyforge.org'
|
19
|
-
BIN_FILES = %w( ramaze )
|
20
|
-
|
21
|
-
BASEDIR = File.dirname(__FILE__)
|
22
|
-
|
23
|
-
NAME = "ramaze"
|
24
|
-
REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
|
25
|
-
VERS = ENV['VERSION'] || (Ramaze::VERSION + (REV ? ".#{REV}" : ""))
|
26
|
-
COPYRIGHT = [
|
27
|
-
"# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com",
|
28
|
-
"# All files in this distribution are subject to the terms of the Ruby license."
|
29
|
-
]
|
30
|
-
CLEAN.include %w[
|
31
|
-
**/.*.sw?
|
32
|
-
*.gem
|
33
|
-
.config
|
34
|
-
**/*~
|
35
|
-
**/{data.db,cache.yaml}
|
36
|
-
*.yaml
|
37
|
-
pkg
|
38
|
-
]
|
39
|
-
RDOC_OPTS = %w[
|
40
|
-
--all
|
41
|
-
--quiet
|
42
|
-
--op rdoc
|
43
|
-
--line-numbers
|
44
|
-
--inline-source
|
45
|
-
--main doc/README
|
46
|
-
--opname index.html
|
47
|
-
--title "Ramaze\ documentation"
|
48
|
-
--exclude "^(_darcs|spec|examples|bin|pkg)/"
|
49
|
-
--exclude "lib/proto"
|
50
|
-
--include "doc"
|
51
|
-
--accessor "trait"
|
52
|
-
]
|
53
|
-
RDOC_FILES = %w[
|
54
|
-
lib doc doc/README doc/FAQ doc/CHANGELOG
|
55
|
-
]
|
56
|
-
POST_INSTALL_MESSAGE = %{
|
57
|
-
#{'=' * 60}
|
58
13
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
ramaze --create yourproject
|
64
|
-
|
65
|
-
* Browse and try the Examples in
|
66
|
-
#{File.join(Gem.path, 'gems', 'ramaze-' + VERS, 'examples')}
|
67
|
-
|
68
|
-
#{'=' * 60}
|
69
|
-
}.strip
|
14
|
+
require 'ramaze/version'
|
15
|
+
load 'rake_tasks/conf.rake'
|
16
|
+
load 'rake_tasks/gem.rake'
|
17
|
+
load 'rake_tasks/maintaince.rake'
|
70
18
|
|
71
19
|
desc "Packages up ramaze gem."
|
72
20
|
task :default => [:test]
|
@@ -74,54 +22,9 @@ task :default => [:test]
|
|
74
22
|
desc "clean up temporary files and gems"
|
75
23
|
task :package => [:clean]
|
76
24
|
|
77
|
-
spec =
|
78
|
-
Gem::Specification.new do |s|
|
79
|
-
s.name = NAME
|
80
|
-
s.version = VERS
|
81
|
-
s.platform = Gem::Platform::RUBY
|
82
|
-
s.has_rdoc = true
|
83
|
-
s.extra_rdoc_files = RDOC_FILES
|
84
|
-
s.rdoc_options += RDOC_OPTS
|
85
|
-
s.summary = DESCRIPTION
|
86
|
-
s.description = DESCRIPTION
|
87
|
-
s.author = AUTHOR
|
88
|
-
s.email = EMAIL
|
89
|
-
s.homepage = HOMEPATH
|
90
|
-
s.executables = BIN_FILES
|
91
|
-
s.bindir = "bin"
|
92
|
-
s.require_path = "lib"
|
93
|
-
s.post_install_message = POST_INSTALL_MESSAGE
|
94
|
-
|
95
|
-
s.add_dependency('rake', '>=0.7.1')
|
96
|
-
s.add_dependency('rspec', '>=0.7.5.1')
|
97
|
-
s.add_dependency('rack', '>=0.1.0')
|
98
|
-
# s.required_ruby_version = '>= 1.8.5'
|
99
|
-
|
100
|
-
s.files = (RDOC_FILES + %w[Rakefile] + Dir["{examples,bin,doc,spec,lib}/**/*"]).uniq
|
101
|
-
|
102
|
-
# s.extensions = FileList["ext/**/extconf.rb"].to_a
|
103
|
-
end
|
104
|
-
|
105
|
-
Rake::GemPackageTask.new(spec) do |p|
|
106
|
-
p.need_tar = true
|
107
|
-
p.gem_spec = spec
|
108
|
-
end
|
109
|
-
|
110
|
-
desc "package and install ramaze"
|
111
|
-
task :install do
|
112
|
-
name = "#{NAME}-#{VERS}.gem"
|
113
|
-
sh %{rake package}
|
114
|
-
sh %{sudo gem install pkg/#{name}}
|
115
|
-
end
|
116
|
-
|
117
|
-
desc "uninstall the ramaze gem"
|
118
|
-
task :uninstall => [:clean] do
|
119
|
-
sh %{sudo gem uninstall #{NAME}}
|
120
|
-
end
|
121
|
-
|
122
25
|
desc "sanitize the code and darcs record"
|
123
26
|
task :record => ['fix-end-spaces', 'add-copyright'] do
|
124
|
-
|
27
|
+
sh "darcs record"
|
125
28
|
end
|
126
29
|
|
127
30
|
desc "create the doc/changes.xml"
|
@@ -148,23 +51,6 @@ task :changelog => :changes do
|
|
148
51
|
cp 'doc/changes.txt', 'doc/CHANGELOG'
|
149
52
|
end
|
150
53
|
|
151
|
-
desc "add copyright to all .rb files in the distribution"
|
152
|
-
task 'add-copyright' do
|
153
|
-
puts "adding copyright to files that don't have it currently"
|
154
|
-
Dir['{lib,test}/**/*{.rb}'].each do |file|
|
155
|
-
next if file =~ /_darcs/
|
156
|
-
lines = File.readlines(file).map{|l| l.chomp}
|
157
|
-
unless lines.first(2) == COPYRIGHT
|
158
|
-
puts "fixing #{file}"
|
159
|
-
File.open(file, 'w+') do |f|
|
160
|
-
(COPYRIGHT + lines).each do |line|
|
161
|
-
f.puts(line)
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
54
|
task :rcov_dir do
|
169
55
|
mkdir_p 'doc/output/tools/rcov/'
|
170
56
|
end
|
@@ -180,7 +66,7 @@ end
|
|
180
66
|
|
181
67
|
desc "run the specs and clean up afterwards"
|
182
68
|
task :test do
|
183
|
-
ruby "#{File.dirname(__FILE__)}/spec/
|
69
|
+
ruby "#{File.dirname(__FILE__)}/spec/all.rb"
|
184
70
|
sh "rake clean"
|
185
71
|
end
|
186
72
|
|
@@ -200,7 +86,7 @@ desc "create bzip2 and tarball"
|
|
200
86
|
task :distribute => :gem do
|
201
87
|
sh "rm -rf pkg/ramaze-#{VERS}"
|
202
88
|
sh "mkdir -p pkg/ramaze-#{VERS}"
|
203
|
-
sh "cp -r {bin,doc,lib,examples,spec,Rakefile,
|
89
|
+
sh "cp -r {bin,doc,lib,examples,spec,Rakefile,rake_tasks} pkg/ramaze-#{VERS}/"
|
204
90
|
|
205
91
|
Dir.chdir('pkg') do |pwd|
|
206
92
|
sh "tar -zcvf ramaze-#{VERS}.tar.gz ramaze-#{VERS}"
|
@@ -210,24 +96,6 @@ task :distribute => :gem do
|
|
210
96
|
sh "rm -rf pkg/ramaze-#{VERS}"
|
211
97
|
end
|
212
98
|
|
213
|
-
desc "doc/README to html"
|
214
|
-
Rake::RDocTask.new('gen-readme2html') do |rd|
|
215
|
-
rd.options = %w[
|
216
|
-
--quiet
|
217
|
-
--opname readme.html
|
218
|
-
]
|
219
|
-
|
220
|
-
rd.rdoc_dir = 'readme'
|
221
|
-
rd.rdoc_files = ['doc/README']
|
222
|
-
rd.main = 'doc/README'
|
223
|
-
rd.title = "Ramaze documentation"
|
224
|
-
end
|
225
|
-
|
226
|
-
desc "doc/README to doc/README.html"
|
227
|
-
task 'readme2html' => 'gen-readme2html' do
|
228
|
-
cp('readme/files/doc/README.html', 'doc/README.html')
|
229
|
-
rm_rf('readme')
|
230
|
-
end
|
231
99
|
|
232
100
|
desc "list all still undocumented methods"
|
233
101
|
task :undocumented do
|
@@ -259,7 +127,7 @@ end
|
|
259
127
|
|
260
128
|
desc "show a todolist from all the TODO tags in the source"
|
261
129
|
task :todo do
|
262
|
-
files = Dir[File.join(BASEDIR, '{lib,
|
130
|
+
files = Dir[File.join(BASEDIR, '{lib,spec}', '**/*.rb')]
|
263
131
|
|
264
132
|
files.each do |file|
|
265
133
|
lastline = todo = comment = long_comment = false
|
@@ -287,34 +155,6 @@ task :todo do
|
|
287
155
|
end
|
288
156
|
end
|
289
157
|
|
290
|
-
desc "generate doc/TODO from the TODO tags in the source"
|
291
|
-
task 'todolist' do
|
292
|
-
list = invoke('todo').split("\n")[2..-1]
|
293
|
-
tasks = {}
|
294
|
-
current = nil
|
295
|
-
|
296
|
-
list.map do |line|
|
297
|
-
if line =~ /TODO/ or line.empty?
|
298
|
-
elsif line =~ /^vim/
|
299
|
-
current = line.split[1]
|
300
|
-
tasks[current] = []
|
301
|
-
else
|
302
|
-
tasks[current] << line
|
303
|
-
end
|
304
|
-
end
|
305
|
-
|
306
|
-
lines = tasks.map{ |name, items| [name, items, ''] }.flatten
|
307
|
-
lines.pop
|
308
|
-
|
309
|
-
File.open(File.join('doc', 'TODO'), 'w+') do |f|
|
310
|
-
f.puts "This list is programmaticly generated by `rake todolist`"
|
311
|
-
f.puts "If you want to add/remove items from the list, change them at the"
|
312
|
-
f.puts "position specified in the list."
|
313
|
-
f.puts
|
314
|
-
f.puts(lines)
|
315
|
-
end
|
316
|
-
end
|
317
|
-
|
318
158
|
desc "show how many patches we made so far"
|
319
159
|
task :patchsize do
|
320
160
|
size = `darcs changes`.split("\n").reject{|l| l =~ /^\s/ or l.empty?}.size
|
@@ -322,27 +162,12 @@ task :patchsize do
|
|
322
162
|
puts "shall i now play some Death-Metal for you?" if size == 666
|
323
163
|
end
|
324
164
|
|
325
|
-
desc "
|
326
|
-
task
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
lines.each_with_index do |line, i|
|
332
|
-
if line =~ /\s+\n/
|
333
|
-
puts "fixing #{file}:#{i + 1}"
|
334
|
-
p line
|
335
|
-
new[i] = line.rstrip
|
336
|
-
end
|
337
|
-
end
|
338
|
-
|
339
|
-
unless new == lines
|
340
|
-
File.open(file, 'w+') do |f|
|
341
|
-
new.each do |line|
|
342
|
-
f.puts(line)
|
343
|
-
end
|
344
|
-
end
|
345
|
-
end
|
165
|
+
desc "show who made how many patches"
|
166
|
+
task :patchstat do
|
167
|
+
patches = `darcs changes`.split("\n").grep(/^\S/).map{|e| e.split.last}
|
168
|
+
committs = patches.inject(Hash.new(0)){|s,v| s[v] += 1; s}
|
169
|
+
committs.sort.each do |committer, patches|
|
170
|
+
puts "#{committer.ljust(25)}: #{patches}"
|
346
171
|
end
|
347
172
|
end
|
348
173
|
|
@@ -362,73 +187,3 @@ task 'request' do
|
|
362
187
|
end
|
363
188
|
end
|
364
189
|
end
|
365
|
-
|
366
|
-
desc "Compile the doc/README from the parts of doc/readme"
|
367
|
-
task 'build-readme' do
|
368
|
-
require 'enumerator'
|
369
|
-
|
370
|
-
chapters = [
|
371
|
-
'About Ramaze', 'introduction',
|
372
|
-
'Features Overview', 'features',
|
373
|
-
'Basic Principles', 'principles',
|
374
|
-
'Installation', 'installing',
|
375
|
-
'Getting Started', 'getting_started',
|
376
|
-
'A couple of Examples', 'examples',
|
377
|
-
'How to find Help', 'getting_help',
|
378
|
-
'Appendix', 'appendix',
|
379
|
-
'And thanks to...', 'thanks',
|
380
|
-
]
|
381
|
-
|
382
|
-
File.open('doc/README', 'w+') do |readme|
|
383
|
-
readme.puts COPYRIGHT.map{|l| l[1..-1]}, ''
|
384
|
-
|
385
|
-
chapters.each_slice(2) do |title, file|
|
386
|
-
file = File.join('doc', 'readme_chunks', "#{file}.txt")
|
387
|
-
chapter = File.read(file)
|
388
|
-
readme.puts "= #{title}", '', chapter
|
389
|
-
readme.puts '', '' unless title == chapters[-2]
|
390
|
-
end
|
391
|
-
end
|
392
|
-
end
|
393
|
-
|
394
|
-
task 'tutorial2html' do
|
395
|
-
require 'bluecloth'
|
396
|
-
|
397
|
-
basefile = File.join('doc', 'tutorial', 'todolist')
|
398
|
-
|
399
|
-
content = File.read(basefile + '.txt')
|
400
|
-
|
401
|
-
html = BlueCloth.new(content).to_html
|
402
|
-
|
403
|
-
wrap = %{
|
404
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
405
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
406
|
-
<html>
|
407
|
-
<head>
|
408
|
-
<title>Ramaze Tutorial: Todolist</title>
|
409
|
-
<style>
|
410
|
-
body {
|
411
|
-
background: #eee;
|
412
|
-
}
|
413
|
-
code {
|
414
|
-
background: #ddd;
|
415
|
-
}
|
416
|
-
pre code {
|
417
|
-
background: #ddd;
|
418
|
-
width: 70%;
|
419
|
-
display: block;
|
420
|
-
margin: 1em;
|
421
|
-
padding: 0.7em;
|
422
|
-
overflow: auto;
|
423
|
-
}
|
424
|
-
</style>
|
425
|
-
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
|
426
|
-
</head>
|
427
|
-
<body>
|
428
|
-
#{html}
|
429
|
-
</body>
|
430
|
-
</html>
|
431
|
-
}.strip
|
432
|
-
|
433
|
-
File.open(basefile + '.html', 'w+'){|f| f.puts(wrap) }
|
434
|
-
end
|
data/bin/ramaze
CHANGED
@@ -38,10 +38,13 @@
|
|
38
38
|
# updated files in your application
|
39
39
|
# -r, --run-loose:: don't take control after startup.
|
40
40
|
# this is useful for testcases.
|
41
|
+
# -c, --console:: Start an IRB-like session.
|
42
|
+
# --backtrace:: Show full backtrace at errors on start.
|
41
43
|
# --cache:: use the simple caching based on the signature
|
42
44
|
# of your requests (experimental)
|
43
45
|
# --tidy:: run Tool::Tidy over text/html output
|
44
46
|
#
|
47
|
+
#
|
45
48
|
# -h, --help:: print this help
|
46
49
|
# -v, --version:: print the version
|
47
50
|
# -c, --copyright:: print the copyright
|
@@ -54,7 +57,7 @@
|
|
54
57
|
|
55
58
|
require 'ramaze'
|
56
59
|
|
57
|
-
runner = ARGV.find{|file| File.file?(file)} || 'main.rb'
|
60
|
+
runner = File.expand_path(ARGV.find{|file| File.file?(file)} || 'main.rb')
|
58
61
|
|
59
62
|
begin
|
60
63
|
require 'getoptlong'
|
@@ -86,6 +89,7 @@ begin
|
|
86
89
|
[ '--run-loose', '-r', GetoptLong::NO_ARGUMENT ],
|
87
90
|
|
88
91
|
[ '--console', '-c', GetoptLong::NO_ARGUMENT ],
|
92
|
+
[ '--backtrace', GetoptLong::NO_ARGUMENT ],
|
89
93
|
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
|
90
94
|
[ '--version', '-v', GetoptLong::NO_ARGUMENT ],
|
91
95
|
[ '--copyright', GetoptLong::NO_ARGUMENT ],
|
@@ -108,41 +112,64 @@ begin
|
|
108
112
|
options[:inform_tags] = Set.new([:debug, :info, :error])
|
109
113
|
|
110
114
|
case sopt
|
111
|
-
when :create
|
112
|
-
|
113
|
-
when :
|
114
|
-
|
115
|
-
when
|
116
|
-
|
117
|
-
when :
|
118
|
-
|
119
|
-
when
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
when :
|
125
|
-
|
126
|
-
when :
|
127
|
-
|
128
|
-
when :
|
129
|
-
|
115
|
+
when :create
|
116
|
+
create[arg]
|
117
|
+
when :help
|
118
|
+
RDoc::ramazes_usage('Usage')
|
119
|
+
when :version
|
120
|
+
puts("ramaze #{Ramaze::VERSION}") or exit
|
121
|
+
when :copyright
|
122
|
+
RDoc::ramazes_usage('Copyright')
|
123
|
+
when *adapter
|
124
|
+
options[:adapter] = sopt
|
125
|
+
|
126
|
+
when :benchmark
|
127
|
+
options[:inform_tags] << :benchmark
|
128
|
+
when :debug
|
129
|
+
options
|
130
|
+
when :stage
|
131
|
+
options[:inform_tags].subtract [:debug]
|
132
|
+
when :live
|
133
|
+
options[:inform_tags].subtract [:info, :debug]
|
134
|
+
when :silent
|
135
|
+
options[:inform_tags].subtract options[:inform_tags]
|
136
|
+
|
137
|
+
when :host
|
138
|
+
options[:host] = arg
|
139
|
+
when :port
|
140
|
+
options[:port] = arg
|
141
|
+
|
142
|
+
when :no_errorpage
|
143
|
+
options[:error_page] = false
|
144
|
+
when :template_root
|
145
|
+
options[:template_root] = arg
|
146
|
+
when :autoreload
|
147
|
+
options[:autoreload] = arg.to_i
|
148
|
+
when :run_loose
|
149
|
+
options[:run_loose] = true
|
150
|
+
when :console
|
151
|
+
options[:console] = true
|
152
|
+
when :backtrace
|
153
|
+
options[:backtrace] = true
|
130
154
|
end
|
131
155
|
end
|
132
156
|
|
133
157
|
begin
|
134
|
-
puts "running #{
|
158
|
+
puts "running #{runner}"
|
135
159
|
require runner
|
136
|
-
rescue LoadError
|
137
|
-
puts
|
138
|
-
puts
|
160
|
+
rescue LoadError => ex
|
161
|
+
puts ex
|
162
|
+
puts ex.backtrace if options[:backtrace]
|
163
|
+
puts "Maybe i cannot find `#{runner}'"
|
164
|
+
puts "You could provide a file to execute like:"
|
165
|
+
puts "$ ramaze myapp.rb"
|
139
166
|
exit
|
140
167
|
end
|
141
168
|
|
142
169
|
if options.delete(:console)
|
143
170
|
options.merge!(:run_loose => true)
|
144
171
|
|
145
|
-
ARGV.clear # Avoid passing args to IRB
|
172
|
+
ARGV.clear # Avoid passing args to IRB
|
146
173
|
|
147
174
|
Ramaze.start(options)
|
148
175
|
|