rp 0.1.5 → 0.1.6

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.
Files changed (3) hide show
  1. data/lib/rp.rb +5 -6
  2. data/lib/rp/version.rb +1 -1
  3. metadata +2 -2
data/lib/rp.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  require "rp/version"
2
- require "rhtml"
3
2
 
4
3
  module Rp
5
- include Rhtml
6
4
  extend self
7
5
 
8
6
  INDENT_SIZE = 2
@@ -61,13 +59,13 @@ module Rp
61
59
  end
62
60
 
63
61
  t = ""
64
- t << "#{INDENT*i}@cls = '#{cls}'\n" if cls.size != 0
65
- t << "#{INDENT*i}@id = '#{id}'\n" if id.size != 0
62
+ t << "#{INDENT*i}@__cls = '#{cls}'\n" if cls.size != 0
63
+ t << "#{INDENT*i}@__id = '#{id}'\n" if id.size != 0
66
64
  t << INDENT*i << l
67
65
  end
68
66
 
69
67
  def parse(lines)
70
- @doc = ""
68
+ @doc = "require 'rhtml'\ninclude Rhtml\nHtml.new do\n"
71
69
  @indent = 0
72
70
 
73
71
  lines.each do |l|
@@ -87,7 +85,7 @@ module Rp
87
85
  end
88
86
 
89
87
  ends(@indent-1, @indent)
90
- @doc
88
+ @doc << "\nend"
91
89
  end
92
90
 
93
91
  def to_html lines
@@ -98,5 +96,6 @@ module Rp
98
96
  parse(lines)
99
97
  end
100
98
  end
99
+
101
100
  # puts Rp.to_rhtml(File.open(File.expand_path("../tmp/test1.r")).readlines)
102
101
  # puts Rp.to_html(File.open(File.expand_path("../tmp/test1.r")).readlines)
@@ -1,3 +1,3 @@
1
1
  module Rp
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
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-07-31 00:00:00.000000000 Z
12
+ date: 2013-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler