material 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/material/concerns/text.rb +8 -1
- data/lib/material/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efcfabbcb8f6616b00911cd7da974ddd02eb89f717a0eb5a4f5572993173e53e
|
4
|
+
data.tar.gz: f09dd51e177bb86b3904617275f164286c4e54d0df866f745171206eb9169802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a8c4aa9c9ee2771f51147b995f06a28ac8cc6f10db4aaa0838d3c293f2a544e8ca5b6d9725050c8f03ec073d1749fb6d8a4ea424924b170c295f211e2ca4f9b
|
7
|
+
data.tar.gz: ec9856c4e6aa60d81ecd706e02b625b57038018deae73451b6435c705f69ea819bc32c114680848423bb8c9e461c06d33ceee8da9017a2eed302d58c3c08642d
|
@@ -13,6 +13,10 @@ module Material
|
|
13
13
|
register_truncator(key) { title }
|
14
14
|
end
|
15
15
|
|
16
|
+
def register_index_title_truncator(key)
|
17
|
+
register_truncator(key) { title.pluralize }
|
18
|
+
end
|
19
|
+
|
16
20
|
def register_truncator(key, max_length = DEFAULT_TRUNCATE_LENGTH, &block)
|
17
21
|
register_component(key, max_length: max_length, &block)
|
18
22
|
define_truncation_formatter(key)
|
@@ -36,7 +40,7 @@ module Material
|
|
36
40
|
end
|
37
41
|
|
38
42
|
included do
|
39
|
-
register_truncator(:title) { default_title }
|
43
|
+
register_truncator(:title) { default_title.titleize }
|
40
44
|
|
41
45
|
register_component(:parameterized_title) { title_value.underscore.parameterize }
|
42
46
|
|
@@ -45,6 +49,9 @@ module Material
|
|
45
49
|
register_title_truncator :reference_title
|
46
50
|
register_title_truncator :breadcrumb_title
|
47
51
|
|
52
|
+
register_index_title_truncator :index_title
|
53
|
+
register_index_title_truncator :breadcrumb_index_title
|
54
|
+
|
48
55
|
private
|
49
56
|
|
50
57
|
def default_title
|
data/lib/material/version.rb
CHANGED