showcase 0.2.0.beta.1 → 0.2.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/showcase/traits/seo.rb +4 -1
- data/lib/showcase/version.rb +1 -1
- data/spec/traits/seo_spec.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0253c1910b10e27e923304bcc5bd1395bdafc39c
|
4
|
+
data.tar.gz: b8b43388b449c766905202aafa1f92260e10e369
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2dae46e5e237003646b8b439d8a8757aebe87d234a6d3e202c7ad5967705b9775043dee73be6483b2ee7904f6b58936e627fd8f870ecaeb0f520f6287c5243a
|
7
|
+
data.tar.gz: 201d8408f682c934779956fb7db947aa83910afd4732aa769a7acb55caba019d166a81fd68504af2bce4913e3e663e4c9ab0510f6e298bc9a78201df6963d338
|
data/lib/showcase/traits/seo.rb
CHANGED
@@ -12,10 +12,13 @@ module Showcase
|
|
12
12
|
def seo(name = nil, options = {}, &block)
|
13
13
|
define_method? [name, :seo_tags] do |options = {}|
|
14
14
|
meta = Helpers::ConfigObject.new(self, &block).to_hash
|
15
|
+
meta.merge!(options.symbolize_keys) if options
|
16
|
+
|
15
17
|
builder = Helpers::SeoMetaBuilder.new(view_context)
|
16
18
|
parts = %w(title description canonical_url image_url canonical_url).map(&:to_sym)
|
19
|
+
|
17
20
|
parts.map do |tag|
|
18
|
-
builder.send(tag, meta[tag],
|
21
|
+
builder.send(tag, meta[tag], meta.except(*parts)) if meta[tag]
|
19
22
|
end.compact.join.html_safe
|
20
23
|
end
|
21
24
|
end
|
data/lib/showcase/version.rb
CHANGED
data/spec/traits/seo_spec.rb
CHANGED
@@ -15,12 +15,14 @@ module Showcase::Traits
|
|
15
15
|
seo do |c|
|
16
16
|
c.title = 'foo'
|
17
17
|
c.description 'bar'
|
18
|
+
c.title_suffix = ' - qux'
|
18
19
|
end
|
19
20
|
end
|
20
21
|
}
|
21
22
|
|
22
23
|
describe '#seo' do
|
23
|
-
let(:options) {
|
24
|
+
let(:options) { { title_suffix: ' - qux' } }
|
25
|
+
|
24
26
|
before do
|
25
27
|
Showcase::Helpers::SeoMetaBuilder.stub(:new).with(view).and_return(builder)
|
26
28
|
builder.stub(:title).with('foo', options).and_return('<title>')
|