rblosxom 0.1.5 → 0.1.6

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 CHANGED
@@ -1,3 +1,12 @@
1
+ 2011-02-12 14:06:21 +0800 Percy Lau <percy.lau@gmail.com> 0.1.6
2
+ * move src to gitorious
3
+
4
+ 2011-01-28 13:22:35 +0800 Percy Lau <percy.lau@gmail.com>
5
+ * fix haml texile filter list render error.
6
+
7
+ 2011-01-27 12:19:55 +0800 Percy Lau <percy.lau@gmail.com>
8
+ * fix ctrl-c no longer stops webrick cleanly.
9
+
1
10
  2011-01-08 00:30:50 +0800 Percy Lau <percy.lau@gmail.com> 0.1.5
2
11
  * remove markdown support, only support textile page
3
12
 
data/INSTALL CHANGED
@@ -1,26 +1,40 @@
1
- == INSTALL
1
+ h3. INSTALL
2
2
 
3
3
  安装 rblosxom gem:
4
+ <pre>
4
5
  $ gem install rblosxom --source http://gemcutter.org
6
+ </pre>
5
7
 
6
8
  运行 demo:
9
+ <pre>
7
10
  $ rblosxom-demo
11
+ </pre>
8
12
 
9
13
  通过浏览器访问 http://127.0.0.1:7878/
10
14
 
11
- == HACKING
15
+ h3. HACKING
12
16
 
13
- 下载 source
14
- $ hg clone https://pernn@bitbucket.org/pernn/rblosxom
17
+ clone source
18
+ <pre>
19
+ $ hg clone https://liupeng@bitbucket.org/liupeng/rblosxom
20
+ </pre>
15
21
 
16
- 安装 rack, sinatra, haml, RedCloth, itsucks-compass-960-plugin
17
- $ gem install sinatra, haml, RedCloth, itsucks-compass-960-plugin
22
+ 调试运行, 需要安装 sinatra haml RedCloth
23
+ <pre>
24
+ $ for g in sinatra haml RedCloth ;do gem install $g;done
25
+ $ rackup config/rackup.ru
26
+ </pre>
18
27
 
19
- 定制 theme:
28
+ 定制 theme(css), 需要安装 itsucks-compass-960-plugin:
29
+ <pre>
30
+ $ gem install itsucks-compass-960-plugin
20
31
  $ compass -r ninesixty -f 960 --sass-dir=sass --css-dir=stylesheets --javascript-dir=javascripts --images-dir=images public
21
-
22
- 更新 css:
32
+ ...
23
33
  $ compass -u public
34
+ </pre>
24
35
 
25
- 运行:
26
- $ rackup config/rackup.ru
36
+ 制作 gem, 需要安装 echoe:
37
+ <pre>
38
+ $ gem install echoe
39
+ $ rake gem
40
+ </pre>
@@ -23,11 +23,11 @@ Released under "MIT License":license.
23
23
 
24
24
 
25
25
  [blosxom]http://blosxom.sourceforge.net/
26
- [rblosxom]http://bitbucket.org/pernn/rblosxom/
26
+ [rblosxom]http://bitbucket.org/liupeng/rblosxom/
27
27
  [sinatra]http://www.sinatrarb.com/
28
28
  [haml]http://haml.hamptoncatlin.com/
29
29
  [compass_960]http://github.com/chriseppstein/compass-960-plugin/
30
30
  [RedCloth]http://redcloth.org/
31
- [license]http://bitbucket.org/pernn/rblosxom/src/tip/MIT-LICENSE
32
- [install]http://bitbucket.org/pernn/rblosxom/src/tip/INSTALL
33
- [changelog]http://bitbucket.org/pernn/rblosxom/src/tip/ChangeLog
31
+ [license]http://bitbucket.org/liupeng/rblosxom/src/tip/MIT-LICENSE
32
+ [install]http://bitbucket.org/liupeng/rblosxom/src/tip/INSTALL
33
+ [changelog]http://bitbucket.org/liupeng/rblosxom/src/tip/ChangeLog
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
@@ -1,28 +1,56 @@
1
1
  #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*- vim: encoding=utf-8:sw=4:ts=4:sts=4:et:
3
+ $KCODE = 'u'
4
+
2
5
  require 'rubygems'
3
- require 'rack'
6
+ require 'rack/server'
4
7
  require 'rblosxom'
5
-
6
- options = {:Port => 7878, :Host => "0.0.0.0", :AccessLog => []}
8
+ require 'optparse'
7
9
 
8
10
  install_dir = File.join(Gem.dir, "gems", "rblosxom-#{Rblosxom::Version::STRING}")
9
11
  rackup_file = File.join(install_dir, "config/rackup.ru")
10
12
  inner_app = eval "Rack::Builder.new {( " + File.read(rackup_file) + "\n )}.to_app", nil, rackup_file
