md_inc 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/md_inc/md_inc_commands.rb +5 -5
- data/lib/md_inc/version.rb +1 -1
- metadata +2 -2
@@ -18,16 +18,16 @@ module MdInc
|
|
18
18
|
lines.map &:rstrip!
|
19
19
|
end
|
20
20
|
|
21
|
-
def code_inc(path, re1=nil, re2=nil)
|
21
|
+
def code_inc(path, language='', re1=nil, re2=nil)
|
22
22
|
if re1
|
23
|
-
code(between(re1, re2, inc(path)))
|
23
|
+
code(language, between(re1, re2, inc(path)))
|
24
24
|
else
|
25
|
-
code(inc(path))
|
25
|
+
code(language, inc(path))
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def code(lines)
|
30
|
-
lines
|
29
|
+
def code(language, lines)
|
30
|
+
["```#{language}"] + lines + ["```"]
|
31
31
|
end
|
32
32
|
|
33
33
|
def between(re1, re2, lines)
|
data/lib/md_inc/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: md_inc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-12 00:00:00.
|
12
|
+
date: 2013-02-12 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: MdInc is a simple text inclusion utility (it sucks in files) intended
|
15
15
|
for use with markdown and similar utilities.
|