ramaze 2012.12.08b → 2023.01.06
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +1 -1
- data/README.md +1 -0
- data/examples/app/whywiki/spec/whywiki.rb +22 -24
- data/examples/app/whywiki/start.rb +10 -9
- data/examples/app/whywiki/{template → view}/edit.xhtml +2 -2
- data/examples/app/whywiki/view/show.xhtml +20 -0
- data/examples/app/wikore/spec/wikore.rb +1 -1
- data/guide/AUTHORS +11 -3
- data/guide/CHANGELOG +3803 -3592
- data/guide/general/sessions.md +42 -0
- data/guide/general/upgrading.md +85 -0
- data/lib/proto/Gemfile +2 -2
- data/lib/ramaze/cache/memcache.rb +3 -3
- data/lib/ramaze/cache/moneta.rb +143 -0
- data/lib/ramaze/cache/redis.rb +8 -11
- data/lib/ramaze/cache/sequel.rb +2 -2
- data/lib/ramaze/cache.rb +1 -0
- data/lib/ramaze/files.rb +1 -1
- data/lib/ramaze/helper/paginate.rb +5 -0
- data/lib/ramaze/helper/request_accessor.rb +3 -1
- data/lib/ramaze/helper/stack.rb +1 -1
- data/lib/ramaze/helper/upload.rb +1 -1
- data/lib/ramaze/log/syslog.rb +1 -1
- data/lib/ramaze/request.rb +2 -2
- data/lib/ramaze/snippets.rb +0 -1
- data/lib/ramaze/version.rb +3 -1
- data/lib/ramaze/view/nagoro/render_partial.rb +1 -1
- data/lib/ramaze.rb +1 -1
- data/ramaze.gemspec +19 -15
- data/spec/ramaze/cache/moneta.rb +53 -0
- data/spec/ramaze/cache/redis.rb +1 -1
- data/spec/ramaze/cache/sequel.rb +2 -0
- data/spec/ramaze/dispatcher/directory.rb +24 -14
- data/spec/ramaze/dispatcher/file.rb +0 -5
- data/spec/ramaze/error.rb +13 -17
- data/spec/ramaze/helper/paginate.rb +41 -13
- data/spec/ramaze/log/syslog.rb +75 -63
- data/spec/ramaze/session/redis.rb +2 -2
- data/spec/ramaze/session/sequel.rb +2 -0
- data/spec/ramaze/view/haml.rb +3 -3
- data/spec/ramaze/view/slim.rb +1 -1
- metadata +95 -164
- data/.gems +0 -28
- data/.gitignore +0 -14
- data/.mailmap +0 -34
- data/.rvmrc +0 -2
- data/.travis.yml +0 -16
- data/.yardopts +0 -14
- data/examples/app/blog/public/.htaccess +0 -24
- data/examples/app/whywiki/template/show.xhtml +0 -18
- data/lib/ramaze/cache/localmemcache.rb +0 -53
- data/lib/ramaze/snippets/ramaze/lru_hash.rb +0 -247
- data/spec/ramaze/cache/localmemcache.rb +0 -50
- data/spec/ramaze/session/localmemcache.rb +0 -58
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: afe951903b9f669495e60996f5d8709d0b7327b2d0994b3268046f8db3683c96
|
4
|
+
data.tar.gz: 87acbc6a7db97ad1c92c7b03572f54d109e86a98bea854eafb6b762d33275191
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5320492673b92af275a7fdf80acd9a153e0522fd009019e6790032e470ca7e67535726441f775a88556593f67a97eb6f0a59feea74ce63e9c12b464c5878b728
|
7
|
+
data.tar.gz: 7d656d67c1eaecaee4a53dacc84ef9e27d7c92a12af0c5b4928f551a387709cb5bd8dacf2d4e51cc197f2febbe59f7eba498ad28dff1588177de6a30b3233e89
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -104,6 +104,7 @@ table of contents isn't rendered. You can find all these files in the ``guide/``
|
|
104
104
|
directory.
|
105
105
|
|
106
106
|
* {file:general/installation Installation}
|
107
|
+
* {file:general/upgrading Upgrading}
|
107
108
|
* {file:general/principles Principles}
|
108
109
|
* {file:general/special_thanks Special Thanks}
|
109
110
|
* {file:general/contributing Contributing To Ramaze}
|
@@ -1,58 +1,56 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'yaml/store'
|
1
3
|
require 'ramaze'
|
2
|
-
require 'ramaze/spec/
|
4
|
+
require 'ramaze/spec/bacon'
|
3
5
|
|
4
|
-
spec_require 'bluecloth', '
|
6
|
+
spec_require 'bluecloth', 'nokogiri'
|
5
7
|
|
6
|
-
|
8
|
+
DB = YAML::Store.new('whywikitest.yaml')
|
9
|
+
END{ FileUtils.rm_f('whyikitest.yaml') }
|
7
10
|
|
8
|
-
|
9
|
-
require 'start'
|
11
|
+
require_relative '../start'
|
10
12
|
|
11
13
|
describe 'WikiController' do
|
12
|
-
behaves_like
|
14
|
+
behaves_like :rack_test
|
13
15
|
|
14
16
|
def page(name)
|
15
17
|
page = get(name)
|
16
18
|
page.status.should == 200
|
17
19
|
page.body.should.not == nil
|
18
20
|
|
19
|
-
doc =
|
20
|
-
title = doc.at('title').
|
21
|
+
doc = Nokogiri::HTML(page.body)
|
22
|
+
title = doc.at('title').inner_text
|
21
23
|
|
22
24
|
body = doc.at('body')
|
23
25
|
return title, body
|
24
26
|
end
|
25
27
|
|
26
28
|
it 'should start' do
|
27
|
-
ramaze :public_root => base/:public,
|
28
|
-
:view_root => base/:template
|
29
29
|
get('/').status.should == 302
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'should have main page' do
|
33
|
-
|
34
|
-
|
35
|
-
body.at('h1').
|
36
|
-
body.
|
33
|
+
title, body = page('/show/Home')
|
34
|
+
title.should.match(/^MicroWiki Home$/)
|
35
|
+
body.at('h1').inner_text.should == 'Home'
|
36
|
+
body.css('a[@href="/edit/Home"]').inner_text.should == 'Create Home'
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'should have edit page' do
|
40
|
-
|
41
|
-
|
40
|
+
title, body = page('/edit/Home')
|
41
|
+
title.should.match(/^MicroWiki Edit Home$/)
|
42
42
|
|
43
|
-
body.
|
44
|
-
body.at('h1').
|
45
|
-
body.at('form
|
43
|
+
body.css('a[@href="/"]').inner_text.should == '< Home'
|
44
|
+
body.at('h1').inner_text.should == 'Edit Home'
|
45
|
+
body.at('form textarea').should.not == nil
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'should create pages' do
|
49
49
|
post('/save','text'=>'the text','page'=>'ThePage').status.should == 302
|
50
|
-
page =
|
50
|
+
page = Nokogiri::HTML(get('/show/ThePage').body)
|
51
51
|
body = page.at('body>div')
|
52
52
|
body.should.not == nil
|
53
|
-
body.at('a[@href
|
54
|
-
body.at('p').
|
53
|
+
body.at('a[@href="/edit/ThePage"]').inner_text.should =='Edit ThePage'
|
54
|
+
body.at('p').inner_text.should == 'the text'
|
55
55
|
end
|
56
|
-
|
57
|
-
FileUtils.rm("#{base}/testwiki.yaml")
|
58
56
|
end
|
@@ -2,25 +2,26 @@
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'ramaze'
|
5
|
+
require 'yaml/store'
|
5
6
|
require 'bluecloth'
|
6
7
|
|
7
|
-
|
8
|
+
DB = YAML::Store.new('whywiki.yaml') unless defined?(DB)
|
8
9
|
|
9
10
|
class WikiController < Ramaze::Controller
|
10
11
|
map :/
|
11
12
|
|
12
13
|
def index
|
13
|
-
redirect
|
14
|
+
redirect r(:show, 'Home')
|
14
15
|
end
|
15
16
|
|
16
17
|
def show page = 'Home'
|
17
18
|
@page = url_decode(page)
|
18
|
-
@text =
|
19
|
+
@text = DB.transaction{|db| db[page] }.to_s
|
19
20
|
@edit_link = "/edit/#{page}"
|
20
21
|
|
21
22
|
@text.gsub!(/\[\[(.*?)\]\]/) do |m|
|
22
|
-
exists =
|
23
|
-
A($1, :href =>
|
23
|
+
exists = DB.transaction{|db| db[$1] } ? 'exists' : 'nonexists'
|
24
|
+
A($1, :href => rs(:show, url_encode($1)), :class => exists)
|
24
25
|
end
|
25
26
|
|
26
27
|
@text = BlueCloth.new(@text).to_html
|
@@ -28,7 +29,7 @@ class WikiController < Ramaze::Controller
|
|
28
29
|
|
29
30
|
def edit page = 'Home'
|
30
31
|
@page = url_decode(page)
|
31
|
-
@text =
|
32
|
+
@text = DB.transaction{|db| db[page] }
|
32
33
|
end
|
33
34
|
|
34
35
|
def save
|
@@ -37,10 +38,10 @@ class WikiController < Ramaze::Controller
|
|
37
38
|
page = request['page'].to_s
|
38
39
|
text = request['text'].to_s
|
39
40
|
|
40
|
-
|
41
|
+
DB.transaction{|db| db[page] = text }
|
41
42
|
|
42
|
-
redirect
|
43
|
+
redirect rs(:show, url_encode(page))
|
43
44
|
end
|
44
45
|
end
|
45
46
|
|
46
|
-
Ramaze.start :
|
47
|
+
Ramaze.start host: '0.0.0.0'
|
@@ -4,8 +4,8 @@
|
|
4
4
|
</head>
|
5
5
|
<body>
|
6
6
|
<h1>Edit #{@page}</h1>
|
7
|
-
#{
|
8
|
-
<form method="POST" action="#{
|
7
|
+
#{a("< Home", '/')}
|
8
|
+
<form method="POST" action="#{r(:save)}">
|
9
9
|
<input type="hidden" name="page" value="#{url_encode(@page)}" />
|
10
10
|
<textarea name="text" style="width: 90%; height: 20em;">#{@text}</textarea>
|
11
11
|
<input type="submit" />
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>MicroWiki #{@page}</title>
|
4
|
+
<style>
|
5
|
+
a.exists{ color: #00f; }
|
6
|
+
a.nonexists{ color: #f00; }
|
7
|
+
</style>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<?r unless @page == "Home" ?><a href="/show/Home">< Home</a><?r end ?>
|
11
|
+
<h1>#{@page}</h1>
|
12
|
+
<?r if @text.empty? ?><a href="#@edit_link">Create #@page</a><?r end ?>
|
13
|
+
<?r unless @text.empty? ?>
|
14
|
+
<div>
|
15
|
+
<a href="#@edit_link">Edit #@page</a>
|
16
|
+
#@text
|
17
|
+
</div>
|
18
|
+
<?r end ?>
|
19
|
+
</body>
|
20
|
+
</html>
|
data/guide/AUTHORS
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Following persons have contributed to ramaze.
|
2
2
|
(Sorted by number of submitted patches, then alphabetically)
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
2754 Michael Fellinger <m.fellinger@gmail.com>
|
5
|
+
247 Yorick Peterse <yorickpeterse@gmail.com>
|
6
6
|
216 Aman Gupta <aman@ramaze.net>
|
7
7
|
89 Jonathan Buch <jonathan.buch@gmail.com>
|
8
8
|
77 Pistos <gitsomegrace.5.pistos@geoshell.com>
|
@@ -15,8 +15,9 @@ Following persons have contributed to ramaze.
|
|
15
15
|
16 TJ Vanderpoel <bougy.man@gmail.com>
|
16
16
|
11 Wang, Jinjing <nfjinjing@gmail.com>
|
17
17
|
10 Lee Jarvis <lee@jarvis.co>
|
18
|
+
10 Michel Blanc <mb@mbnet.fr>
|
19
|
+
9 Michael Faughn <michael.faughn@nist.gov>
|
18
20
|
8 Mario Gutierrez <mgutz@mgutz-mbp.local>
|
19
|
-
8 Michel Blanc <mb@mbnet.fr>
|
20
21
|
7 Tadahiko Uehara <kikofx@gmail.com>
|
21
22
|
6 Aki Reijonen <aki.reijonen@gmail.com>
|
22
23
|
6 Antti Tuomi <antti.tuomi@tkk.fi>
|
@@ -39,6 +40,7 @@ Following persons have contributed to ramaze.
|
|
39
40
|
2 jShaf <joshua.shaffner@gmail.com>
|
40
41
|
2 Yutaka HARA <yutaka.hara+github@gmail.com>
|
41
42
|
1 Aaron Mueller <mail@aaron-mueller.de>
|
43
|
+
1 Anton Ovchinnikov <revolver112@gmail.com>
|
42
44
|
1 Ara T. Howard <ara.t.howard@gmail.com>
|
43
45
|
1 Arnaud Meuret <arnaud@meuret.name>
|
44
46
|
1 Bruno Rohée <bruno@rohee.com>
|
@@ -47,14 +49,18 @@ Following persons have contributed to ramaze.
|
|
47
49
|
1 Christian Neukirchen <chneukirchen@gmail.com>
|
48
50
|
1 Colin Shea <colin@centuar.(none)>
|
49
51
|
1 crab <crabtw@gmail.com>
|
52
|
+
1 Daniel Mendler <mail@daniel-mendler.de>
|
50
53
|
1 Dmitry Gorbik <dmitrygorbik@isengard.local>
|
54
|
+
1 E0 <shan.huang@me.com>
|
51
55
|
1 Esad Hajdarevic <esad@esse.at>
|
52
56
|
1 Fabian Buch <fabian.buch@fabian-buch.de>
|
53
57
|
1 Francesc Esplugas <francesc.esplugas@gmail.com>
|
54
58
|
1 Gavin Kistner <gavin@phrogz.net>
|
55
59
|
1 huma <huma@boxbot.org>
|
56
60
|
1 Isak Andersson <IcePapih@lavabit.com>
|
61
|
+
1 Jack Polgar <jack.polgar@gmail.com>
|
57
62
|
1 Jason Torres <jason.e.torres@gmail.com>
|
63
|
+
1 Javier Donaire <jdonaire@gmail.com>
|
58
64
|
1 Jean-Francois Chevrette <jfchevrette@iweb.ca>
|
59
65
|
1 Jeremy Evans <code@jeremyevans.net>
|
60
66
|
1 kez <kdobson@gmail.com>
|
@@ -62,7 +68,9 @@ Following persons have contributed to ramaze.
|
|
62
68
|
1 Marc Weber <marco-oweber@gmx.de>
|
63
69
|
1 Martin Hilbig <blueonyx@dev-area.net>
|
64
70
|
1 Matt Rubens <mrubens@goldencookie.localdomain>
|
71
|
+
1 Michael Faughn <mike.faughn@gmail.com>
|
65
72
|
1 Pistos <github.pistos@purepistos.net>
|
73
|
+
1 Richard Fisher <richardfsr@gmail.com>
|
66
74
|
1 Rob Lievaart <rob@rebeltechnologies.nl>
|
67
75
|
1 sean <sean@sean-t61p.(none)>
|
68
76
|
1 Thomas Leitner <thomas.leitner@gmail.com>
|