so_meta 0.3 → 0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e9525d7ffaeccd0d78e9ec17f5832daa58f6f02
4
- data.tar.gz: bcca4740ce7ff8523dd83cd1f8e8dd03bb787f09
3
+ metadata.gz: ceb9c4aed13f9bf186fa9733bbdef52e70b796fd
4
+ data.tar.gz: 84fc06bca24ec06806f370e9887e1634a5a1b688
5
5
  SHA512:
6
- metadata.gz: fcf95574deea2c5b829b506bbd3fdb4e086d6662062d6f1422bc55394cfbe857db11da388ec29e0476d5a8bfd28d0788c97bf01a2db31689f1fb8bbeaa61df9f
7
- data.tar.gz: 2d82ad35a81c76722b8b2b0e794d6761be78237bbdbe3a7a8582235daeb4120eb7ffe0b33ec292b32474b5efaa1446ef033a9ffc399408ce8df7f1dcc7dda375
6
+ metadata.gz: a1fcf30d47fd4a9f544e0777dfa1dfc79a4b69b79c7971b74cc79ef2508abee230245d36c30e27b06232b566ce4b808dd1b3eb24bb1fee06a57414856d7e7ba6
7
+ data.tar.gz: 01644a5280496b5db20ad30950cce2035557cd9ebfce6e4549f738f9685bbd3e3f07e548f280494a333dd1dbf2ac5522edf8a7c8e17f2f0e6eceec764aaaba92
data/README.md CHANGED
@@ -35,11 +35,14 @@ en:
35
35
  title: "About | My Awesome New Rails Application"
36
36
  description: "Our company will blow your mind...like really."
37
37
 
38
- pages-subresource: # Controller name - Pages::SubresourceController
38
+ pages_subresource: # Controller name - Pages::SubresourceController
39
39
  about: # Action name - about
40
40
  title: "About | My Awesome New Rails Application"
41
41
  description: "Our company will blow your mind...like really."
42
42
 
43
+ iphone:
44
+ title: "iPhone About | My Awesome New Rails Application"
45
+
43
46
  contact:
44
47
  title: "Contact %{name} | My Awesome New Rails Application" # Interpolation content from the view
45
48
  # By not specifying a description for this page, it'll inherit the defaults
@@ -51,7 +54,7 @@ en:
51
54
  <!DOCTYPE html>
52
55
  <html lang="en">
53
56
  <head>
54
- <title><%= so_meta(:title) %></title>
57
+ <title><%= so_meta(:title, :iphone) %></title>
55
58
  <meta name="description" content="<%= so_meta(:description) %>" />
56
59
  <%= csrf_meta_tags %>
57
60
  </head>
@@ -1,8 +1,15 @@
1
1
  module SoMeta
2
2
  module Helper
3
- def so_meta(name)
3
+ def so_meta(name, scope = nil)
4
4
  interpolation_data = instance_variable_get("@so_meta_#{name}_interpolation") || {}
5
- t("so_meta.#{controller_path.gsub(/\//, "_")}.#{action_name}.#{name}", interpolation_data.merge(default: t("so_meta.defaults.#{name}")))
5
+
6
+ controller_name = controller_path.gsub(/\//, "_")
7
+
8
+ if scope.present?
9
+ t("so_meta.#{controller_name}.#{action_name}.#{scope}.#{name}",
10
+ default: t("so_meta.#{controller_name}.#{action_name}.#{name}", interpolation_data.merge(default: t("so_meta.defaults.#{name}")))
11
+ )
12
+ end
6
13
  end
7
14
 
8
15
  def so_meta_interpolation(name, hash)
@@ -1,3 +1,3 @@
1
1
  module SoMeta
2
- VERSION = "0.3"
2
+ VERSION = "0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: so_meta
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Hilkert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-01 00:00:00.000000000 Z
11
+ date: 2016-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler