tag_helper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -13,6 +13,9 @@ TagHelper is a zero dependency, lightweight Ruby lib for building XHTML tags sim
13
13
  >> require 'tag_helper'
14
14
  => true
15
15
 
16
+ >> TagHelper.image_tag('1.png', :alt => 'number one!')
17
+ => "<img alt="number one!" src="1.png" />"
18
+
16
19
  >> include TagHelper
17
20
  => Object
18
21
 
data/lib/tag_helper.rb CHANGED
@@ -37,4 +37,5 @@ module TagHelper
37
37
  REXML::Text::normalize(s)
38
38
  end
39
39
 
40
+ extend self
40
41
  end
@@ -1,26 +1,25 @@
1
1
  require "#{File.dirname(__FILE__)}/../test_helper"
2
2
 
3
3
  class ConfigTest < Test::Unit::TestCase
4
- include TagHelper
5
4
 
6
5
  def test_image_tag
7
- assert_equal '<img src="1.png" />', image_tag('1.png')
6
+ assert_equal '<img src="1.png" />', TagHelper.image_tag('1.png')
8
7
  end
9
8
 
10
9
  def test_image_tag2
11
- assert_equal '<img alt="number one!" src="1.png" />', image_tag('1.png', :alt => 'number one!')
10
+ assert_equal '<img alt="number one!" src="1.png" />', TagHelper.image_tag('1.png', :alt => 'number one!')
12
11
  end
13
-
12
+
14
13
  def test_label_tag2
15
- assert_equal '<label for="name">name</label>', label_tag('name')
14
+ assert_equal '<label for="name">name</label>', TagHelper.label_tag('name')
16
15
  end
17
-
16
+
18
17
  def test_hidden_field_tag
19
- assert_equal '<input id="token" value="abc" type="hidden" name="token" />', hidden_field_tag('token', 'abc')
18
+ assert_equal '<input id="token" value="abc" type="hidden" name="token" />', TagHelper.hidden_field_tag('token', 'abc')
20
19
  end
21
-
20
+
22
21
  def test_hidden_field_tag2
23
- assert_equal '<input id="u" value="dejan" type="text" name="u" />', text_field_tag('u', 'dejan')
22
+ assert_equal '<input id="u" value="dejan" type="text" name="u" />', TagHelper.text_field_tag('u', 'dejan')
24
23
  end
25
24
 
26
25
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tag_helper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dejan Simic
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-01 00:00:00 +01:00
18
+ date: 2011-07-04 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21