slimdown 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/README.md +27 -0
- data/lib/slimdown/page_parser.rb +5 -2
- data/lib/slimdown/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 821906b4f1541b173b0f19354d5bdebd2eb50b1e
|
4
|
+
data.tar.gz: f0d15a6d6242c5b6c6d25a1eb544fdba74cfa308
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1c986b659811c0da2f8505d9de29154da51d2d684d6bab002ece6a4d7fa58ff8424459137d5ae4d0824724a60a04c5076b11c46dc118e0e2fcee78f129993f8
|
7
|
+
data.tar.gz: 107ce9126d1a2fd9817af239dc7c803ecf05c9df3203ea6c7ba469743a1d7003fe244cdfd5ba98eb9bfa024f27e9535013c3949a4bc868529e51ab10ecc20ddd
|
data/README.md
CHANGED
@@ -64,6 +64,33 @@ to your pages.
|
|
64
64
|
c.location = Rails.root.join('lib/pages')
|
65
65
|
end
|
66
66
|
|
67
|
+
## Testing
|
68
|
+
|
69
|
+
Testing using a controller spec is not possible because you are testing for an
|
70
|
+
arbitrary url. You can do a feature test with Capybara or friends. However,
|
71
|
+
given that you are just returning content, you can use a request spec. For
|
72
|
+
example, you have an about.md in your remote repo or lib/pages then in your
|
73
|
+
spec/requests/slimdown_request_spec.rb. Additionally, you can override the page
|
74
|
+
path for the test, allowing you to use a fixture directory.
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
RSpec.describe "Static Pages", type: :request do
|
78
|
+
before :each do
|
79
|
+
Slimdown.config do |c|
|
80
|
+
c.location = Rails.root.join '/spec/fixtures/test_pages'
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe "GET /" do
|
85
|
+
it "#show" do
|
86
|
+
get "/about"
|
87
|
+
expect(response).to render_template(:show)
|
88
|
+
expect(response.status).to be(200)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
```
|
93
|
+
|
67
94
|
|
68
95
|
## General notes
|
69
96
|
|
data/lib/slimdown/page_parser.rb
CHANGED
@@ -21,7 +21,10 @@ module Slimdown
|
|
21
21
|
#
|
22
22
|
# @return [Hash] document headers
|
23
23
|
def headers
|
24
|
-
|
24
|
+
head = {}
|
25
|
+
head = YAML.load @header_text unless @header_text == ''
|
26
|
+
|
27
|
+
head
|
25
28
|
end
|
26
29
|
|
27
30
|
# The parsed markdown document body.
|
@@ -48,7 +51,7 @@ module Slimdown
|
|
48
51
|
part = :body
|
49
52
|
elsif part == :header
|
50
53
|
@header_text += line
|
51
|
-
elsif part == :body
|
54
|
+
elsif part == :body || part == nil
|
52
55
|
@body_text += line
|
53
56
|
end
|
54
57
|
end
|
data/lib/slimdown/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slimdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Johnston
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.4.
|
157
|
+
rubygems_version: 2.4.8
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: A system for using static Markdown for pages.
|