label_builder 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{label_builder}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["klacointe", "chikamichi"]
12
- s.date = %q{2010-10-14}
12
+ s.date = %q{2010-10-18}
13
13
  s.description = %q{Add :prefix and :suffix options to label_tag helper}
14
14
  s.email = %q{kevinlacointe@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -11,7 +11,7 @@ module ActionView
11
11
  suffix = options.delete("suffix") if options.keys.include?("suffix")
12
12
  suffix = options.delete(:suffix) if options.keys.include?(:suffix)
13
13
  end
14
- suffix ||= LabelBuilder.prefix
14
+ suffix ||= LabelBuilder.suffix
15
15
 
16
16
  # text to prefix
17
17
  if content_or_options && content_or_options.is_a?(Hash)
@@ -21,7 +21,7 @@ module ActionView
21
21
  prefix = options.delete("prefix") if options.keys.include?("prefix")
22
22
  prefix = options.delete(:prefix) if options.keys.include?(:prefix)
23
23
  end
24
- prefix ||= LabelBuilder.suffix
24
+ prefix ||= LabelBuilder.prefix
25
25
 
26
26
  html = label_tag_without_modifiers(
27
27
  name,
@@ -21,4 +21,12 @@ describe "LabelBuilder" do
21
21
  :prefix => "PREFIX"
22
22
  ).should == '<label for="method_name">PREFIXmy_contentSUFFIX</label>'
23
23
  end
24
+ it "should use configuration" do
25
+ LabelBuilder.prefix = "PREFIX"
26
+ LabelBuilder.suffix = "SUFFIX"
27
+ label_tag(
28
+ "method_name",
29
+ "my_content"
30
+ ).should == '<label for="method_name">PREFIXmy_contentSUFFIX</label>'
31
+ end
24
32
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: label_builder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - klacointe
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-14 00:00:00 +02:00
19
+ date: 2010-10-18 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency