tigefa 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.markdown +0 -144
- data/LICENSE +1 -1
- data/README.markdown +6 -10
- data/Rakefile +6 -13
- data/bin/tigefa +22 -26
- data/features/create_sites.feature +0 -11
- data/features/include_tag.feature +0 -22
- data/features/markdown.feature +4 -41
- data/features/site_configuration.feature +4 -33
- data/features/site_data.feature +4 -4
- data/features/step_definitions/{tigefa_steps.rb → jekyll_steps.rb} +17 -32
- data/features/support/env.rb +2 -38
- data/lib/site_template/_config.yml +2 -2
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +1 -0
- data/lib/site_template/css/main.css +15 -15
- data/lib/tigefa.rb +2 -5
- data/lib/tigefa/cleaner.rb +8 -8
- data/lib/tigefa/commands/build.rb +8 -14
- data/lib/tigefa/commands/new.rb +1 -1
- data/lib/tigefa/commands/serve.rb +0 -2
- data/lib/tigefa/configuration.rb +5 -21
- data/lib/tigefa/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/tigefa/converters/markdown/maruku_parser.rb +1 -6
- data/lib/tigefa/convertible.rb +6 -17
- data/lib/tigefa/core_ext.rb +0 -19
- data/lib/tigefa/deprecator.rb +1 -1
- data/lib/tigefa/filters.rb +2 -12
- data/lib/tigefa/generators/pagination.rb +6 -9
- data/lib/tigefa/page.rb +1 -1
- data/lib/tigefa/post.rb +4 -4
- data/lib/tigefa/related_posts.rb +1 -1
- data/lib/tigefa/site.rb +50 -90
- data/lib/tigefa/stevenson.rb +4 -4
- data/lib/tigefa/tags/gist.rb +1 -9
- data/lib/tigefa/tags/highlight.rb +1 -1
- data/lib/tigefa/tags/include.rb +32 -75
- data/lib/tigefa/tags/post_url.rb +4 -6
- data/lib/tigefa/url.rb +0 -2
- data/site/_includes/docs_contents.html +1 -1
- data/site/_includes/docs_contents_mobile.html +1 -1
- data/site/_includes/top.html +1 -1
- data/site/docs/configuration.md +0 -19
- data/site/docs/deployment-methods.md +3 -3
- data/site/docs/drafts.md +3 -4
- data/site/docs/history.md +3 -147
- data/site/docs/installation.md +0 -10
- data/site/docs/migrations.md +240 -3
- data/site/docs/pages.md +7 -7
- data/site/docs/pagination.md +37 -16
- data/site/docs/plugins.md +7 -72
- data/site/docs/posts.md +1 -1
- data/site/docs/structure.md +0 -17
- data/site/docs/templates.md +7 -40
- data/site/docs/upgrading.md +3 -3
- data/site/docs/usage.md +1 -1
- data/site/docs/variables.md +2 -2
- data/test/helper.rb +1 -4
- data/test/test_configuration.rb +7 -16
- data/test/test_convertible.rb +1 -1
- data/test/test_excerpt.rb +3 -3
- data/test/test_filters.rb +0 -11
- data/test/test_generated_site.rb +1 -1
- data/test/test_kramdown.rb +5 -32
- data/test/test_new_command.rb +1 -1
- data/test/test_page.rb +0 -10
- data/test/test_post.rb +1 -12
- data/test/test_redcloth.rb +3 -3
- data/test/test_site.rb +64 -58
- data/test/test_tags.rb +35 -68
- data/tigefa.gemspec +15 -39
- metadata +101 -126
- checksums.yaml +0 -7
- data/features/data.feature +0 -65
- data/lib/tigefa/entry_filter.rb +0 -35
- data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +0 -19
- data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +0 -43
- data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +0 -21
- data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +0 -30
- data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +0 -18
- data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +0 -27
- data/site/docs/datafiles.md +0 -63
- data/test/source/_config.dev.toml +0 -2
- data/test/source/_data/languages.yml +0 -2
- data/test/source/_data/members.yaml +0 -7
- data/test/source/_data/products.yml +0 -1
- data/test/source/_includes/tmp +0 -1
- data/test/source/_layouts/post/simple.html +0 -1
- data/test/source/_posts/2014-01-06-permalink-traversal.md +0 -5
- data/test/source/exploit.md +0 -5
- data/test/source/products.yml +0 -4
- data/test/source/symlink-test/_data +0 -1
- data/test/test_entry_filter.rb +0 -74
data/site/docs/posts.md
CHANGED
data/site/docs/structure.md
CHANGED
@@ -31,8 +31,6 @@ A basic Jekyll site usually looks something like this:
|
|
31
31
|
├── _posts
|
32
32
|
| ├── 2007-10-29-why-every-programmer-should-play-nethack.textile
|
33
33
|
| └── 2009-04-26-barcamp-boston-4-roundup.textile
|
34
|
-
├── _data
|
35
|
-
| └── members.yml
|
36
34
|
├── _site
|
37
35
|
└── index.html
|
38
36
|
{% endhighlight %}
|
@@ -123,21 +121,6 @@ An overview of what each of these does:
|
|
123
121
|
</p>
|
124
122
|
</td>
|
125
123
|
</tr>
|
126
|
-
<tr>
|
127
|
-
<td>
|
128
|
-
<p><code>_data</code></p>
|
129
|
-
</td>
|
130
|
-
<td>
|
131
|
-
<p>
|
132
|
-
|
133
|
-
Well-formatted site data should be placed here. The jekyll engine will
|
134
|
-
autoload all yaml files (ends with <code>.yml</code> or <code>.yaml</code>)
|
135
|
-
in this directory. If there's a file <code>members.yml</code> under the directory,
|
136
|
-
then you can access contents of the file through <code>site.data.members</code>.
|
137
|
-
|
138
|
-
</p>
|
139
|
-
</td>
|
140
|
-
</tr>
|
141
124
|
<tr>
|
142
125
|
<td>
|
143
126
|
<p><code>_site</code></p>
|
data/site/docs/templates.md
CHANGED
@@ -7,9 +7,9 @@ permalink: /docs/templates/
|
|
7
7
|
---
|
8
8
|
|
9
9
|
Jekyll uses the [Liquid](http://wiki.shopify.com/Liquid) templating language to
|
10
|
-
process templates. All of the standard Liquid
|
11
|
-
|
12
|
-
supported
|
10
|
+
process templates. All of the [standard Liquid tags and
|
11
|
+
filters](http://wiki.github.com/shopify/liquid/liquid-for-designers) are
|
12
|
+
supported, Jekyll even adds a few handy filters and tags of its own to make
|
13
13
|
common tasks easier.
|
14
14
|
|
15
15
|
## Filters
|
@@ -33,7 +33,7 @@ common tasks easier.
|
|
33
33
|
<code class='filter'>{% raw %}{{ site.time | date_to_xmlschema }}{% endraw %}</code>
|
34
34
|
</p>
|
35
35
|
<p>
|
36
|
-
<code class='output'>2008-11-
|
36
|
+
<code class='output'>2008-11-17T13:07:54-08:00</code>
|
37
37
|
</p>
|
38
38
|
</td>
|
39
39
|
</tr>
|
@@ -47,7 +47,7 @@ common tasks easier.
|
|
47
47
|
<code class='filter'>{% raw %}{{ site.time | date_to_rfc822 }}{% endraw %}</code>
|
48
48
|
</p>
|
49
49
|
<p>
|
50
|
-
<code class='output'>Mon,
|
50
|
+
<code class='output'>Mon, 17 Nov 2008 13:07:54 -0800</code>
|
51
51
|
</p>
|
52
52
|
</td>
|
53
53
|
</tr>
|
@@ -61,7 +61,7 @@ common tasks easier.
|
|
61
61
|
<code class='filter'>{% raw %}{{ site.time | date_to_string }}{% endraw %}</code>
|
62
62
|
</p>
|
63
63
|
<p>
|
64
|
-
<code class='output'>
|
64
|
+
<code class='output'>17 Nov 2008</code>
|
65
65
|
</p>
|
66
66
|
</td>
|
67
67
|
</tr>
|
@@ -75,7 +75,7 @@ common tasks easier.
|
|
75
75
|
<code class='filter'>{% raw %}{{ site.time | date_to_long_string }}{% endraw %}</code>
|
76
76
|
</p>
|
77
77
|
<p>
|
78
|
-
<code class='output'>
|
78
|
+
<code class='output'>17 November 2008</code>
|
79
79
|
</p>
|
80
80
|
</td>
|
81
81
|
</tr>
|
@@ -173,17 +173,6 @@ common tasks easier.
|
|
173
173
|
</p>
|
174
174
|
</td>
|
175
175
|
</tr>
|
176
|
-
<tr>
|
177
|
-
<td>
|
178
|
-
<p class='name'><strong>Data To JSON</strong></p>
|
179
|
-
<p>Convert Hash or Array to JSON.</p>
|
180
|
-
</td>
|
181
|
-
<td class='align-center'>
|
182
|
-
<p>
|
183
|
-
<code class='filter'>{% raw %}{{ site.data.projects | jsonify }}{% endraw %}</code>
|
184
|
-
</p>
|
185
|
-
</td>
|
186
|
-
</tr>
|
187
176
|
</tbody>
|
188
177
|
</table>
|
189
178
|
</div>
|
@@ -203,19 +192,6 @@ Jekyll expects all include files to be placed in an `_includes` directory at the
|
|
203
192
|
root of your source directory. This will embed the contents of
|
204
193
|
`<source>/_includes/footer.html` into the calling file.
|
205
194
|
|
206
|
-
<div class="note">
|
207
|
-
<h5>ProTip™: Use variables as file name</h5>
|
208
|
-
<p>
|
209
|
-
|
210
|
-
The name of the file you wish to embed can be literal (as in the example above),
|
211
|
-
or you can use a variable, using liquid-like variable syntax as in
|
212
|
-
<code>{% raw %}{% include {{my_variable}} %}{% endraw %}</code>.
|
213
|
-
|
214
|
-
Note that unlike usual liquid variable syntax, you cannot have spaces inside the curly braces.
|
215
|
-
|
216
|
-
</p>
|
217
|
-
</div>
|
218
|
-
|
219
195
|
You can also pass parameters to an include:
|
220
196
|
|
221
197
|
{% highlight ruby %}
|
@@ -290,15 +266,6 @@ will generate the correct permalink URL for the post you specify.
|
|
290
266
|
{% endraw %}
|
291
267
|
{% endhighlight %}
|
292
268
|
|
293
|
-
If you organize your posts in subdirectories, you need to include subdirectory
|
294
|
-
path to the post:
|
295
|
-
|
296
|
-
{% highlight text %}
|
297
|
-
{% raw %}
|
298
|
-
{% post_url /subdir/2010-07-21-name-of-post %}
|
299
|
-
{% endraw %}
|
300
|
-
{% endhighlight %}
|
301
|
-
|
302
269
|
There is no need to include the file extension when using the `post_url` tag.
|
303
270
|
|
304
271
|
You can also use this tag to create a link to a post in Markdown as follows:
|
data/site/docs/upgrading.md
CHANGED
@@ -42,7 +42,7 @@ rebuild each time a file changes, just add the `--watch` flag at the end.
|
|
42
42
|
### Absolute Permalinks
|
43
43
|
|
44
44
|
In Jekyll v1.0, we introduced absolute permalinks for pages in subdirectories.
|
45
|
-
Until
|
45
|
+
Until v1.1, it is **opt-in**. Starting with v1.1, however, absolute permalinks
|
46
46
|
will become **opt-out**, meaning Jekyll will default to using absolute permalinks
|
47
47
|
instead of relative permalinks.
|
48
48
|
|
@@ -50,9 +50,9 @@ instead of relative permalinks.
|
|
50
50
|
* To continue using relative permalinks, set `relative_permalinks: true` in your configuration file.
|
51
51
|
|
52
52
|
<div class="note warning" id="absolute-permalinks-warning">
|
53
|
-
<h5 markdown="1">Absolute permalinks will be default in
|
53
|
+
<h5 markdown="1">Absolute permalinks will be default in v1.1 and on</h5>
|
54
54
|
<p markdown="1">
|
55
|
-
Starting with Jekyll
|
55
|
+
Starting with Jekyll v1.1.0, `relative_permalinks` will default to `false`,
|
56
56
|
meaning all pages will be built using the absolute permalink behaviour.
|
57
57
|
The switch will still exist until v2.0.
|
58
58
|
</p>
|
data/site/docs/usage.md
CHANGED
@@ -40,7 +40,7 @@ $ jekyll serve --watch
|
|
40
40
|
# => Same as `jekyll serve`, but watch for changes and regenerate automatically.
|
41
41
|
{% endhighlight %}
|
42
42
|
|
43
|
-
|
43
|
+
This is just a few of the available [configuration options](../configuration/).
|
44
44
|
Many configuration options can either be specified as flags on the command line,
|
45
45
|
or alternatively (and more commonly) they can be specified in a `_config.yml`
|
46
46
|
file at the root of the source directory. Jekyll will automatically use the
|
data/site/docs/variables.md
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
layout: docs
|
3
3
|
title: Variables
|
4
4
|
prev_section: pages
|
5
|
-
next_section:
|
5
|
+
next_section: migrations
|
6
6
|
permalink: /docs/variables/
|
7
7
|
---
|
8
8
|
|
9
9
|
Jekyll traverses your site looking for files to process. Any files with [YAML
|
10
10
|
Front Matter](../frontmatter/) are subject to processing. For each of these
|
11
11
|
files, Jekyll makes a variety of data available via the [Liquid templating
|
12
|
-
system](http://wiki.
|
12
|
+
system](http://wiki.github.com/shopify/liquid/liquid-for-designers). The
|
13
13
|
following is a reference of the available data.
|
14
14
|
|
15
15
|
## Global Variables
|
data/test/helper.rb
CHANGED
data/test/test_configuration.rb
CHANGED
@@ -30,7 +30,7 @@ class TestConfiguration < Test::Unit::TestCase
|
|
30
30
|
@config = Configuration[{"source" => source_dir}]
|
31
31
|
@no_override = {}
|
32
32
|
@one_config_file = {"config" => "config.yml"}
|
33
|
-
@multiple_files = {"config" => %w[config/site.yml config/deploy.
|
33
|
+
@multiple_files = {"config" => %w[config/site.yml config/deploy.yml configuration.yml]}
|
34
34
|
end
|
35
35
|
|
36
36
|
should "always return an array" do
|
@@ -45,7 +45,7 @@ class TestConfiguration < Test::Unit::TestCase
|
|
45
45
|
assert_equal %w[config.yml], @config.config_files(@one_config_file)
|
46
46
|
end
|
47
47
|
should "return an array of the config files if given many config files" do
|
48
|
-
assert_equal %w[config/site.yml config/deploy.
|
48
|
+
assert_equal %w[config/site.yml config/deploy.yml configuration.yml], @config.config_files(@multiple_files)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
context "#backwards_compatibilize" do
|
@@ -102,27 +102,27 @@ class TestConfiguration < Test::Unit::TestCase
|
|
102
102
|
should "fire warning with no _config.yml" do
|
103
103
|
mock(YAML).safe_load_file(@path) { raise SystemCallError, "No such file or directory - #{@path}" }
|
104
104
|
mock($stderr).puts("Configuration file: none".yellow)
|
105
|
-
assert_equal Tigefa::Configuration::DEFAULTS,
|
105
|
+
assert_equal Tigefa::Configuration::DEFAULTS, Tigefa.configuration({})
|
106
106
|
end
|
107
107
|
|
108
108
|
should "load configuration as hash" do
|
109
109
|
mock(YAML).safe_load_file(@path) { Hash.new }
|
110
110
|
mock($stdout).puts("Configuration file: #{@path}")
|
111
|
-
assert_equal
|
111
|
+
assert_equal Tigefa::Configuration::DEFAULTS, Tigefa.configuration({})
|
112
112
|
end
|
113
113
|
|
114
114
|
should "fire warning with bad config" do
|
115
115
|
mock(YAML).safe_load_file(@path) { Array.new }
|
116
116
|
mock($stderr).puts(("WARNING: ".rjust(20) + "Error reading configuration. Using defaults (and options).").yellow)
|
117
117
|
mock($stderr).puts("Configuration file: (INVALID) #{@path}".yellow)
|
118
|
-
assert_equal
|
118
|
+
assert_equal Tigefa::Configuration::DEFAULTS, Tigefa.configuration({})
|
119
119
|
end
|
120
120
|
|
121
121
|
should "fire warning when user-specified config file isn't there" do
|
122
122
|
mock(YAML).safe_load_file(@user_config) { raise SystemCallError, "No such file or directory - #{@user_config}" }
|
123
123
|
mock($stderr).puts(("Fatal: ".rjust(20) + "The configuration file '#{@user_config}' could not be found.").red)
|
124
124
|
assert_raises LoadError do
|
125
|
-
|
125
|
+
Tigefa.configuration({'config' => [@user_config]})
|
126
126
|
end
|
127
127
|
end
|
128
128
|
end
|
@@ -131,7 +131,6 @@ class TestConfiguration < Test::Unit::TestCase
|
|
131
131
|
@paths = {
|
132
132
|
:default => File.join(Dir.pwd, '_config.yml'),
|
133
133
|
:other => File.join(Dir.pwd, '_config.live.yml'),
|
134
|
-
:toml => source_dir('_config.dev.toml'),
|
135
134
|
:empty => ""
|
136
135
|
}
|
137
136
|
end
|
@@ -154,20 +153,12 @@ class TestConfiguration < Test::Unit::TestCase
|
|
154
153
|
assert_equal Tigefa::Configuration::DEFAULTS, Tigefa.configuration({ "config" => @paths[:empty] })
|
155
154
|
end
|
156
155
|
|
157
|
-
should "successfully load a TOML file" do
|
158
|
-
Tigefa.logger.log_level = Tigefa::Stevenson::WARN
|
159
|
-
assert_equal Tigefa::Configuration::DEFAULTS.merge({ "baseurl" => "/you-beautiful-blog-you", "title" => "My magnificent site, wut" }), Tigefa.configuration({ "config" => [@paths[:toml]] })
|
160
|
-
Tigefa.logger.log_level = Tigefa::Stevenson::INFO
|
161
|
-
end
|
162
|
-
|
163
156
|
should "load multiple config files" do
|
164
157
|
mock(YAML).safe_load_file(@paths[:default]) { Hash.new }
|
165
158
|
mock(YAML).safe_load_file(@paths[:other]) { Hash.new }
|
166
|
-
mock(TOML).load_file(@paths[:toml]) { Hash.new }
|
167
159
|
mock($stdout).puts("Configuration file: #{@paths[:default]}")
|
168
160
|
mock($stdout).puts("Configuration file: #{@paths[:other]}")
|
169
|
-
|
170
|
-
assert_equal Tigefa::Configuration::DEFAULTS, Tigefa.configuration({ "config" => [@paths[:default], @paths[:other], @paths[:toml]] })
|
161
|
+
assert_equal Tigefa::Configuration::DEFAULTS, Tigefa.configuration({ "config" => [@paths[:default], @paths[:other]] })
|
171
162
|
end
|
172
163
|
|
173
164
|
should "load multiple config files and last config should win" do
|
data/test/test_convertible.rb
CHANGED
@@ -40,7 +40,7 @@ class TestConvertible < Test::Unit::TestCase
|
|
40
40
|
should "not parse if there is encoding error in file" do
|
41
41
|
name = 'broken_front_matter3.erb'
|
42
42
|
out = capture_stdout do
|
43
|
-
ret = @convertible.read_yaml(@base, name
|
43
|
+
ret = @convertible.read_yaml(@base, name)
|
44
44
|
assert_equal({}, ret)
|
45
45
|
end
|
46
46
|
assert_match(/invalid byte sequence in UTF-8/, out)
|
data/test/test_excerpt.rb
CHANGED
@@ -14,7 +14,7 @@ class TestExcerpt < Test::Unit::TestCase
|
|
14
14
|
setup do
|
15
15
|
clear_dest
|
16
16
|
stub(Tigefa).configuration do
|
17
|
-
Tigefa
|
17
|
+
Tigefa:Tigefa:Configuration::DEFAULTS.merge({'excerpt_separator' => ''})
|
18
18
|
end
|
19
19
|
@site = Site.new(Tigefa.configuration)
|
20
20
|
@post = setup_post("2013-07-22-post-excerpt-with-layout.markdown")
|
@@ -30,7 +30,7 @@ class TestExcerpt < Test::Unit::TestCase
|
|
30
30
|
setup do
|
31
31
|
clear_dest
|
32
32
|
stub(Tigefa).configuration { Tigefa::Configuration::DEFAULTS }
|
33
|
-
@site = Site.new(
|
33
|
+
@site = Site.new(Jekyll.configuration)
|
34
34
|
@post = setup_post("2013-07-22-post-excerpt-with-layout.markdown")
|
35
35
|
@excerpt = @post.send :extract_excerpt
|
36
36
|
end
|
@@ -66,7 +66,7 @@ class TestExcerpt < Test::Unit::TestCase
|
|
66
66
|
end
|
67
67
|
|
68
68
|
should "be the first paragraph of the page" do
|
69
|
-
assert_equal "<p>First paragraph with <a href
|
69
|
+
assert_equal "<p>First paragraph with <a href='http://www.jekyllrb.com/'>link ref</a>.</p>", @extracted_excerpt.content
|
70
70
|
end
|
71
71
|
|
72
72
|
should "link properly" do
|
data/test/test_filters.rb
CHANGED
@@ -98,16 +98,5 @@ class TestFilters < Test::Unit::TestCase
|
|
98
98
|
should "escape space as %20" do
|
99
99
|
assert_equal "my%20things", @filter.uri_escape("my things")
|
100
100
|
end
|
101
|
-
|
102
|
-
context "jsonify filter" do
|
103
|
-
should "convert hash to json" do
|
104
|
-
assert_equal "{\"age\":18}", @filter.jsonify({:age => 18})
|
105
|
-
end
|
106
|
-
|
107
|
-
should "convert array to json" do
|
108
|
-
assert_equal "[1,2]", @filter.jsonify([1, 2])
|
109
|
-
assert_equal "[{\"name\":\"Jack\"},{\"name\":\"Smith\"}]", @filter.jsonify([{:name => 'Jack'}, {:name => 'Smith'}])
|
110
|
-
end
|
111
|
-
end
|
112
101
|
end
|
113
102
|
end
|
data/test/test_generated_site.rb
CHANGED
data/test/test_kramdown.rb
CHANGED
@@ -12,51 +12,24 @@ class TestKramdown < Test::Unit::TestCase
|
|
12
12
|
'footnote_nr' => 1,
|
13
13
|
'entity_output' => 'as_char',
|
14
14
|
'toc_levels' => '1..6',
|
15
|
-
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo'
|
16
|
-
|
17
|
-
'use_coderay' => true,
|
18
|
-
'coderay_bold_every'=> 12,
|
19
|
-
'coderay' => {
|
20
|
-
'coderay_css' => :style,
|
21
|
-
'coderay_bold_every' => 8
|
22
|
-
}
|
15
|
+
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo'
|
23
16
|
}
|
24
17
|
}
|
25
|
-
@config = Tigefa.configuration(@config)
|
26
|
-
@markdown = Converters::Markdown.new(@config)
|
27
18
|
end
|
28
19
|
|
29
20
|
# http://kramdown.rubyforge.org/converter/html.html#options
|
30
21
|
should "pass kramdown options" do
|
31
|
-
|
22
|
+
markdown = Converters::Markdown.new(@config)
|
23
|
+
assert_equal "<h1>Some Header</h1>", markdown.convert('# Some Header #').strip
|
32
24
|
end
|
33
25
|
|
34
26
|
should "convert quotes to smart quotes" do
|
35
|
-
|
27
|
+
markdown = Converters::Markdown.new(@config)
|
28
|
+
assert_match /<p>(“|“)Pit(’|’)hy(”|”)<\/p>/, markdown.convert(%{"Pit'hy"}).strip
|
36
29
|
|
37
30
|
override = { 'kramdown' => { 'smart_quotes' => 'lsaquo,rsaquo,laquo,raquo' } }
|
38
31
|
markdown = Converters::Markdown.new(@config.deep_merge(override))
|
39
32
|
assert_match /<p>(«|«)Pit(›|›)hy(»|»)<\/p>/, markdown.convert(%{"Pit'hy"}).strip
|
40
33
|
end
|
41
|
-
|
42
|
-
context "moving up nested coderay options" do
|
43
|
-
setup do
|
44
|
-
@markdown.convert('some markup')
|
45
|
-
@converter_config = @markdown.instance_variable_get(:@config)['kramdown']
|
46
|
-
end
|
47
|
-
|
48
|
-
should "work correctly" do
|
49
|
-
assert_equal :style, @converter_config['coderay_css']
|
50
|
-
end
|
51
|
-
|
52
|
-
should "also work for defaults" do
|
53
|
-
default = Tigefa::Configuration::DEFAULTS['kramdown']['coderay']['coderay_tab_width']
|
54
|
-
assert_equal default, @converter_config['coderay_tab_width']
|
55
|
-
end
|
56
|
-
|
57
|
-
should "not overwrite" do
|
58
|
-
assert_equal 12, @converter_config['coderay_bold_every']
|
59
|
-
end
|
60
|
-
end
|
61
34
|
end
|
62
35
|
end
|
data/test/test_new_command.rb
CHANGED
@@ -31,7 +31,7 @@ class TestNewCommand < Test::Unit::TestCase
|
|
31
31
|
|
32
32
|
should 'display a success message' do
|
33
33
|
output = capture_stdout { Tigefa::Commands::New.process(@args) }
|
34
|
-
success_message = "New
|
34
|
+
success_message = "New tigefA site installed in #{@full_path}.\n"
|
35
35
|
assert_equal success_message, output
|
36
36
|
end
|
37
37
|
|
data/test/test_page.rb
CHANGED
@@ -101,16 +101,6 @@ class TestPage < Test::Unit::TestCase
|
|
101
101
|
assert_equal @page.permalink, @page.url
|
102
102
|
assert_equal "/about/", @page.dir
|
103
103
|
end
|
104
|
-
|
105
|
-
should "not be writable outside of destination" do
|
106
|
-
unexpected = File.expand_path("../../../baddie.html", dest_dir)
|
107
|
-
File.delete unexpected if File.exist?(unexpected)
|
108
|
-
page = setup_page("exploit.md")
|
109
|
-
do_render(page)
|
110
|
-
page.write(dest_dir)
|
111
|
-
|
112
|
-
assert !File.exist?(unexpected)
|
113
|
-
end
|
114
104
|
end
|
115
105
|
|
116
106
|
context "with specified layout of nil" do
|
data/test/test_post.rb
CHANGED
@@ -75,17 +75,6 @@ class TestPost < Test::Unit::TestCase
|
|
75
75
|
assert_equal "/my_category/permalinked-post", @post.url
|
76
76
|
end
|
77
77
|
|
78
|
-
should "not be writable outside of destination" do
|
79
|
-
unexpected = File.expand_path("../../../baddie.html", dest_dir)
|
80
|
-
File.delete unexpected if File.exist?(unexpected)
|
81
|
-
post = setup_post("2014-01-06-permalink-traversal.md")
|
82
|
-
do_render(post)
|
83
|
-
post.write(dest_dir)
|
84
|
-
|
85
|
-
assert !File.exist?(unexpected)
|
86
|
-
assert File.exist?(File.expand_path("baddie.html", dest_dir))
|
87
|
-
end
|
88
|
-
|
89
78
|
context "with CRLF linebreaks" do
|
90
79
|
setup do
|
91
80
|
@real_file = "2009-05-24-yaml-linebreak.markdown"
|
@@ -295,7 +284,7 @@ class TestPost < Test::Unit::TestCase
|
|
295
284
|
end
|
296
285
|
|
297
286
|
should "return rendered HTML" do
|
298
|
-
assert_equal "<p>First paragraph with <a href
|
287
|
+
assert_equal "<p>First paragraph with <a href='http://www.jekyllrb.com/'>link ref</a>.</p>",
|
299
288
|
@post.excerpt
|
300
289
|
end
|
301
290
|
|