world-flags 0.2.0 → 0.2.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/README.textile CHANGED
@@ -108,6 +108,10 @@ The flag_title will render the following list item:
108
108
 
109
109
  Note: The `  is needed in order for the background (flag icon) to have something to be displayed against.
110
110
 
111
+ The :title and :content can also be set to a string which is then displayed
112
+
113
+ = flag :ar, :title => 'Argentina is the best', :content => 'Argh!'
114
+
111
115
  To also get content rendered for the <li>
112
116
 
113
117
  = flags [:ar, :br, :gb], :content => true
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -42,8 +42,25 @@ module WorldFlags
42
42
  end
43
43
 
44
44
  def flag code, name, options = {}
45
- label = options[:content] ? name : '&nbsp;'
46
- extra_options = options[:title] ? {:title => name } : {}
45
+ label = case options[:content]
46
+ when true
47
+ name
48
+ when String
49
+ options[:content]
50
+ else
51
+ '&nbsp;'
52
+ end
53
+
54
+ title = case options[:title]
55
+ when true
56
+ name
57
+ when String
58
+ options[:title]
59
+ else
60
+ nil
61
+ end
62
+
63
+ extra_options = title ? {:title => title } : {}
47
64
  selected = flag_selected?(code, options) ? 'selected' : ''
48
65
  content_tag :li, label.html_safe, {:class => "flag #{code} #{selected}", :'data-country' => name, :'data-cc' => code}.merge(options[:html] || {}).merge(extra_options)
49
66
  end
data/world-flags.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "world-flags"
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: world-flags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -169,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  segments:
171
171
  - 0
172
- hash: 1285407840837945831
172
+ hash: 2339332565695935024
173
173
  required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  none: false
175
175
  requirements: