acts_as_metable 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acts_as_metable.rb +7 -1
- data/lib/acts_as_metable/renderers.rb +13 -0
- data/lib/acts_as_metable/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b240776eed055ffaadb89765ea82cb059c9fc2bd
|
4
|
+
data.tar.gz: d81a90b60e58f4ff82904f84e2fa990207e9cdf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0076fe0e38b3d5a995702741c8c10277b2f11ba1cf2fdd80c11dc9d529fcfdfe7876d5c24db877bffaea00b6299b6723328bf22332f52f6adb3ba7152a612a8a
|
7
|
+
data.tar.gz: 601abc9c83f23a45576acbf8381b8a159aad1184737e1aa64ed5a598d64e3ac856bc7ea2e79c82db4526f65114be5cd668165950f09868a8b23aee474bba5689
|
data/lib/acts_as_metable.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'acts_as_metable/metable'
|
2
|
+
require 'acts_as_metable/renderers'
|
2
3
|
require 'acts_as_metable/engine'
|
3
4
|
|
4
5
|
module ActsAsMetable
|
@@ -31,7 +32,12 @@ module ActsAsMetable
|
|
31
32
|
|
32
33
|
def render
|
33
34
|
result = @tags.map do |tag|
|
34
|
-
|
35
|
+
case tag[:name]
|
36
|
+
when 'title'
|
37
|
+
ActsAsMetable::Renderers.title_tag(tag)
|
38
|
+
else
|
39
|
+
ActsAsMetable::Renderers.default_tag(tag)
|
40
|
+
end
|
35
41
|
end.join("\n").html_safe
|
36
42
|
|
37
43
|
@tags = []
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module ActsAsMetable
|
2
|
+
class Renderers
|
3
|
+
class << self
|
4
|
+
def default_tag tag
|
5
|
+
ActionController::Base.helpers.tag(:meta, name: tag[:name], content: tag[:content])
|
6
|
+
end
|
7
|
+
|
8
|
+
def title_tag tag
|
9
|
+
ActionController::Base.helpers.content_tag(:title, tag[:content])
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_metable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Novikov
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- lib/acts_as_metable.rb
|
55
55
|
- lib/acts_as_metable/engine.rb
|
56
56
|
- lib/acts_as_metable/metable.rb
|
57
|
+
- lib/acts_as_metable/renderers.rb
|
57
58
|
- lib/acts_as_metable/version.rb
|
58
59
|
- lib/generators/acts_as_metable/install_generator.rb
|
59
60
|
homepage: https://github.com/droptheplot/acts_as_metable
|