static_docs 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +178 -2
- data/app/controllers/static_docs/pages_controller.rb +1 -1
- data/app/models/static_docs/page.rb +2 -1
- data/config/routes.rb +1 -1
- data/lib/static_docs/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +2469 -0
- data/test/dummy/sources/namespace/{home.html → index.html} +0 -0
- data/test/dummy/sources/namespace/index.yml +2 -2
- data/test/dummy/sources/root/{home.html → index.html} +0 -0
- data/test/dummy/sources/root/index.yml +2 -2
- data/test/fixtures/static_docs/pages.yml +8 -1
- data/test/unit/static_docs/importer_test.rb +2 -2
- data/test/unit/static_docs/page_test.rb +8 -0
- metadata +8 -8
File without changes
|
File without changes
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
home_page:
|
4
4
|
title: Main page
|
5
|
-
path:
|
5
|
+
path: index
|
6
6
|
body: '<h3>This is home page</h3>'
|
7
7
|
extension: html
|
8
8
|
|
@@ -18,6 +18,13 @@ deep_page:
|
|
18
18
|
body: '<h3>This is third level page</h3>'
|
19
19
|
extension: html
|
20
20
|
|
21
|
+
namespaced_index_page:
|
22
|
+
title: Namespaced Index Page
|
23
|
+
path: 'index'
|
24
|
+
namespace: 'namespace'
|
25
|
+
body: '<h3>This is namespaced index page</h3>'
|
26
|
+
extension: html
|
27
|
+
|
21
28
|
namespaced_page:
|
22
29
|
title: Namespaced Page
|
23
30
|
path: 'page'
|
@@ -27,7 +27,7 @@ module StaticDocs
|
|
27
27
|
|
28
28
|
test 'import root' do
|
29
29
|
Importer.import(nil)
|
30
|
-
main = Page.matched('
|
30
|
+
main = Page.matched('index')
|
31
31
|
assert_equal main.title, 'Main Page'
|
32
32
|
assert_equal main.extension, 'html'
|
33
33
|
assert_equal main.body, "<p>Hello from homepage!</p>\n"
|
@@ -39,7 +39,7 @@ module StaticDocs
|
|
39
39
|
|
40
40
|
test 'import namespaced' do
|
41
41
|
Importer.import('namespace')
|
42
|
-
main = Page.matched('namespace/
|
42
|
+
main = Page.matched('namespace/index')
|
43
43
|
assert_equal main.title, 'Namespace Main Page'
|
44
44
|
assert_equal main.extension, 'html'
|
45
45
|
assert_equal main.body, "<p>Hello from namespace!</p>\n"
|
@@ -8,6 +8,10 @@ module StaticDocs
|
|
8
8
|
@view_context = Object.new.extend ::ApplicationHelper
|
9
9
|
end
|
10
10
|
|
11
|
+
test 'index search' do
|
12
|
+
assert_equal Page.matched(''), static_docs_pages(:home_page)
|
13
|
+
end
|
14
|
+
|
11
15
|
test "first-level search of matched page" do
|
12
16
|
assert_equal Page.matched('page'), static_docs_pages(:first_level_page)
|
13
17
|
end
|
@@ -16,6 +20,10 @@ module StaticDocs
|
|
16
20
|
assert_equal Page.matched('path/to/page'), static_docs_pages(:deep_page)
|
17
21
|
end
|
18
22
|
|
23
|
+
test 'namespaced index search' do
|
24
|
+
assert_equal Page.matched('namespace'), static_docs_pages(:namespaced_index_page)
|
25
|
+
end
|
26
|
+
|
19
27
|
test "namespaced search of matched page" do
|
20
28
|
assert_equal Page.matched('namespace/page'), static_docs_pages(:namespaced_page)
|
21
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: static_docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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: 2013-05-
|
12
|
+
date: 2013-05-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -108,11 +108,11 @@ files:
|
|
108
108
|
- test/dummy/Rakefile
|
109
109
|
- test/dummy/README.rdoc
|
110
110
|
- test/dummy/script/rails
|
111
|
-
- test/dummy/sources/namespace/
|
111
|
+
- test/dummy/sources/namespace/index.html
|
112
112
|
- test/dummy/sources/namespace/index.yml
|
113
113
|
- test/dummy/sources/namespace/page.html
|
114
114
|
- test/dummy/sources/root/getting_started.html
|
115
|
-
- test/dummy/sources/root/
|
115
|
+
- test/dummy/sources/root/index.html
|
116
116
|
- test/dummy/sources/root/index.yml
|
117
117
|
- test/dummy/sources/root/page.html
|
118
118
|
- test/fixtures/static_docs/pages.yml
|
@@ -137,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
segments:
|
139
139
|
- 0
|
140
|
-
hash:
|
140
|
+
hash: 785843014770198888
|
141
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
142
|
none: false
|
143
143
|
requirements:
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
segments:
|
148
148
|
- 0
|
149
|
-
hash:
|
149
|
+
hash: 785843014770198888
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
152
|
rubygems_version: 1.8.25
|
@@ -190,11 +190,11 @@ test_files:
|
|
190
190
|
- test/dummy/Rakefile
|
191
191
|
- test/dummy/README.rdoc
|
192
192
|
- test/dummy/script/rails
|
193
|
-
- test/dummy/sources/namespace/
|
193
|
+
- test/dummy/sources/namespace/index.html
|
194
194
|
- test/dummy/sources/namespace/index.yml
|
195
195
|
- test/dummy/sources/namespace/page.html
|
196
196
|
- test/dummy/sources/root/getting_started.html
|
197
|
-
- test/dummy/sources/root/
|
197
|
+
- test/dummy/sources/root/index.html
|
198
198
|
- test/dummy/sources/root/index.yml
|
199
199
|
- test/dummy/sources/root/page.html
|
200
200
|
- test/fixtures/static_docs/pages.yml
|