merb_viewfu 0.5 → 0.5.1
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.
- data/Rakefile +1 -1
- data/lib/view_fu/tag_helper.rb +14 -10
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/view_fu/tag_helper.rb
CHANGED
|
@@ -129,19 +129,23 @@ module ViewFu
|
|
|
129
129
|
def add_class(css_class, options = {})
|
|
130
130
|
return {} unless css_class
|
|
131
131
|
|
|
132
|
-
if options.has_key?(:unless)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
if options.has_key?(:unless)
|
|
133
|
+
if options[:unless]
|
|
134
|
+
return {}
|
|
135
|
+
else
|
|
136
|
+
return {:class => css_class}
|
|
137
|
+
end
|
|
138
138
|
end
|
|
139
139
|
|
|
140
|
-
if
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
if options.has_key?(:if)
|
|
141
|
+
if options[:if]
|
|
142
|
+
return {:class => css_class}
|
|
143
|
+
else
|
|
144
|
+
return {}
|
|
145
|
+
end
|
|
144
146
|
end
|
|
147
|
+
|
|
148
|
+
{:class => css_class}
|
|
145
149
|
end
|
|
146
150
|
|
|
147
151
|
def add_class_if(css_class, condition)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: merb_viewfu
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jacques Crocker
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2010-01-
|
|
12
|
+
date: 2010-01-11 00:00:00 -08:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|