blogdoor 0.0.3 → 0.0.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: 699e72ebc33b9732b1aa641bcc6304b3c211355b
4
- data.tar.gz: 82e3b8bd854ab1cd2f45fd123ebba0433645fd71
3
+ metadata.gz: 9acdaf409f2eeaa0756fac9cd04b76ff29cede4d
4
+ data.tar.gz: 2e4804a75002852a98cbc2131d3ca435d2659a35
5
5
  SHA512:
6
- metadata.gz: 1aabe08d0439d97fec762ac8214e20649d184eb57302e60d871ef10c80b2b3746b774c1c7a9e05ff310c3157afa35c7aa3329c02ba9bf89fc001faeaba1da9a2
7
- data.tar.gz: 285ff713f9f99257db45bdf798c7ee11f01b6115d8f4d720f72e997b8cd9cf7af6336a6f626de67cf21561acd48c284490ff5cc5d92456e8b09fc20c61cad709
6
+ metadata.gz: 040ca60c84cf640f88fb8f639ceed599f25968b84c620b54958efa3d77979228e61a04d3ca4b784f01c979be16ad93555edd54d725f43ebc4431fac2f035ceea
7
+ data.tar.gz: 401ada9d189f99c0963996ccf71f014c93d3e73764c3c668c24c1cbffa72eea7c4e92513f35a1088196cc5a5cabdb762fa177b8f604695492cfd7363f7acc85d
@@ -10,7 +10,7 @@ module Blogdoor
10
10
 
11
11
  layout_path = Pathname.new(args[:layout_path] || "./layout.erb")
12
12
  @layout = ERB.new(layout_path.read)
13
- @renderer = Redcarpet::Markdown.new(Redcarpet::Render::HTML, fenced_code_blocks: true)
13
+ @converter = Converter.new
14
14
  @client = Client.new
15
15
  end
16
16
 
@@ -25,7 +25,7 @@ module Blogdoor
25
25
  filename = post_path.basename(".md")
26
26
  html_path = @builds_path.join("#{filename}.html")
27
27
 
28
- content = @renderer.render(post_path.read)
28
+ content = @converter.convert(post_path.read)
29
29
  context = Context.new({ title: filename, created_at: post_path.mtime, content: content })
30
30
  html = @layout.result(context.to_binding)
31
31
  html = insert_script_tags(html)
@@ -0,0 +1,14 @@
1
+ require "redcarpet"
2
+
3
+ module Blogdoor
4
+ class Converter
5
+ def initialize
6
+ renderer = Redcarpet::Render::HTML.new(prettify: true)
7
+ @markdown = Redcarpet::Markdown.new(renderer, fenced_code_blocks: true)
8
+ end
9
+
10
+ def convert(content)
11
+ @markdown.render(content)
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module Blogdoor
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/blogdoor.rb CHANGED
@@ -3,3 +3,4 @@ require "blogdoor/builder"
3
3
  require "blogdoor/watcher"
4
4
  require "blogdoor/server"
5
5
  require "blogdoor/client"
6
+ require "blogdoor/converter"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blogdoor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naoto Kaneko
@@ -141,6 +141,7 @@ files:
141
141
  - lib/blogdoor/builder.rb
142
142
  - lib/blogdoor/client.rb
143
143
  - lib/blogdoor/command.rb
144
+ - lib/blogdoor/converter.rb
144
145
  - lib/blogdoor/server.rb
145
146
  - lib/blogdoor/version.rb
146
147
  - lib/blogdoor/watcher.rb