material 0.2.12 → 0.2.13

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: 7b5ded57612bad30122179909d02f23dc9cd6d95d8753b38a34e66e7e63733b7
4
- data.tar.gz: f0cf9ea4391602a51124e9e31144b09a5411d34d63f482809e16043b7077dbb0
3
+ metadata.gz: 1454938dad2b9de0d58ab66a8f6fcb91bd9b349019b895624f8b50c7ad954037
4
+ data.tar.gz: a95337ac41988659ebaffea332c71bbbf974b2ed59e470736615161a9a0b3eb7
5
5
  SHA512:
6
- metadata.gz: 6a370486799c5418ce9348f9acc4b82bbf0b6acf2dd58a1bcf254547943aec19940d5363fcb9cd56e858f6d036864f69fd021f901ae42cf4d9a161d7ff9e8fe8
7
- data.tar.gz: 68178b2c5cccb6b1edf9d59eabd1444c4a25b063524da60f094efb7cc282952a3535cc989843237731a18ccc5480c57397dae59f94bdf20125386d88983ef5f4
6
+ metadata.gz: 63685fd0367a5a8f654ff3f4300c2bbec302c8a838bdf5831d0571be87a340ea742659a9c000a7a6f6da44d2c7cb9e9ae737b17c65daa833b4f95c3f5cb4a983
7
+ data.tar.gz: b528e28c21240bd6d13b332022fc31c7b5e413937ded0e6ba86ea856b065a1d438cb2636b109a00bfeaefb2c4d5871b88605818f75c4f5d1fa1a57113bf550d9
data/lib/material/base.rb CHANGED
@@ -4,10 +4,13 @@ module Material
4
4
  class Base < Spicerack::AttributeObject
5
5
  include Material::Components
6
6
  include Material::Core
7
- include Material::Icon
7
+ include Material::Display
8
8
  include Material::Text
9
9
  include Material::Site
10
10
  include Material::For
11
+ include Material::Format
12
+
13
+ register_component :list_item_style
11
14
 
12
15
  def self.for(object)
13
16
  material_class = material_class_for(object, "Material")
@@ -1,12 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Material
4
- module Icon
4
+ module Display
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
8
  register_component :icon
9
9
  register_component :icon_title
10
+
11
+ register_component :badge
12
+ register_component :badge_style
13
+
14
+ register_component :label
15
+ register_component :label_style
10
16
  end
11
17
  end
12
18
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Format output content consistently.
4
+ module Material
5
+ module Format
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ delegate :format_date, :format_time, :format_datetime, to: :class
10
+ end
11
+
12
+ class_methods do
13
+ def format_date(date)
14
+ date.to_s(:long)
15
+ end
16
+
17
+ def format_datetime(datetime)
18
+ datetime.to_s(:long)
19
+ end
20
+ alias_method :format_time, :format_datetime
21
+ end
22
+ end
23
+ end
data/lib/material/list.rb CHANGED
@@ -1,19 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "concerns/components"
4
- require_relative "concerns/icon"
5
- require_relative "concerns/text"
6
-
7
3
  module Material
8
4
  class List < Collectible::CollectionBase
9
5
  include Material::Components
10
- include Material::Icon
6
+ include Material::Display
11
7
  include Material::Text
12
8
  include Material::Site
13
9
  include Material::For
14
10
  include Material::Pagination
15
11
  include Material::Mount
16
12
  include Material::Collection
13
+ include Material::Format
17
14
 
18
15
  class << self
19
16
  def for(object)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Material
4
- VERSION = "0.2.12"
4
+ VERSION = "0.2.13"
5
5
  end
data/lib/material.rb CHANGED
@@ -1,18 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "active_support"
4
+ require "active_support/core_ext"
4
5
 
5
6
  require "spicerack"
6
7
 
7
8
  require_relative "material/concerns/components"
8
9
  require_relative "material/concerns/core"
9
- require_relative "material/concerns/icon"
10
+ require_relative "material/concerns/display"
10
11
  require_relative "material/concerns/text"
11
12
  require_relative "material/concerns/site"
12
13
  require_relative "material/concerns/for"
13
14
  require_relative "material/concerns/pagination"
14
15
  require_relative "material/concerns/mount"
15
16
  require_relative "material/concerns/collection"
17
+ require_relative "material/concerns/format"
16
18
 
17
19
  require "material/version"
18
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-10 00:00:00.000000000 Z
11
+ date: 2019-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -211,8 +211,9 @@ files:
211
211
  - lib/material/concerns/collection.rb
212
212
  - lib/material/concerns/components.rb
213
213
  - lib/material/concerns/core.rb
214
+ - lib/material/concerns/display.rb
214
215
  - lib/material/concerns/for.rb
215
- - lib/material/concerns/icon.rb
216
+ - lib/material/concerns/format.rb
216
217
  - lib/material/concerns/mount.rb
217
218
  - lib/material/concerns/pagination.rb
218
219
  - lib/material/concerns/site.rb