smeagol 0.5.9 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby +80 -0
- data/.yardopts +9 -0
- data/HISTORY.md +147 -0
- data/LICENSE.txt +30 -0
- data/README.md +132 -26
- data/bin/smeagol +9 -39
- data/bin/smeagol-init +3 -0
- data/bin/smeagol-preview +4 -0
- data/bin/smeagol-serve +4 -0
- data/bin/smeagol-update +4 -0
- data/bin/smeagold +1 -4
- data/lib/smeagol.rb +77 -6
- data/lib/smeagol/app.rb +121 -75
- data/lib/smeagol/cache.rb +43 -24
- data/lib/smeagol/cli.rb +166 -0
- data/lib/smeagol/config.rb +154 -0
- data/lib/smeagol/console.rb +369 -0
- data/lib/smeagol/controller.rb +275 -0
- data/lib/smeagol/core_ext.rb +12 -0
- data/lib/smeagol/gollum/blob_entry.rb +17 -0
- data/lib/smeagol/gollum/file.rb +44 -0
- data/lib/smeagol/gollum/page.rb +47 -0
- data/lib/smeagol/gollum/wiki.rb +31 -0
- data/lib/smeagol/helpers/rss.rb +96 -0
- data/lib/smeagol/helpers/toc.rb +69 -0
- data/lib/smeagol/public/assets/smeagol/gollum.css +716 -0
- data/lib/smeagol/public/{smeagol → assets/smeagol}/html5.js +0 -0
- data/lib/smeagol/public/{smeagol → assets/smeagol}/pygment.css +0 -0
- data/lib/smeagol/public/assets/smeagol/template.css +631 -0
- data/lib/smeagol/repository.rb +85 -0
- data/lib/smeagol/settings.rb +302 -0
- data/lib/smeagol/templates/layouts/page.mustache +19 -0
- data/lib/smeagol/templates/layouts/versions.mustache +16 -0
- data/lib/smeagol/templates/partials/footer.mustache +17 -0
- data/lib/smeagol/templates/partials/header.mustache +47 -0
- data/lib/smeagol/templates/settings.yml +64 -0
- data/lib/smeagol/version.rb +1 -1
- data/lib/smeagol/views/base.rb +188 -27
- data/lib/smeagol/views/form.rb +56 -0
- data/lib/smeagol/views/page.rb +126 -25
- data/lib/smeagol/views/post.rb +51 -0
- data/lib/smeagol/views/versions.rb +20 -6
- data/lib/smeagol/wiki.rb +25 -45
- data/test/helper.rb +72 -8
- data/test/test_app.rb +57 -0
- data/test/test_cache.rb +10 -11
- data/test/test_init.rb +27 -0
- data/test/test_update.rb +20 -0
- data/test/test_wiki.rb +13 -10
- metadata +142 -216
- data/bin/smeagol-static +0 -115
- data/lib/file.rb +0 -10
- data/lib/smeagol/hash.rb +0 -13
- data/lib/smeagol/option_parser.rb +0 -138
- data/lib/smeagol/public/smeagol/main.css +0 -234
- data/lib/smeagol/templates/page.mustache +0 -58
- data/lib/smeagol/templates/versions.mustache +0 -50
- data/test/test_file.rb +0 -12
- data/test/test_hash.rb +0 -18
@@ -1,58 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
5
|
-
<title>{{wiki_title}} - {{page_title}}</title>
|
6
|
-
<link rel="stylesheet" href="/smeagol/main.css" type="text/css"/>
|
7
|
-
<link rel="stylesheet" href="/smeagol/pygment.css" type="text/css"/>
|
8
|
-
|
9
|
-
<!--[if lt IE 9]>
|
10
|
-
<script src="/smeagol/html5.js"></script>
|
11
|
-
<![endif]-->
|
12
|
-
|
13
|
-
{{#tracking_id}}
|
14
|
-
<script type="text/javascript">
|
15
|
-
var _gaq = _gaq || [];
|
16
|
-
_gaq.push(['_setAccount', '{{{tracking_id}}}']);
|
17
|
-
_gaq.push(['_trackPageview']);
|
18
|
-
|
19
|
-
(function() {
|
20
|
-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
21
|
-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
22
|
-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
23
|
-
})();
|
24
|
-
</script>
|
25
|
-
{{/tracking_id}}
|
26
|
-
</head>
|
27
|
-
|
28
|
-
<body>
|
29
|
-
{{{ribbon_html}}}
|
30
|
-
|
31
|
-
<div id="container">
|
32
|
-
<header>
|
33
|
-
<h1>{{wiki_title}}</h1>
|
34
|
-
</header>
|
35
|
-
|
36
|
-
<nav>
|
37
|
-
{{{menu_html}}}
|
38
|
-
</nav>
|
39
|
-
|
40
|
-
<article>
|
41
|
-
{{#not_home?}}
|
42
|
-
<h1>{{page_title}}</h1>
|
43
|
-
{{/not_home?}}
|
44
|
-
<div id="content">
|
45
|
-
{{{content}}}
|
46
|
-
</div>
|
47
|
-
</article>
|
48
|
-
|
49
|
-
<footer>
|
50
|
-
<small>Last edited by <b>{{author}}</b> on {{date}}.</small>
|
51
|
-
<small style="float:right;">
|
52
|
-
This site is a <a href="https://github.com/blog/699-making-github-more-open-git-backed-wikis">GitHub Wiki</a>
|
53
|
-
mirror powered by <a href="http://smeagolrb.info">Smeagol</a>.
|
54
|
-
</small>
|
55
|
-
</footer>
|
56
|
-
</div>
|
57
|
-
</body>
|
58
|
-
</html>
|
@@ -1,50 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
5
|
-
<title>{{wiki_title}} - Versions</title>
|
6
|
-
<link rel="stylesheet" href="/smeagol/main.css" type="text/css"/>
|
7
|
-
|
8
|
-
<!--[if lt IE 9]>
|
9
|
-
<script src="/smeagol/html5.js"></script>
|
10
|
-
<![endif]-->
|
11
|
-
|
12
|
-
{{#tracking_id}}
|
13
|
-
<script type="text/javascript">
|
14
|
-
var _gaq = _gaq || [];
|
15
|
-
_gaq.push(['_setAccount', '{{{tracking_id}}}']);
|
16
|
-
_gaq.push(['_trackPageview']);
|
17
|
-
|
18
|
-
(function() {
|
19
|
-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
20
|
-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
21
|
-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
22
|
-
})();
|
23
|
-
</script>
|
24
|
-
{{/tracking_id}}
|
25
|
-
</head>
|
26
|
-
|
27
|
-
<body>
|
28
|
-
{{{ribbon_html}}}
|
29
|
-
|
30
|
-
<div id="container">
|
31
|
-
<header>
|
32
|
-
<h1>{{wiki_title}}</h1>
|
33
|
-
</header>
|
34
|
-
|
35
|
-
<nav>
|
36
|
-
{{{menu_html}}}
|
37
|
-
</nav>
|
38
|
-
|
39
|
-
<article>
|
40
|
-
<h1>Versions</h1>
|
41
|
-
<div id="content">
|
42
|
-
{{{content}}}
|
43
|
-
</div>
|
44
|
-
</article>
|
45
|
-
|
46
|
-
<footer>
|
47
|
-
</footer>
|
48
|
-
</div>
|
49
|
-
</body>
|
50
|
-
</html>
|
data/test/test_file.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/helper'
|
2
|
-
|
3
|
-
class FileTestCase < MiniTest::Unit::TestCase
|
4
|
-
def test_sanitize_should_remove_parent_refs
|
5
|
-
assert_equal '/', File.sanitize_path('../')
|
6
|
-
assert_equal '/', File.sanitize_path('/..')
|
7
|
-
assert_equal '//', File.sanitize_path('/../')
|
8
|
-
assert_equal '', File.sanitize_path('..')
|
9
|
-
assert_equal '..abc', File.sanitize_path('..abc')
|
10
|
-
assert_equal '/this/is//a/test', File.sanitize_path('/this/is/../a/test')
|
11
|
-
end
|
12
|
-
end
|
data/test/test_hash.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/helper'
|
2
|
-
|
3
|
-
class HashTestCase < MiniTest::Unit::TestCase
|
4
|
-
def test_create_ostruct_root_copy
|
5
|
-
hash = {:a => 1}
|
6
|
-
assert_kind_of OpenStruct, hash.to_ostruct
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_should_create_deep_copy_hashes
|
10
|
-
hash = {:a => 1, :b => {:c => 2}}
|
11
|
-
assert_kind_of OpenStruct, hash.to_ostruct.b
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_should_create_deep_copy_arrays
|
15
|
-
hash = {:a => 1, :b => [{:c => 2}]}
|
16
|
-
assert_kind_of OpenStruct, hash.to_ostruct.b[0]
|
17
|
-
end
|
18
|
-
end
|