nwiki 0.1.0a → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-version +1 -1
- data/CHANGELOG.org +0 -4
- data/Gemfile +0 -2
- data/README.md +0 -5
- data/lib/nwiki/frontend/app.rb +1 -47
- data/lib/nwiki/version.rb +1 -1
- data/spec/nwiki/core/page_spec.rb +0 -0
- data/spec/requests/articles_spec.rb +0 -8
- data/spec/spec_helper.rb +0 -3
- metadata +11 -7
- data/.coveralls.yml +0 -1
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.3-
|
1
|
+
1.9.3-p327
|
data/CHANGELOG.org
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
# Nwiki
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/niku/nwiki.png?branch=master)](https://travis-ci.org/niku/nwiki)
|
4
|
-
[![Dependency Status](https://gemnasium.com/niku/nwiki.png)](https://gemnasium.com/niku/nwiki)
|
5
|
-
[![Code Climate](https://codeclimate.com/github/niku/nwiki.png)](https://codeclimate.com/github/niku/nwiki)
|
6
|
-
[![Coverage Status](https://coveralls.io/repos/niku/nwiki/badge.png?branch=master)](https://coveralls.io/r/niku/nwiki)
|
7
|
-
|
8
3
|
TODO: Write a gem description
|
9
4
|
|
10
5
|
## Installation
|
data/lib/nwiki/frontend/app.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
1
|
require 'erb'
|
3
2
|
require 'rss'
|
4
3
|
|
@@ -7,9 +6,6 @@ module Nwiki
|
|
7
6
|
class App
|
8
7
|
def initialize git_repo_path
|
9
8
|
@builder = Rack::Builder.new {
|
10
|
-
map '/' do
|
11
|
-
run Top.new git_repo_path
|
12
|
-
end
|
13
9
|
map '/articles.xml' do
|
14
10
|
run Feed.new git_repo_path, articles_path: '/articles'
|
15
11
|
end
|
@@ -24,48 +20,6 @@ module Nwiki
|
|
24
20
|
end
|
25
21
|
end
|
26
22
|
|
27
|
-
class Top
|
28
|
-
def initialize git_repo_path, opts = {}
|
29
|
-
@wiki = Nwiki::Core::Wiki.new git_repo_path
|
30
|
-
end
|
31
|
-
|
32
|
-
def call env
|
33
|
-
[
|
34
|
-
200,
|
35
|
-
{ "Content-Type" => "text/html; charset=#{Nwiki::Core::Wiki.repo_filename_encoding}" },
|
36
|
-
[html]
|
37
|
-
]
|
38
|
-
end
|
39
|
-
|
40
|
-
def html
|
41
|
-
erb = ERB.new <<EOS
|
42
|
-
<!DOCTYPE HTML>
|
43
|
-
<html>
|
44
|
-
<head>
|
45
|
-
<meta http-equiv="refresh" content="5;URL=http://niku.name/articles/">
|
46
|
-
<title><%= @wiki.title %></title>
|
47
|
-
<link rel="alternate" type="application/atom+xml" title="ATOM Feed" href="/articles.xml">
|
48
|
-
<link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
49
|
-
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
|
50
|
-
<script src="/bootstrap/js/bootstrap.min.js"></script>
|
51
|
-
</head>
|
52
|
-
<body>
|
53
|
-
<div class="container">
|
54
|
-
<div class="row">
|
55
|
-
<div class="span12">
|
56
|
-
<h1><%= @wiki.title %></h1>
|
57
|
-
<h2><%= @wiki.subtitle %></h2>
|
58
|
-
<p>ここまだ何にも作ってないんす.<a href="./articles/">articles</a>以下が動いているのでそっちを見てね.5秒経つと自動で移動します.</p>
|
59
|
-
</div>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
</body>
|
63
|
-
</html>
|
64
|
-
EOS
|
65
|
-
erb.result(binding).force_encoding(Nwiki::Core::Wiki.repo_filename_encoding)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
23
|
class Feed
|
70
24
|
attr_reader :articles_path
|
71
25
|
|
@@ -148,7 +102,7 @@ EOS
|
|
148
102
|
<div class="container">
|
149
103
|
<div class="row">
|
150
104
|
<div class="span12">
|
151
|
-
<h1
|
105
|
+
<h1><%= @wiki.title %></h1>
|
152
106
|
<h2><%= @wiki.subtitle %></h2>
|
153
107
|
<%= page.to_html %>
|
154
108
|
</div>
|
data/lib/nwiki/version.rb
CHANGED
File without changes
|
@@ -14,14 +14,6 @@ module Nwiki
|
|
14
14
|
get path
|
15
15
|
end
|
16
16
|
|
17
|
-
context 'GET /' do
|
18
|
-
let(:path) { '/' }
|
19
|
-
|
20
|
-
it { subject.should be_ok }
|
21
|
-
it { subject.should match %r!\bヽ(´・肉・`)ノログ\b! }
|
22
|
-
it { subject.should match %r!\bHow do we fighting without fighting?\b! }
|
23
|
-
end
|
24
|
-
|
25
17
|
context 'GET /articles' do
|
26
18
|
let(:path) { '/articles/' }
|
27
19
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'nwiki'
|
2
2
|
require 'rack/test'
|
3
|
-
require 'coveralls'
|
4
3
|
|
5
4
|
RSpec.configure do |config|
|
6
5
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
@@ -8,5 +7,3 @@ RSpec.configure do |config|
|
|
8
7
|
config.filter_run :focus
|
9
8
|
config.include Rack::Test::Methods
|
10
9
|
end
|
11
|
-
|
12
|
-
Coveralls.wear!
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nwiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- niku
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gollum-lib
|
@@ -162,7 +162,6 @@ executables: []
|
|
162
162
|
extensions: []
|
163
163
|
extra_rdoc_files: []
|
164
164
|
files:
|
165
|
-
- .coveralls.yml
|
166
165
|
- .gitignore
|
167
166
|
- .rspec
|
168
167
|
- .ruby-version
|
@@ -248,6 +247,7 @@ files:
|
|
248
247
|
- spec/examples/sample.git/refs/heads/config
|
249
248
|
- spec/examples/sample.git/refs/heads/master
|
250
249
|
- spec/nwiki/core/git_access_spec.rb
|
250
|
+
- spec/nwiki/core/page_spec.rb
|
251
251
|
- spec/nwiki/core/wiki_spec.rb
|
252
252
|
- spec/requests/articles_spec.rb
|
253
253
|
- spec/spec_helper.rb
|
@@ -265,13 +265,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
265
265
|
version: '0'
|
266
266
|
segments:
|
267
267
|
- 0
|
268
|
-
hash:
|
268
|
+
hash: 3045566447973314358
|
269
269
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
270
|
none: false
|
271
271
|
requirements:
|
272
|
-
- - ! '
|
272
|
+
- - ! '>='
|
273
273
|
- !ruby/object:Gem::Version
|
274
|
-
version:
|
274
|
+
version: '0'
|
275
|
+
segments:
|
276
|
+
- 0
|
277
|
+
hash: 3045566447973314358
|
275
278
|
requirements: []
|
276
279
|
rubyforge_project:
|
277
280
|
rubygems_version: 1.8.23
|
@@ -337,6 +340,7 @@ test_files:
|
|
337
340
|
- spec/examples/sample.git/refs/heads/config
|
338
341
|
- spec/examples/sample.git/refs/heads/master
|
339
342
|
- spec/nwiki/core/git_access_spec.rb
|
343
|
+
- spec/nwiki/core/page_spec.rb
|
340
344
|
- spec/nwiki/core/wiki_spec.rb
|
341
345
|
- spec/requests/articles_spec.rb
|
342
346
|
- spec/spec_helper.rb
|
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
service_name: travis-ci
|