contentfs 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/contentfs/database.rb +15 -4
- data/lib/contentfs/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: e31d3c4cb4c0ffab42607cb9f3c4cc156707a66b399fc03f9ea499940cb95ccf
|
4
|
+
data.tar.gz: 5fa367925ffaa833aa5aeba306865fe85132cb8ad72e0b4772640714e18433de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72bdcb70dd4901bf9a20a3ac3f21aefb36b74d1b9af55e16204376a001bdb27e259b04d4cccc5082f3a737f92ea844aa9c8b4941420282526df8cb627ef0b0eb
|
7
|
+
data.tar.gz: c4af486c19311a43f14d328c65094a3a8106e9d82004fb59efc7105c66d5324ea88f3afa90b59db3ce6d61496d120b4b0f7b61b76ed70998592186d5c7849c6c
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
## v0.2.
|
1
|
+
## v0.2.1
|
2
2
|
|
3
3
|
*unreleased*
|
4
4
|
|
5
|
+
* `fix` [#7](https://github.com/metabahn/contentfs/pull/7) Order content and databases by prefix or slug ([bryanp](https://github.com/bryanp))
|
6
|
+
|
7
|
+
## [v0.2.0](https://github.com/metabahn/contentfs/releases/tag/v0.2.0)
|
8
|
+
|
9
|
+
*released on 2020-11-14*
|
10
|
+
|
5
11
|
* `add` [#6](https://github.com/metabahn/contentfs/pull/6) Expose database metadata ([bryanp](https://github.com/bryanp))
|
6
12
|
|
7
13
|
## [v0.1.1](https://github.com/metabahn/contentfs/releases/tag/v0.1.1)
|
data/lib/contentfs/database.rb
CHANGED
@@ -25,8 +25,6 @@ module ContentFS
|
|
25
25
|
name = path.basename(path.extname)
|
26
26
|
prefix, remainder = Prefix.build(name)
|
27
27
|
@prefix = prefix
|
28
|
-
@children = {}
|
29
|
-
@nested = {}
|
30
28
|
@namespace = namespace.dup
|
31
29
|
|
32
30
|
unless root
|
@@ -42,22 +40,35 @@ module ContentFS
|
|
42
40
|
{}
|
43
41
|
end
|
44
42
|
|
43
|
+
children, nested = {}, {}
|
45
44
|
Pathname.new(path).glob("*") do |path|
|
46
45
|
next if path.basename.to_s.start_with?("_")
|
47
46
|
|
48
47
|
if path.directory?
|
49
48
|
database = Database.load(path, namespace: @namespace, root: false)
|
50
|
-
|
49
|
+
nested[database.slug] = database
|
51
50
|
else
|
52
51
|
content = Content.load(path, metadata: @metadata, namespace: @namespace)
|
53
52
|
|
54
53
|
if content.slug == :content
|
55
54
|
@content = content
|
56
55
|
else
|
57
|
-
|
56
|
+
children[content.slug] = content
|
58
57
|
end
|
59
58
|
end
|
60
59
|
end
|
60
|
+
|
61
|
+
@children = Hash[
|
62
|
+
children.sort_by { |key, content|
|
63
|
+
(content.prefix || content.slug).to_s
|
64
|
+
}
|
65
|
+
]
|
66
|
+
|
67
|
+
@nested = Hash[
|
68
|
+
nested.sort_by { |key, database|
|
69
|
+
(database.prefix || database.slug).to_s
|
70
|
+
}
|
71
|
+
]
|
61
72
|
end
|
62
73
|
|
63
74
|
def content
|
data/lib/contentfs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A structured content file system.
|
14
14
|
email: bryan@metabahn.com
|