metamagic 2.0.1 → 2.0.2

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.
Files changed (2) hide show
  1. data/lib/metamagic/helper_methods.rb +5 -8
  2. metadata +5 -5
@@ -20,7 +20,11 @@ module Metamagic
20
20
  options.each do |option|
21
21
  if option.is_a?(Hash)
22
22
  option.each_pair do |key, value|
23
- add_tag_if_not_existing :name => key, :content => value
23
+ if value.is_a?(Array)
24
+ add_tag_if_not_existing :name => key, :content => CGI::escapeHTML(value.join(", "))
25
+ else
26
+ add_tag_if_not_existing :name => key, :content => CGI::escapeHTML(value)
27
+ end
24
28
  end
25
29
  elsif option.is_a?(Array)
26
30
  option.each do |tag|
@@ -42,13 +46,6 @@ module Metamagic
42
46
  if tag[:name] == :title
43
47
  out << content_tag(:title, tag[:content])
44
48
  else
45
- # replace array with comma separated list
46
- tag.each_pair do |key, value|
47
- if value.is_a?(Array)
48
- tag[key] = value.join(", ")
49
- end
50
- end
51
-
52
49
  # add tag
53
50
  out << tag(:meta, tag)
54
51
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metamagic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 1
10
- version: 2.0.1
9
+ - 2
10
+ version: 2.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lasse Bunk
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-28 00:00:00 Z
18
+ date: 2012-07-03 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Metamagic is a simple Ruby on Rails plugin for creating meta tags.
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  requirements: []
59
59
 
60
60
  rubyforge_project:
61
- rubygems_version: 1.8.21
61
+ rubygems_version: 1.8.24
62
62
  signing_key:
63
63
  specification_version: 3
64
64
  summary: Simple Ruby on Rails plugin for creating meta tags.