11
-
12
- begin
13
- server = Rack::Handler::Mongrel
14
- rescue LoadError => e
15
- server = Rack::Handler::WEBrick
16
- end
17
-
13
+ server = Rack::Handler.default
18
14
  app = Rack::Builder.new {
19
- use Rack::CommonLogger, $stderr unless server.name =~ /CGI/
15
+ use Rack::CommonLogger, $stderr unless server.name =~ /CGI/
20
16
  use Rack::ShowExceptions
21
17
  use Rack::Lint
22
18
  run inner_app
23
19
  }.to_app
24
20
 
25
- server.run app, options
21
+ options = {:Port => 7878}
22
+ opt = OptionParser.new("#{File.basename($0)}")
23
+ opt.on('-p', '--port PORT', 'use PORT (1024-65536, default: 7878)') {|v| options[:Port] = v }
24
+ opt.parse!(ARGV)
25
+
26
+
27
+ class PatchedRackServer < Rack::Server
28
+ def initialize(options = nil)
29
+ @options = options
30
+ @app = options[:app] if options && options[:app]
31
+ end
32
+ end
33
+
34
+ $stdout.puts <<EOF
35
+ ----------------------------------------
36
+ Start up rblosxom !
37
+ URL : http://localhost:#{options[:Port]}
38
+ ----------------------------------------
39
+ EOF
40
+
41
+ if Rack.release >= "1.2"
42
+ # The code that traps Ctrl-C moved from Rack::Handler to Rack::Server in
43
+ # Rack 1.2.1, and consequently, so did the syntax to start a server.
44
+ # See: https://github.com/rack/rack/issues/issue/35
45
+ #
46
+ # Additionally, there is currently a bug in Rack::Server which prevents
47
+ # us from using :app properly. In order to get around this, we subclass
48
+ # Rack::Server, and then apply the patch there.
49
+ # See: https://github.com/rack/rack/commit/c73b474525bace3f059a130b15413abd4d917086
50
+ PatchedRackServer.start(:app => app, :Port => options[:Port])
51
+ #Rack::Server.start(:app => app, :Port => 7878)
52
+ else
53
+ server.run app, options
54
+ end
26
55
 
27
- # vim: ft=ruby:fenc=utf-8:sw=4:ts=4:sts=4:et:
28
56
  # rblosxom-demo.rb end here
@@ -1,4 +1,5 @@
1
1
  require 'sinatra'
2
+ require 'redcloth'
2
3
  require 'logger'
3
4
  begin
4
5
  require 'rblosxom'
@@ -1,4 +1,8 @@
1
+ # -*- coding: utf-8 -*- vim: encoding=utf-8:sw=4:ts=4:sts=4:et:
2
+ $KCODE = 'u'
3
+
1
4
  require 'rblosxom/base'
5
+ require 'uri'
2
6
 
3
7
  module Rblosxom
4
8
  class Base < Sinatra::Base
@@ -35,7 +39,7 @@ module Rblosxom
35
39
  haml :wikis, :layout => true
36
40
  end
37
41
 
38
- page_regex = '(?:/[.\w]+)+'
42
+ page_regex = '(?:/.+)+'
39
43
  page_url = %r@^(#{page_regex})\b$@
40
44
  get page_url do
41
45
  set_common_variables
@@ -45,7 +49,7 @@ module Rblosxom
45
49
  request_file = File.expand_path("#{@root}/#{@config["datadir"]}/#{request.env["PATH_INFO"][1..-1]}")
46
50
  @log.debug "Wiki Render request file: #{request_file}"
47
51
  begin
48
- haml :wiki, :layout => true, :locals => { :content => File.read(request_file) }
52
+ haml :wiki, :layout => true, :locals => { :content => File.read(URI.decode(request_file)) }
49
53
  rescue
50
54
  #raise Sinatra::NotFound
51
55
  halt 404, 'page not found!'
@@ -54,5 +58,4 @@ module Rblosxom
54
58
  end
55
59
  end
56
60
 
57
- # vim: ft=ruby:fenc=utf-8:sw=4:ts=4:sts=4:et:
58
61
  # wiki_render.rb end here
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rblosxom}
5
- s.version = "0.1.5"
5
+ s.version = "0.1.6"
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-09}
9
+ s.date = %q{2011-02-12}
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}
@@ -1,9 +1,7 @@
1
1
  #wrap
2
2
  #header= haml :header, :layout => false
3
3
  #main.clearfix
4
- .g12
5
- :textile
6
- #{content}
4
+ .g12= textile("#{content}")
7
5
 
8
6
  #footer
9
7
  .inner= haml :footer, :layout => false, :locals => { }
@@ -1,9 +1,7 @@
1
1
  #wrap
2
2
  #header= haml :header, :layout => false
3
3
  #main.clearfix
4
- .g12
5
- :textile
6
- #{content}
4
+ .g12= textile("#{content}")
7
5
 
8
6
  #footer
9
7
  .inner= haml :footer, :layout => false, :locals => { }
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
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-09 00:00:00 +08:00
17
+ date: 2011-02-12 00:00:00 +08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency