contents_core 0.1.6 → 0.1.7
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/README.md +3 -3
- data/app/models/contents_core/item_hash.rb +15 -0
- data/lib/contents_core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f90bf12c228d2c90c68a9de55bbd802d87e7b56
|
4
|
+
data.tar.gz: 0fad93688027f8dd697f81489d27f380d3787c8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc078d12ec01d6461b7b7c61a231c69a3d81a8bb545ec31a2db6598ea113a0cac30a54c4b48f057bcec4e5cafc4fb9a26701cf3aa617e10405084535a74048ef
|
7
|
+
data.tar.gz: 7f591fdbebcd9472dfc12b6e24ae47f26f59fee7ed9e0080cd58edde97a11c8772e0b27d7741bb71d99e6eab21cd212c462c26c8151051efdb4a1b2025dcd90f
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ conf[:cc_blocks][:custom] = {
|
|
44
44
|
ContentsCore.config( { components: conf[:cc_blocks] } )
|
45
45
|
```
|
46
46
|
|
47
|
-
Create the new view blocks: `app/views/contents_core/_block_custom.html.
|
47
|
+
Create the new view blocks: `app/views/contents_core/_block_custom.html.slim`
|
48
48
|
|
49
49
|
```slim
|
50
50
|
- if block
|
@@ -124,9 +124,9 @@ If you use ActiveAdmin as admin interface you can find a sample model configurat
|
|
124
124
|
|
125
125
|
- Including the Blocks concern to a model will add `has_many :cc_blocks` relationship (the list of blocks attached to a container) and some utility methods
|
126
126
|
|
127
|
-
- Block: UI component, a group of items (ex. a text with a title, a slider, a 3 column text
|
127
|
+
- Block: UI component, a group of items (ex. a text with a title, a slider, a 3 column text widget, etc.); built with a list of sub blocks (for nested components) and a list of items
|
128
128
|
|
129
|
-
- Item: a single piece of information (ex. a string, a text, a boolean, an integer, a file, etc.)
|
129
|
+
- Item: a single piece of information (ex. a string, a text, a boolean, an integer, a file, etc.) with a virtual method named *data*
|
130
130
|
|
131
131
|
## Contributors
|
132
132
|
|
@@ -9,6 +9,21 @@ module ContentsCore
|
|
9
9
|
self
|
10
10
|
end
|
11
11
|
|
12
|
+
def from_string( value )
|
13
|
+
if value.is_a? String
|
14
|
+
val = {}
|
15
|
+
value.each_line do |line|
|
16
|
+
m = line.match( /([^:]*):(.*)/ )
|
17
|
+
val[m[1]] = m[2].strip if m && !m[1].blank?
|
18
|
+
end
|
19
|
+
self.data_hash = val
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_s
|
24
|
+
self.data_hash.inject( '' ) { |k, v| k + v[0] + ': ' + v[1] + "\n" }
|
25
|
+
end
|
26
|
+
|
12
27
|
def self.type_name
|
13
28
|
'hash'
|
14
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contents_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|