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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b74ab2a5da9e9fc4c3de6f8efa76ae62945b23c6
4
- data.tar.gz: d54f9d38fdd079a4893b9344f51131196199e548
3
+ metadata.gz: bd99093a10d095f017dc6409f2ec3b8656cddebb
4
+ data.tar.gz: 82968d21422179ea4f9fb701ba588fed5bb00850
5
5
  SHA512:
6
- metadata.gz: 735a47c86962534585047eca168bb76d257d5f79d4b201d4f6782e1cbc15ecdb16dedda38aad8e949697743010c0db3d25f4da7bfcca3339acddd1be0ad441eb
7
- data.tar.gz: c5a114d0fab5fb1b467c26d4916097a071c9427d946fb15689525f25bd0fe94afa69dfe854a4aa1da7befc0ff4250785f9481d4a88c7f4e310a2b1e44d1a2792
6
+ metadata.gz: 5d6d3d945c70e11bf080a1293072349c7f4c61c02caac427825fe04218fb1e8bd8d794cf201c28d05f883926323e7c6ec5d982ba57b2e49bd91d46f477b76e3d
7
+ data.tar.gz: 4f23a2f9048f436966f385dcd619a99961809df9a5ca50bb8a9848ebc8a1bafaff46c58608b579148b5d3b12085c64eca6d4073e218904cb35d27d37fe0d34c8
data/ext/github_markup.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'redcarpet'
2
+
1
3
  # Monkey patch github markup to use redcarpet with support for autolinks and tables
2
4
  module GitHub::Markup
3
5
  alias_method :old_render, :render
@@ -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
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Gimli
4
- VERSION = "0.5.3"
4
+ VERSION = "0.5.4"
5
5
  end
6
6
 
@@ -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, '--quiet', '-', "\"#{filename}\""].compact
30
+ [bin, @parameters, '-q', '-', "\"#{filename}\""].compact
31
31
  end
32
32
 
33
33
  # Find the wkhtmltopdf binary
@@ -0,0 +1,3 @@
1
+ ```
2
+ まつもとゆきひろ
3
+ ```
@@ -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 '--quiet'
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\" --quiet - \"\"", "wb+") { true }
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.3
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