rp 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -2
- data/lib/rp.rb +6 -3
- data/lib/rp/version.rb +1 -1
- metadata +1 -1
data/Gemfile
CHANGED
data/lib/rp.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require "rp/version"
|
2
|
-
require "
|
2
|
+
require "rhtml"
|
3
3
|
|
4
4
|
module Rp
|
5
|
+
include Rhtml
|
5
6
|
extend self
|
6
7
|
|
7
8
|
INDENT_SIZE = 2
|
@@ -12,7 +13,7 @@ module Rp
|
|
12
13
|
end
|
13
14
|
|
14
15
|
def ends s, n=0
|
15
|
-
n.times {|i| @doc << "\n" << INDENT*(s-i) << "end"} if s
|
16
|
+
n.times {|i| @doc << "\n" << INDENT*(s-i) << "end"} if s >= 0
|
16
17
|
end
|
17
18
|
|
18
19
|
def parse(lines)
|
@@ -37,7 +38,9 @@ module Rp
|
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
40
|
-
ends(@indent
|
41
|
+
ends(@indent-1, @indent)
|
41
42
|
eval(@doc)
|
43
|
+
|
42
44
|
end
|
43
45
|
end
|
46
|
+
print Rp.parse(open(File.expand_path("../tmp/test.r")).readlines)
|
data/lib/rp/version.rb
CHANGED