gimli 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/github_markup.rb +2 -0
- data/lib/gimli/markup/renderer.rb +1 -0
- data/lib/gimli/version.rb +1 -1
- data/lib/gimli/wkhtmltopdf.rb +1 -1
- data/spec/fixtures/code_block_with_utf8.md +3 -0
- data/spec/gimli/markup/renderer_spec.rb +13 -0
- data/spec/gimli/wkhtmltopdf_spec.rb +2 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd99093a10d095f017dc6409f2ec3b8656cddebb
|
4
|
+
data.tar.gz: 82968d21422179ea4f9fb701ba588fed5bb00850
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d6d3d945c70e11bf080a1293072349c7f4c61c02caac427825fe04218fb1e8bd8d794cf201c28d05f883926323e7c6ec5d982ba57b2e49bd91d46f477b76e3d
|
7
|
+
data.tar.gz: 4f23a2f9048f436966f385dcd619a99961809df9a5ca50bb8a9848ebc8a1bafaff46c58608b579148b5d3b12085c64eca6d4073e218904cb35d27d37fe0d34c8
|
data/ext/github_markup.rb
CHANGED
@@ -37,6 +37,7 @@ module Gimli
|
|
37
37
|
# Prepare data for rendering
|
38
38
|
def prepare_data
|
39
39
|
@data = @yaml_frontmatter_remover.process(@data) if @do_remove_yaml_front_matter
|
40
|
+
@data = @data.force_encoding('utf-8') if @data.respond_to? :force_encoding
|
40
41
|
@data = @code.extract(@data)
|
41
42
|
end
|
42
43
|
|
data/lib/gimli/version.rb
CHANGED
data/lib/gimli/wkhtmltopdf.rb
CHANGED
@@ -27,7 +27,7 @@ module Gimli
|
|
27
27
|
# @param [String] filename the outputed pdf's filename
|
28
28
|
# @return [Array] a list of strings that make out the call to wkhtmltopdf
|
29
29
|
def command(filename)
|
30
|
-
[bin, @parameters, '
|
30
|
+
[bin, @parameters, '-q', '-', "\"#{filename}\""].compact
|
31
31
|
end
|
32
32
|
|
33
33
|
# Find the wkhtmltopdf binary
|
@@ -14,5 +14,18 @@ describe Gimli::Markup::Renderer do
|
|
14
14
|
|
15
15
|
markup.render.should == output
|
16
16
|
end
|
17
|
+
|
18
|
+
it "should render html with code blocks including utf-8 strings" do
|
19
|
+
output = <<-HTML
|
20
|
+
<div class="CodeRay">
|
21
|
+
<div class="code"><pre>まつもとゆきひろ</pre></div>
|
22
|
+
</div>
|
23
|
+
HTML
|
24
|
+
|
25
|
+
file = Gimli::MarkupFile.new File.expand_path('../../../fixtures/code_block_with_utf8.md', __FILE__)
|
26
|
+
markup = Gimli::Markup::Renderer.new file, true
|
27
|
+
|
28
|
+
markup.render.strip.should == output.strip
|
29
|
+
end
|
17
30
|
end
|
18
31
|
|
@@ -15,7 +15,7 @@ describe Gimli::Wkhtmltopdf do
|
|
15
15
|
args = @wkhtmltopdf.command('test.pdf')
|
16
16
|
args.size.should eq 4
|
17
17
|
args.should include '"wkhtmltopdf"'
|
18
|
-
args.should include '
|
18
|
+
args.should include '-q'
|
19
19
|
args.should include '-'
|
20
20
|
args.should include '"test.pdf"'
|
21
21
|
end
|
@@ -28,7 +28,7 @@ describe Gimli::Wkhtmltopdf do
|
|
28
28
|
|
29
29
|
it 'should generate a pdf' do
|
30
30
|
mock(@wkhtmltopdf).__double_definition_create__.call(:`, "which wkhtmltopdf") { '~/wkhtmltopdf' }
|
31
|
-
mock(IO).popen("\"~/wkhtmltopdf\"
|
31
|
+
mock(IO).popen("\"~/wkhtmltopdf\" -q - \"\"", "wb+") { true }
|
32
32
|
@wkhtmltopdf.output_pdf('', '')
|
33
33
|
end
|
34
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gimli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fredrik Wallgren
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- lib/gimli.rb
|
192
192
|
- spec/fixtures/autolink_url.md
|
193
193
|
- spec/fixtures/code_block.textile
|
194
|
+
- spec/fixtures/code_block_with_utf8.md
|
194
195
|
- spec/fixtures/code_block_with_utf8.textile
|
195
196
|
- spec/fixtures/code_with_utf8.textile
|
196
197
|
- spec/fixtures/integration/markdown.md
|