merb_viewfu 0.5 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/view_fu/tag_helper.rb +14 -10
  3. metadata +2 -2
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'merb-core'
5
5
  require 'merb-core/tasks/merb'
6
6
 
7
7
  GEM_NAME = "merb_viewfu"
8
- GEM_VERSION = "0.5"
8
+ GEM_VERSION = "0.5.1"
9
9
  AUTHOR = "Jacques Crocker"
10
10
  EMAIL = "merbjedi@gmail.com"
11
11
  HOMEPAGE = "http://merbjedi.com/"
@@ -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) && options[:unless]
133
- return {}
134
- end
135
-
136
- if options.has_key?(:if) && options[:if]
137
- return {:class => css_class}
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 !options.has_key?(:if) and !options.has_key?(:unless)
141
- {:class => css_class}
142
- else
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: "0.5"
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-09 00:00:00 -08:00
12
+ date: 2010-01-11 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency