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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8279b10fccaede2aaf3ef990399617bdfabd46b213b9b9774cf6de1502338836
4
- data.tar.gz: ee43a57b87a21111e0b47ef3ca06d2861dca397e42c3ed08d37be25da26a5fe4
3
+ metadata.gz: efcfabbcb8f6616b00911cd7da974ddd02eb89f717a0eb5a4f5572993173e53e
4
+ data.tar.gz: f09dd51e177bb86b3904617275f164286c4e54d0df866f745171206eb9169802
5
5
  SHA512:
6
- metadata.gz: be24dda8c6754c0ef85209f36db000c8d68367cb41231f3eba7591f4bede44eff097fed9c7e209c853f51a588b9c0f4a72e38e5672e5c816db307417ff1cf749
7
- data.tar.gz: d3656bc0374d3db9437622acc9d0142ce7737bece05e1e87c6cc98bfbf5f2f343bcee8f0f7c6f8d4b4352fc22fdc353cecda2b03abec2814aac95da14df570bf
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Material
4
- VERSION = "0.2.5"
4
+ VERSION = "0.2.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside