rhtml 0.0.6 → 0.0.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.
Files changed (3) hide show
  1. data/lib/rhtml/html.rb +5 -0
  2. data/lib/rhtml/version.rb +1 -1
  3. metadata +2 -2
@@ -3,12 +3,17 @@ module Rhtml
3
3
  def initialize(content='', indent=0, &b)
4
4
  @indent = 0
5
5
  @content = content
6
+ @cls = nil
7
+ @id = nil
6
8
  @content << instance_eval(&b) if block_given?
7
9
  end
8
10
 
9
11
  def tag!(tag_name, ps={}, str=nil, &b)
10
12
  str, ps = ps, {} if ps.is_a? String
13
+ ps[:class] = @cls if @cls
14
+ ps[:id] = @id if @id
11
15
  @content << Rhtml.tag_open(tag_name, ps, @indent)
16
+ @cls = @id = nil
12
17
  @indent += 1
13
18
  if str
14
19
  @content << INDENT * @indent << str << "\n"
@@ -1,3 +1,3 @@
1
1
  module Rhtml
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhtml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
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-29 00:00:00.000000000 Z
12
+ date: 2013-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler