rblosxom 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +3 -0
- data/Manifest +2 -0
- data/VERSION +1 -1
- data/config/main.yml +14 -0
- data/config/rackup.ru +3 -0
- data/config/wiki.yml +14 -0
- data/demo/main.rb +5 -1
- data/demo/wiki_render.rb +6 -3
- data/lib/rblosxom/base.rb +2 -1
- data/rblosxom.gemspec +3 -3
- data/views/wikis.haml +1 -1
- metadata +5 -3
data/ChangeLog
CHANGED
data/Manifest
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/config/main.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
title: Rblosxom
|
2
|
+
slogan: a blosxom program.
|
3
|
+
keywords: ruby, blosxom.
|
4
|
+
description: Rblosxom is a blosxom program.
|
5
|
+
language: en
|
6
|
+
datadir: ./data/main
|
7
|
+
url: http://rblosxom.heroku.com/
|
8
|
+
depth: 0
|
9
|
+
num_entries: 40
|
10
|
+
file_extension: mkd
|
11
|
+
default_flavour: html
|
12
|
+
show_future_entries: 0
|
13
|
+
theme: default
|
14
|
+
copyright: Rblosxom
|
data/config/rackup.ru
CHANGED
@@ -15,6 +15,7 @@ $LOAD_PATH.unshift File.expand_path("../demo", File.dirname(__FILE__))
|
|
15
15
|
|
16
16
|
require 'main'
|
17
17
|
Rblosxom::Main.log_level = Logger::DEBUG
|
18
|
+
Rblosxom::Main.config_file = File.expand_path("main.yml", File.dirname(__FILE__))
|
18
19
|
map "/" do
|
19
20
|
run Rblosxom::Main
|
20
21
|
end
|
@@ -25,6 +26,8 @@ map '/grid' do
|
|
25
26
|
end
|
26
27
|
|
27
28
|
require 'wiki_render'
|
29
|
+
Rblosxom::Wiki.root = File.expand_path("..", File.dirname(__FILE__))
|
30
|
+
Rblosxom::Wiki.config_file = File.expand_path("wiki.yml", File.dirname(__FILE__))
|
28
31
|
map '/wiki' do
|
29
32
|
run Rblosxom::Wiki
|
30
33
|
end
|
data/config/wiki.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
title: Rblosxom Wiki
|
2
|
+
slogan: a blosxom program.
|
3
|
+
keywords: ruby, blosxom.
|
4
|
+
description: Rblosxom is a blosxom program.
|
5
|
+
language: en
|
6
|
+
datadir: ./data/wiki
|
7
|
+
url: http://rblosxom.heroku.com/
|
8
|
+
depth: 0
|
9
|
+
num_entries: 40
|
10
|
+
file_extension: mkd
|
11
|
+
default_flavour: html
|
12
|
+
show_future_entries: 0
|
13
|
+
theme: default
|
14
|
+
copyright: Rblosxom
|
data/demo/main.rb
CHANGED
@@ -6,7 +6,11 @@ module Rblosxom
|
|
6
6
|
set_common_variables
|
7
7
|
@log.info "Main start"
|
8
8
|
@log.debug "Main debug"
|
9
|
-
|
9
|
+
index_file = File.expand_path("#{@root}/#{@config["datadir"]}/main.mkd")
|
10
|
+
unless File.exist?(index_file)
|
11
|
+
index_file = File.expand_path("#{@root}/README.mkd")
|
12
|
+
end
|
13
|
+
content = File.read(index_file)
|
10
14
|
haml :index, :layout => true, :locals => { :content => content }
|
11
15
|
end
|
12
16
|
end
|
data/demo/wiki_render.rb
CHANGED
@@ -17,7 +17,9 @@ module Rblosxom
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def pages
|
20
|
-
(
|
20
|
+
Dir.chdir(File.expand_path("#{@root}/#{@config["datadir"]}")) {
|
21
|
+
(Dir["**/*.mkd"] + Dir["**/*.markdown"] + Dir["**/*.textile"]).sort
|
22
|
+
}
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -41,7 +43,8 @@ module Rblosxom
|
|
41
43
|
@log.info "Wiki Render #{request.env["PATH_INFO"]}"
|
42
44
|
@log.info "Wiki Render #{params[:captures]}"
|
43
45
|
|
44
|
-
request_file = request.env["PATH_INFO"][1..-1]
|
46
|
+
request_file = File.expand_path("#{@root}/#{@config["datadir"]}/#{request.env["PATH_INFO"][1..-1]}")
|
47
|
+
@log.debug "Wiki Render request file: #{request_file}"
|
45
48
|
begin
|
46
49
|
content = File.open(request_file) do |file|
|
47
50
|
ext = request_file.split(".")[-1];
|
@@ -53,7 +56,7 @@ module Rblosxom
|
|
53
56
|
else
|
54
57
|
file.read
|
55
58
|
end
|
56
|
-
|
59
|
+
end
|
57
60
|
haml :wiki, :layout => true, :locals => { :content => content }
|
58
61
|
rescue
|
59
62
|
#raise Sinatra::NotFound
|
data/lib/rblosxom/base.rb
CHANGED
@@ -16,6 +16,7 @@ module Rblosxom
|
|
16
16
|
def set_common_variables
|
17
17
|
require 'fileutils'
|
18
18
|
require 'logger'
|
19
|
+
@root = options.root
|
19
20
|
@config = options.config
|
20
21
|
@log = Proc.new {
|
21
22
|
if options.log_file
|
@@ -71,7 +72,7 @@ module Rblosxom
|
|
71
72
|
keywords: ruby, blosxom.
|
72
73
|
description: Rblosxom is a blosxom program.
|
73
74
|
language: en
|
74
|
-
datadir:
|
75
|
+
datadir: ./data
|
75
76
|
url: http://rblosxom.heroku.com/
|
76
77
|
depth: 0
|
77
78
|
num_entries: 40
|
data/rblosxom.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{rblosxom}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Percy Lau"]
|
9
|
-
s.date = %q{2011-01-
|
9
|
+
s.date = %q{2011-01-03}
|
10
10
|
s.default_executable = %q{rblosxom-demo}
|
11
11
|
s.description = %q{Rblosxom is a blosxom program written in ruby.}
|
12
12
|
s.email = %q{percy.lau@gmail.com}
|
13
13
|
s.executables = ["rblosxom-demo"]
|
14
14
|
s.extra_rdoc_files = ["README.mkd", "bin/rblosxom-demo", "lib/rblosxom.rb", "lib/rblosxom/base.rb"]
|
15
|
-
s.files = ["AUTHORS", "ChangeLog", "INSTALL", "MIT-LICENSE", "Manifest", "README.mkd", "Rakefile", "VERSION", "bin/rblosxom-demo", "config/rackup.ru", "demo/grid.rb", "demo/main.rb", "demo/wiki_render.rb", "lib/rblosxom.rb", "lib/rblosxom/base.rb", "public/config.rb", "public/images/12_col.gif", "public/images/16_col.gif", "public/sass/grid.sass", "public/sass/screen.sass", "public/stylesheets/grid.css", "public/stylesheets/screen.css", "rblosxom.gemspec", "views/footer.haml", "views/grid.haml", "views/header.haml", "views/index.haml", "views/layout.haml", "views/404.haml", "views/500.haml", "views/wiki.haml", "views/wikis.haml"]
|
15
|
+
s.files = ["AUTHORS", "ChangeLog", "INSTALL", "MIT-LICENSE", "Manifest", "README.mkd", "Rakefile", "VERSION", "bin/rblosxom-demo", "config/rackup.ru", "config/main.yml", "config/wiki.yml", "demo/grid.rb", "demo/main.rb", "demo/wiki_render.rb", "lib/rblosxom.rb", "lib/rblosxom/base.rb", "public/config.rb", "public/images/12_col.gif", "public/images/16_col.gif", "public/sass/grid.sass", "public/sass/screen.sass", "public/stylesheets/grid.css", "public/stylesheets/screen.css", "rblosxom.gemspec", "views/footer.haml", "views/grid.haml", "views/header.haml", "views/index.haml", "views/layout.haml", "views/404.haml", "views/500.haml", "views/wiki.haml", "views/wikis.haml"]
|
16
16
|
s.homepage = %q{http://rblosxom.heroku.com}
|
17
17
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rblosxom", "--main", "README.mkd"]
|
18
18
|
s.require_paths = ["lib"]
|
data/views/wikis.haml
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Percy Lau
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-03 00:00:00 +08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -91,6 +91,8 @@ files:
|
|
91
91
|
- VERSION
|
92
92
|
- bin/rblosxom-demo
|
93
93
|
- config/rackup.ru
|
94
|
+
- config/main.yml
|
95
|
+
- config/wiki.yml
|
94
96
|
- demo/grid.rb
|
95
97
|
- demo/main.rb
|
96
98
|
- demo/wiki_render.rb
|