hlt 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/hlt.rb +5 -1
- metadata +2 -2
data/lib/hlt.rb
CHANGED
@@ -8,7 +8,11 @@ class Hlt
|
|
8
8
|
|
9
9
|
attr_reader :to_html
|
10
10
|
|
11
|
-
def initialize(
|
11
|
+
def initialize(raw_s)
|
12
|
+
# strip out lines which are blank or only contain a comment
|
13
|
+
s = raw_s.lines.to_a.reject!{|x| x[/(^\s+#)|(^\s*$)/] }.join
|
14
|
+
# strip out the text from the line containing a comment
|
15
|
+
s.gsub!(/((^#\s|\s#\s).*)/,'').strip if s[/((^#\s|\s#\s).*)/]
|
12
16
|
a = s.scan(/^\[([^\]]+)\]\n/).map(&:first)
|
13
17
|
s2 = s.gsub(/\n\[[^\]]+\]\n/, " !CODE\n")
|
14
18
|
raw_html = LineTree.new(s2).to_xml
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: hlt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Robertson
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
13
|
+
date: 2012-03-10 00:00:00 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|