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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b58eb1ab9de9b436f4f97e1173a1f0fb1173e71c
4
- data.tar.gz: a08c06018f3a4d174edc95272747c58bc88a7b5d
3
+ metadata.gz: b240776eed055ffaadb89765ea82cb059c9fc2bd
4
+ data.tar.gz: d81a90b60e58f4ff82904f84e2fa990207e9cdf4
5
5
  SHA512:
6
- metadata.gz: 4dcff94720d5ee4cf33c456dab78c20d25275630c1b00468ccfd66660ce841321f1bf1d45179e02c62ad7b6c9c5270c3f0af51dea615fed98f01c606c6023585
7
- data.tar.gz: a9d13fca1d2601b88896cbda78d353436fc7f28806bc505127befba440337b84a70faa100a797895d6696e0da74dce6ce46f4508247828c416c331994f2a46f4
6
+ metadata.gz: 0076fe0e38b3d5a995702741c8c10277b2f11ba1cf2fdd80c11dc9d529fcfdfe7876d5c24db877bffaea00b6299b6723328bf22332f52f6adb3ba7152a612a8a
7
+ data.tar.gz: 601abc9c83f23a45576acbf8381b8a159aad1184737e1aa64ed5a598d64e3ac856bc7ea2e79c82db4526f65114be5cd668165950f09868a8b23aee474bba5689
@@ -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
- ActionController::Base.helpers.tag(:meta, name: tag[:name], content: tag[:content])
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
@@ -1,3 +1,3 @@
1
1
  module ActsAsMetable
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  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.2.1
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