futurism 1.2.0.pre2 → 1.2.0.pre3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/futurism/helpers.rb~ +14 -11
- data/lib/futurism/version.rb +1 -1
- data/lib/futurism/version.rb~ +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80e0ce6e5c458215afe4266493a6644a029b75f005bfbadcdc181b82325e0d43
|
4
|
+
data.tar.gz: 902744214a43cee7e28c57f1999e52191aaf2d2022860c53c4784ba9fda200fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8638ce1768afd2da09199dc9e033b32168b54c401fd5ab2b26e20e127b38e4c172b93d8846cca8cc0adb28078073fb0bcd2554d70a5d070e60f631d1d596e5b
|
7
|
+
data.tar.gz: cf8c0a7ecd8451b15f7d71f496bd0e49adb358e1bf9770449424e4d4780709b410ba197f8c459a71468f46c3d7961b4ae331bd9e61e4d0e1d959720b46a7dd88
|
data/lib/futurism/helpers.rb~
CHANGED
@@ -28,12 +28,13 @@ module Futurism
|
|
28
28
|
|
29
29
|
WrappingFuturismElement.new(extends: extends, placeholder: placeholder, options: options).render
|
30
30
|
else
|
31
|
-
placeholder = capture(record, index, &block) if block_given?
|
32
|
-
|
33
31
|
collection_class_name = collection.try(:klass).try(:name) || collection.first.class.to_s
|
34
32
|
as = options.delete(:as) || collection_class_name.underscore
|
35
33
|
broadcast_each = options.delete(:broadcast_each) || false
|
34
|
+
|
36
35
|
collection.each_with_index.map { |record, index|
|
36
|
+
placeholder = capture(record, index, &block) if block_given?
|
37
|
+
|
37
38
|
WrappingFuturismElement.new(extends: extends, placeholder: placeholder, options: options.deep_merge(
|
38
39
|
broadcast_each: broadcast_each,
|
39
40
|
locals: {as.to_sym => record, "#{as}_counter".to_sym => index}
|
@@ -55,7 +56,7 @@ module Futurism
|
|
55
56
|
include ActionView::Helpers
|
56
57
|
include Futurism::MessageVerifier
|
57
58
|
|
58
|
-
attr_reader :
|
59
|
+
attr_reader :placeholder, :html_options, :data_attributes, :model, :options, :eager, :broadcast_each, :controller
|
59
60
|
|
60
61
|
def initialize(extends:, placeholder:, options:)
|
61
62
|
@extends = extends
|
@@ -80,14 +81,7 @@ module Futurism
|
|
80
81
|
end
|
81
82
|
|
82
83
|
def render
|
83
|
-
|
84
|
-
when :li
|
85
|
-
content_tag :li, placeholder, html_options.deep_merge({data: dataset, is: "futurism-li"})
|
86
|
-
when :tr
|
87
|
-
content_tag :tr, placeholder, html_options.deep_merge({data: dataset, is: "futurism-table-row"})
|
88
|
-
else
|
89
|
-
content_tag :"futurism-element", placeholder, html_options.deep_merge({data: dataset})
|
90
|
-
end
|
84
|
+
content_tag :"futurism-element", placeholder, html_options.deep_merge({data: dataset, extends: extends})
|
91
85
|
end
|
92
86
|
|
93
87
|
def transformed_options
|
@@ -112,6 +106,15 @@ module Futurism
|
|
112
106
|
|
113
107
|
message_verifier.generate(controller.to_s)
|
114
108
|
end
|
109
|
+
|
110
|
+
def extends
|
111
|
+
# TODO remove this in the next major version
|
112
|
+
case @extends
|
113
|
+
when :li then "list-item"
|
114
|
+
when :tr then "table-row"
|
115
|
+
else @extends
|
116
|
+
end
|
117
|
+
end
|
115
118
|
end
|
116
119
|
end
|
117
120
|
end
|
data/lib/futurism/version.rb
CHANGED
data/lib/futurism/version.rb~
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: futurism
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.0.
|
4
|
+
version: 1.2.0.pre3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Rubisch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|