hamdown 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/hamdown +6 -0
- data/lib/hamdown.rb +12 -3
- metadata +5 -5
data/bin/hamdown
CHANGED
data/lib/hamdown.rb
CHANGED
@@ -2,6 +2,15 @@ require 'rubygems'
|
|
2
2
|
require 'rdiscount'
|
3
3
|
require 'haml'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
class Hamdown
|
6
|
+
def initialize(options={})
|
7
|
+
file = options.delete(:file_path) { raise "you need to specify a file name" }
|
8
|
+
@innerfile = RDiscount.new(File.open(file).read)
|
9
|
+
@outerfile = File.open('layout.haml')
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_html
|
13
|
+
puts Haml::Engine.new(@outerfile.read).render { @innerfile.to_html }
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Robert Fletcher
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-05-15 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -31,7 +31,7 @@ files:
|
|
31
31
|
- lib/hamdown.rb
|
32
32
|
- bin/hamdown
|
33
33
|
has_rdoc: true
|
34
|
-
homepage:
|
34
|
+
homepage: https://github.com/mockdeep/hamdown
|
35
35
|
licenses: []
|
36
36
|
|
37
37
|
post_install_message:
|