showcase 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/showcase/helpers/first_nonblank.rb +7 -3
- data/lib/showcase/helpers/html_options.rb +20 -16
- data/lib/showcase/helpers/seo_meta_builder.rb +2 -2
- data/lib/showcase/traits/link_to.rb +1 -1
- data/lib/showcase/traits/record.rb +1 -1
- data/lib/showcase/traits/share.rb +1 -1
- data/lib/showcase/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cccbdfb7ba5759b986763285e2422936225cf046
|
4
|
+
data.tar.gz: 9bffcb849bd62807722a63c331ad930b1c0a2cb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc96a5341cb344161b6108f53f147372f1d2ca8728fb064b1e2cd114f9f52572b9b01564a07d61c053c0570070d81f9966f17896be2b1b6f2cd2d93635246881
|
7
|
+
data.tar.gz: fbc674738a76c3f4bfc4355813279eee086b24b4b8a61fb646e2fbd47bb75cf37246026964c8e572b6a2c10b113d09e82f05f5a91edaa54a19960dfa0b7a0561
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,22 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module Showcase
|
2
|
+
module Helpers
|
3
|
+
class HtmlOptions
|
4
|
+
def initialize(options = {})
|
5
|
+
@options = (options || {}).symbolize_keys
|
6
|
+
end
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
def add_class!(css_class)
|
9
|
+
@options[:class] ||= ""
|
10
|
+
css_classes = @options[:class].split(/\s+/)
|
11
|
+
css_classes << css_class
|
12
|
+
@options[:class] = css_classes.join(" ")
|
13
|
+
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
def merge_attrs!(options = {})
|
16
|
+
options = (options || {}).symbolize_keys
|
17
|
+
@options.merge!(options)
|
18
|
+
end
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
+
def to_h
|
21
|
+
@options.dup
|
22
|
+
end
|
23
|
+
end
|
20
24
|
end
|
21
25
|
end
|
22
26
|
|
@@ -10,7 +10,7 @@ module Showcase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def title(values, options = {})
|
13
|
-
title = FirstNonBlank.find(values)
|
13
|
+
title = Helpers::FirstNonBlank.find(values)
|
14
14
|
title += options[:title_suffix] if options[:title_suffix]
|
15
15
|
|
16
16
|
context.content_tag(:title, title) <<
|
@@ -60,7 +60,7 @@ module Showcase
|
|
60
60
|
private
|
61
61
|
|
62
62
|
def seo_meta_tags(*args)
|
63
|
-
value = FirstNonBlank.find(args.pop)
|
63
|
+
value = Helpers::FirstNonBlank.find(args.pop)
|
64
64
|
|
65
65
|
return nil unless value.present?
|
66
66
|
|
@@ -27,7 +27,7 @@ module Showcase
|
|
27
27
|
options.delete(:active_class)
|
28
28
|
end
|
29
29
|
|
30
|
-
html_options = HtmlOptions.new(config.html_options)
|
30
|
+
html_options = Helpers::HtmlOptions.new(config.html_options)
|
31
31
|
html_options.merge_attrs!(options)
|
32
32
|
html_options.add_class!(active_class || config.active_class || 'active') if config.active
|
33
33
|
|
@@ -47,7 +47,7 @@ module Showcase
|
|
47
47
|
params = Hash[
|
48
48
|
settings[:params].map do |param, meta_key|
|
49
49
|
values = [:"#{social}_#{meta_key}", meta_key].map do |key|
|
50
|
-
FirstNonBlank.find(meta.send(key))
|
50
|
+
Helpers::FirstNonBlank.find(meta.send(key))
|
51
51
|
end
|
52
52
|
[ param, values.find(&:presence) ]
|
53
53
|
end
|
data/lib/showcase/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: showcase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- .rspec
|
92
92
|
- .travis.yml
|
93
93
|
- Appraisals
|
94
|
+
- CHANGELOG.md
|
94
95
|
- Gemfile
|
95
96
|
- LICENSE.txt
|
96
97
|
- README.md
|
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
149
|
version: '0'
|
149
150
|
requirements: []
|
150
151
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
152
|
+
rubygems_version: 2.2.2
|
152
153
|
signing_key:
|
153
154
|
specification_version: 4
|
154
155
|
summary: A barebone and framework agnostic presenter implementation
|