nwiki 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.org CHANGED
@@ -1,4 +1,6 @@
1
1
  * CHANGELOG
2
+ ** 0.0.7
3
+ - Internal change(rack middleware into app)
2
4
  ** 0.0.6
3
5
  - [feature] Introduce twitter bootstrap
4
6
  ** 0.0.5
data/config.ru CHANGED
@@ -7,6 +7,4 @@ if ENV['RACK_ENV'] == "development"
7
7
  use Rack::Lint
8
8
  end
9
9
 
10
- map '/articles' do
11
- run Nwiki::Frontend::App.new 'spec/examples/sample.git'
12
- end
10
+ run Nwiki::Frontend::App.new 'spec/examples/sample.git'
@@ -3,6 +3,20 @@ require 'erb'
3
3
  module Nwiki
4
4
  module Frontend
5
5
  class App
6
+ def initialize git_repo_path
7
+ @builder = Rack::Builder.new {
8
+ map '/articles' do
9
+ run Html.new git_repo_path
10
+ end
11
+ }
12
+ end
13
+
14
+ def call env
15
+ @builder.call env
16
+ end
17
+ end
18
+
19
+ class Html
6
20
  def initialize git_repo_path
7
21
  @wiki = Nwiki::Core::Wiki.new git_repo_path
8
22
  raise unless @wiki.exist?
@@ -27,7 +41,7 @@ module Nwiki
27
41
  <html>
28
42
  <head>
29
43
  <title><%= page.title %> - <%= @wiki.name %></title>
30
- <link href="/css/bootstrap.css" rel="stylesheet">
44
+ <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
31
45
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
32
46
  <script src="/bootstrap/js/bootstrap.min.js"></script>
33
47
  </head>
data/lib/nwiki/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nwiki
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -14,8 +14,8 @@ module Nwiki
14
14
  get path
15
15
  end
16
16
 
17
- describe 'GET /' do
18
- let(:path) { '/' }
17
+ describe 'GET /articles' do
18
+ let(:path) { '/articles/' }
19
19
 
20
20
  it { subject.should be_ok }
21
21
  it { subject.should match %r!\bfoo\b! }
@@ -23,22 +23,22 @@ module Nwiki
23
23
  it { subject.should match %r!\b日本語ディレクトリ\b! }
24
24
  end
25
25
 
26
- describe 'GET /foo' do
27
- let(:path) { '/foo' }
26
+ describe 'GET /articles/foo' do
27
+ let(:path) { '/articles/foo' }
28
28
 
29
29
  it { subject.should be_ok }
30
30
  it { subject.should match %r!<h2[^>]*>Foo</h2>! }
31
31
  it { subject.should match %r!<h3[^>]*>Bar</h3>! }
32
32
  end
33
33
 
34
- describe 'GET /icon.png' do
35
- let(:path) { '/icon.png' }
34
+ describe 'GET /articles/icon.png' do
35
+ let(:path) { '/articles/icon.png' }
36
36
  it { subject.should be_ok }
37
37
  it { subject['Content-Type'].should eq 'image/png' }
38
38
  end
39
39
 
40
- describe 'GET /1/2/' do
41
- let(:path) { '/1/2/' }
40
+ describe 'GET /articles/1/2/' do
41
+ let(:path) { '/articles/1/2/' }
42
42
 
43
43
  pending do 'not implement yet'
44
44
  it { subject.should be_ok }
@@ -47,8 +47,8 @@ module Nwiki
47
47
  end
48
48
  end
49
49
 
50
- describe 'GET /日本語ディレクトリ/' do
51
- let(:path) { URI.encode '/日本語ディレクトリ/' }
50
+ describe 'GET /articles/日本語ディレクトリ/' do
51
+ let(:path) { URI.encode '/articles/日本語ディレクトリ/' }
52
52
 
53
53
  pending do 'not implement yet'
54
54
  it { subject.should be_ok }
@@ -56,8 +56,8 @@ module Nwiki
56
56
  end
57
57
  end
58
58
 
59
- describe 'GET /日本語ディレクトリ/わたしだ' do
60
- let(:path) { URI.encode '/日本語ディレクトリ/わたしだ' }
59
+ describe 'GET /articles/日本語ディレクトリ/わたしだ' do
60
+ let(:path) { URI.encode '/articles/日本語ディレクトリ/わたしだ' }
61
61
 
62
62
  it { subject.should be_ok }
63
63
  it { subject.body.should match %r!<h2[^>]*>お前だったのか</h2>! }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nwiki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-09 00:00:00.000000000 Z
12
+ date: 2013-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gollum