Pistos-ramaze 2009.01 → 2009.02
Sign up to get free protection for your applications and to get access to all the features.
- data/{README.markdown → README.md} +2 -2
- data/Rakefile +21 -1
- data/doc/readme_chunks/getting_help.txt +1 -1
- data/doc/tutorial/todolist.html +1 -1
- data/doc/tutorial/todolist.mkd +2 -2
- data/examples/app/wiktacular/template/html_layout.xhtml +1 -1
- data/lib/proto/view/index.xhtml +2 -2
- data/lib/ramaze/controller/resolve.rb +1 -1
- data/lib/ramaze/current.rb +0 -59
- data/lib/ramaze/current/response.rb +2 -4
- data/lib/ramaze/current/session/flash.rb +1 -0
- data/lib/ramaze/helper/flash.rb +17 -2
- data/lib/ramaze/helper/user.rb +1 -1
- data/lib/ramaze/reloader.rb +2 -2
- data/lib/ramaze/snippets/ramaze/fiber.rb +5 -5
- data/lib/ramaze/template/amrita2.rb +6 -2
- data/lib/ramaze/tool/localize.rb +1 -1
- data/lib/ramaze/version.rb +2 -2
- data/rake_tasks/conf.rake +17 -3
- data/rake_tasks/gem.rake +1 -1
- data/rake_tasks/metric.rake +1 -1
- data/ramaze.gemspec +3 -3
- metadata +5 -4
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2009 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
4
|
# About Ramaze
|
@@ -401,7 +401,7 @@ For help you can:
|
|
401
401
|
|
402
402
|
- Visit us in the channel #ramaze on irc.freenode.net
|
403
403
|
|
404
|
-
- Join the Mailinglist at http://
|
404
|
+
- Join the Mailinglist at http://groups.google.com/group/ramaze
|
405
405
|
|
406
406
|
|
407
407
|
# Appendix
|
data/Rakefile
CHANGED
@@ -107,7 +107,7 @@ desc "create bzip2 and tarball"
|
|
107
107
|
task :distribute => :gem do
|
108
108
|
sh "rm -rf pkg/ramaze-#{VERS}"
|
109
109
|
sh "mkdir -p pkg/ramaze-#{VERS}"
|
110
|
-
sh "cp -r {bin,doc,lib,examples,spec,Rakefile,README.
|
110
|
+
sh "cp -r {bin,doc,lib,examples,spec,Rakefile,README.md,rake_tasks} pkg/ramaze-#{VERS}/"
|
111
111
|
|
112
112
|
Dir.chdir('pkg') do |pwd|
|
113
113
|
sh "tar -zcvf ramaze-#{VERS}.tar.gz ramaze-#{VERS}"
|
@@ -226,3 +226,23 @@ task README do
|
|
226
226
|
end
|
227
227
|
end
|
228
228
|
end
|
229
|
+
|
230
|
+
desc 'Generate YARD documentation'
|
231
|
+
task :ydoc do
|
232
|
+
sh('yardoc -o ydoc -r README.md')
|
233
|
+
end
|
234
|
+
|
235
|
+
task :publish => [:ydoc]
|
236
|
+
|
237
|
+
begin
|
238
|
+
require 'grancher/task'
|
239
|
+
|
240
|
+
Grancher::Task.new do |g|
|
241
|
+
g.branch = 'gh-pages'
|
242
|
+
# g.push_to = 'origin'
|
243
|
+
g.message = 'Updated website'
|
244
|
+
g.directory 'ydoc', '.'
|
245
|
+
end
|
246
|
+
rescue LoadError
|
247
|
+
# oh well :)
|
248
|
+
end
|
data/doc/tutorial/todolist.html
CHANGED
@@ -92,7 +92,7 @@ pre.iplastic .RegularExpression {
|
|
92
92
|
|
93
93
|
<p>Welcome to our official tutorial, the mandatory to-do list. I’m writing this while doing the steps to assure it will work for you.</p>
|
94
94
|
|
95
|
-
<p>The tutorial assumes that you have Ramaze installed already. The easiest way to do that is <code>gem install ramaze</code>, for other ways of installation please see the documentation at http://ramaze.
|
95
|
+
<p>The tutorial assumes that you have Ramaze installed already. The easiest way to do that is <code>gem install ramaze</code>, for other ways of installation please see the documentation at http://ramaze.net</p>
|
96
96
|
|
97
97
|
<p>Should you encounter any problems while doing this tutorial, this might either be because Ramaze changed (which happens very often while it is still young) or I actually made some mistake while writing it.</p>
|
98
98
|
|
data/doc/tutorial/todolist.mkd
CHANGED
@@ -14,7 +14,7 @@ I'm writing this while doing the steps to assure it will work for you.
|
|
14
14
|
|
15
15
|
The tutorial assumes that you have Ramaze installed already. The easiest way to
|
16
16
|
do that is `gem install ramaze`, for other ways of installation please see the
|
17
|
-
documentation at http://ramaze.
|
17
|
+
documentation at http://ramaze.net .
|
18
18
|
|
19
19
|
Should you encounter any problems while doing this tutorial, this might either
|
20
20
|
be because Ramaze changed (which happens very often while it is still young)
|
@@ -368,7 +368,7 @@ will translate into:
|
|
368
368
|
open('Wash dishes')
|
369
369
|
{:lang=ruby}
|
370
370
|
|
371
|
-
Which in turn will call
|
371
|
+
Which in turn will call
|
372
372
|
|
373
373
|
task_status('Wash dishes', false)
|
374
374
|
{:lang=ruby}
|
@@ -22,6 +22,6 @@
|
|
22
22
|
<div id="content">
|
23
23
|
#@content
|
24
24
|
</div>
|
25
|
-
<div id="copyright">Wiktacular is powered by <a href="http://ramaze.
|
25
|
+
<div id="copyright">Wiktacular is powered by <a href="http://ramaze.net">Ramaze</a></div>
|
26
26
|
</body>
|
27
27
|
</html>
|
data/lib/proto/view/index.xhtml
CHANGED
@@ -16,11 +16,11 @@ working.</p>
|
|
16
16
|
</ol>
|
17
17
|
</p>
|
18
18
|
|
19
|
-
<p>For more documentation, check out <a href="http://ramaze.net">
|
19
|
+
<p>For more documentation, check out <a href="http://ramaze.net">ramaze.net</a>, which includes:
|
20
20
|
<ul>
|
21
21
|
<li>a <a href="http://ramaze.net/getting-started">getting started</a> guide</li>
|
22
22
|
<li>some <a href="http://ramaze.net/screencasts">screencasts</a></li>
|
23
|
-
<li>and
|
23
|
+
<li>and <a href="http://wiki.ramaze.net/Tutorials">tutorials</a></li>
|
24
24
|
</ul>
|
25
25
|
</p>
|
26
26
|
|
@@ -244,7 +244,7 @@ module Ramaze
|
|
244
244
|
t_extensions = Template::ENGINES
|
245
245
|
all_extensions = t_extensions.values.flatten
|
246
246
|
|
247
|
-
if engine =
|
247
|
+
if engine = ancestral_trait[:engine]
|
248
248
|
c_extensions = t_extensions.select{|k,v| k == engine}.map{|k,v| v}.flatten
|
249
249
|
return (c_extensions + all_extensions).uniq
|
250
250
|
end
|
data/lib/ramaze/current.rb
CHANGED
@@ -49,62 +49,3 @@ module Ramaze
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
|
-
__END__
|
53
|
-
|
54
|
-
module Current
|
55
|
-
class << self
|
56
|
-
include Trinity
|
57
|
-
|
58
|
-
def call(env)
|
59
|
-
setup(env)
|
60
|
-
before_call
|
61
|
-
|
62
|
-
if filter = Global.record
|
63
|
-
request = Current.request
|
64
|
-
Record << request if filter[request]
|
65
|
-
end
|
66
|
-
|
67
|
-
Dispatcher.handle
|
68
|
-
|
69
|
-
finish
|
70
|
-
ensure
|
71
|
-
after_call
|
72
|
-
end
|
73
|
-
|
74
|
-
def setup(env)
|
75
|
-
self.request = Request.new(env)
|
76
|
-
self.response = Response.new
|
77
|
-
self.session = Session.new
|
78
|
-
end
|
79
|
-
|
80
|
-
def finish
|
81
|
-
session.finish if session
|
82
|
-
response.finish
|
83
|
-
end
|
84
|
-
|
85
|
-
def before(&block)
|
86
|
-
@before = block_given? ? block : @before
|
87
|
-
end
|
88
|
-
|
89
|
-
def before_call
|
90
|
-
return unless before
|
91
|
-
before.call
|
92
|
-
rescue Object => e
|
93
|
-
Ramaze::Log.error e
|
94
|
-
raise e
|
95
|
-
end
|
96
|
-
|
97
|
-
def after(&block)
|
98
|
-
@after = block_given? ? block : @after
|
99
|
-
end
|
100
|
-
|
101
|
-
def after_call
|
102
|
-
return unless after
|
103
|
-
after.call
|
104
|
-
rescue Object => e
|
105
|
-
Ramaze::Log.error e
|
106
|
-
raise e
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
@@ -15,10 +15,8 @@ module Ramaze
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# Build/replace this responses data
|
18
|
-
def build(new_body = body, status = status,
|
19
|
-
header.
|
20
|
-
self[key] = value
|
21
|
-
end
|
18
|
+
def build(new_body = body, status = status, new_header = {})
|
19
|
+
self.header.merge!(new_header)
|
22
20
|
|
23
21
|
self.body, self.status = new_body, status
|
24
22
|
end
|
data/lib/ramaze/helper/flash.rb
CHANGED
@@ -41,9 +41,24 @@ module Ramaze
|
|
41
41
|
# <div class='flash' id='flash_error'>Please enter your name</div>
|
42
42
|
# <div class='flash' id='flash_info'>Do you see the fnords?</div>
|
43
43
|
#
|
44
|
-
# This is designed to be customized permanently or per usage:
|
45
44
|
#
|
46
|
-
#
|
45
|
+
# This can be customized permanently in your controller:
|
46
|
+
#
|
47
|
+
# class MainController < Ramaze::Controller
|
48
|
+
# trait :flashbox => "<div class='flash_%key'>%value</div>"
|
49
|
+
#
|
50
|
+
# def show_flashbox
|
51
|
+
# flashbox
|
52
|
+
# end
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# or on a per-usage basis in your action:
|
56
|
+
#
|
57
|
+
# class MainController < Ramaze::Controller
|
58
|
+
# def show_flashbox
|
59
|
+
# flashbox("<div class='flash_%key'>%value</div>")
|
60
|
+
# end
|
61
|
+
# end
|
47
62
|
#
|
48
63
|
# Where any occurrence of %key and %value will be replaced by the actual
|
49
64
|
# contents of each element of flash
|
data/lib/ramaze/helper/user.rb
CHANGED
data/lib/ramaze/reloader.rb
CHANGED
@@ -56,7 +56,7 @@ module Ramaze
|
|
56
56
|
Watcher = WatchStat
|
57
57
|
end
|
58
58
|
|
59
|
-
def initialize(app)
|
59
|
+
def initialize(app = nil)
|
60
60
|
@app = app
|
61
61
|
@files = {}
|
62
62
|
@watcher = Watcher.new
|
@@ -81,7 +81,7 @@ module Ramaze
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
@app.call(env)
|
84
|
+
@app.call(env) if @app
|
85
85
|
end
|
86
86
|
|
87
87
|
def cycle
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Ramaze
|
2
2
|
class Fiber < ::Fiber
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
attr_accessor :state
|
4
|
+
|
5
|
+
def initialize(*args)
|
6
|
+
super
|
7
|
+
@state = {}
|
8
8
|
end
|
9
9
|
|
10
10
|
attr_accessor :state
|
@@ -30,9 +30,13 @@ module Ramaze
|
|
30
30
|
|
31
31
|
def transform(action)
|
32
32
|
template = wrap_compile(action)
|
33
|
+
|
33
34
|
data = action.instance.instance_variable_get("@data") || {}
|
34
|
-
action.instance.
|
35
|
-
|
35
|
+
binding = action.instance.instance_variable_get("@binding")
|
36
|
+
|
37
|
+
action.instance.extend(::Amrita2::Runtime)
|
38
|
+
|
39
|
+
template.render_with(data, binding)
|
36
40
|
end
|
37
41
|
|
38
42
|
# Compile a template, return instance of Amrita2::Template
|
data/lib/ramaze/tool/localize.rb
CHANGED
data/lib/ramaze/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2009 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
4
|
module Ramaze
|
5
|
-
VERSION = "2009.
|
5
|
+
VERSION = "2009.02"
|
6
6
|
end
|
data/rake_tasks/conf.rake
CHANGED
@@ -5,7 +5,7 @@ COPYRIGHT = [
|
|
5
5
|
"# Copyright (c) #{Time.now.year} Michael Fellinger m.fellinger@gmail.com",
|
6
6
|
"# All files in this distribution are subject to the terms of the Ruby license."
|
7
7
|
]
|
8
|
-
README = 'README.
|
8
|
+
README = 'README.md'
|
9
9
|
CLEAN.include %w[
|
10
10
|
**/.*.sw?
|
11
11
|
*.gem
|
@@ -36,12 +36,26 @@ RDOC_FILES = %W[
|
|
36
36
|
POST_INSTALL_MESSAGE = %{
|
37
37
|
#{'=' * 60}
|
38
38
|
|
39
|
+
|
39
40
|
Thank you for installing Ramaze!
|
40
|
-
You can now do following:
|
41
41
|
|
42
|
-
|
42
|
+
At this point, you can learn how to use Ramaze at
|
43
|
+
the main website, http://ramaze.net .
|
44
|
+
|
45
|
+
Alternatively, you can work off a skeletal prototype project
|
46
|
+
using the 'ramaze' command:
|
47
|
+
|
43
48
|
ramaze --create yourproject
|
44
49
|
|
50
|
+
Feel free to ask questions in our IRC channel:
|
51
|
+
irc.freenode.net #ramaze
|
52
|
+
http://mibbit.com/?server=irc.freenode.net&channel=%23ramaze
|
53
|
+
|
54
|
+
Enjoy! :)
|
55
|
+
|
56
|
+
-- The Ramaze team
|
57
|
+
|
58
|
+
|
45
59
|
#{'=' * 60}
|
46
60
|
}.strip
|
47
61
|
|
data/rake_tasks/gem.rake
CHANGED
data/rake_tasks/metric.rake
CHANGED
data/ramaze.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "ramaze"
|
3
|
-
s.version = "2009.
|
3
|
+
s.version = "2009.02"
|
4
4
|
|
5
5
|
s.summary = "Ramaze is a simple and modular web framework"
|
6
6
|
s.description = "Ramaze is a simple and modular web framework"
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.has_rdoc = true
|
9
9
|
s.author = "Michael 'manveru' Fellinger"
|
10
10
|
s.email = "m.fellinger@gmail.com"
|
11
|
-
s.homepage = "http://ramaze.
|
11
|
+
s.homepage = "http://ramaze.net"
|
12
12
|
s.rubyforge_project = "ramaze"
|
13
13
|
s.executables = ["ramaze"]
|
14
14
|
s.bindir = "bin"
|
@@ -28,7 +28,7 @@ http://mibbit.com/?server=irc.freenode.net&channel=%23ramaze
|
|
28
28
|
s.add_dependency('rack', '>= 0.3.0')
|
29
29
|
|
30
30
|
s.files = [
|
31
|
-
"README.
|
31
|
+
"README.md",
|
32
32
|
"Rakefile",
|
33
33
|
"benchmark/results.txt",
|
34
34
|
"benchmark/run.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Pistos-ramaze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "2009.
|
4
|
+
version: "2009.02"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael 'manveru' Fellinger
|
@@ -9,11 +9,12 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-02-25 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
@@ -30,7 +31,7 @@ extensions: []
|
|
30
31
|
extra_rdoc_files: []
|
31
32
|
|
32
33
|
files:
|
33
|
-
- README.
|
34
|
+
- README.md
|
34
35
|
- Rakefile
|
35
36
|
- benchmark/results.txt
|
36
37
|
- benchmark/run.rb
|
@@ -622,7 +623,7 @@ files:
|
|
622
623
|
- spec/snippets/string/unindent.rb
|
623
624
|
- spec/snippets/thread/into.rb
|
624
625
|
has_rdoc: true
|
625
|
-
homepage: http://ramaze.
|
626
|
+
homepage: http://ramaze.net
|
626
627
|
post_install_message: |-
|
627
628
|
|
628
629
|
============================================================
|