contentfs 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83ec7d32c2ea2f8781ea440e9a2240f1d516401ee66aeb00d2ca930a5f5b5394
4
- data.tar.gz: d30868419f6f99ab4ed87525b5c0e6cfcbc1177ddd182f8d99c3239247ca4341
3
+ metadata.gz: e31d3c4cb4c0ffab42607cb9f3c4cc156707a66b399fc03f9ea499940cb95ccf
4
+ data.tar.gz: 5fa367925ffaa833aa5aeba306865fe85132cb8ad72e0b4772640714e18433de
5
5
  SHA512:
6
- metadata.gz: a5a5d4dde7a7911b252f0082e571c1d82c3913048ad0ace5ffff6588f177d8f4893687d5bb465d60db98a5f300e80b447dbcefef89f83e05724dca6b72906477
7
- data.tar.gz: a7763f0bb3a268dc7b3a5e40f57e166ceb328289304af2781ca947ed219df2d76bda69832e4ae244c6c46dfd6912954184a02cb89c64edab2199747d72eb9d6c
6
+ metadata.gz: 72bdcb70dd4901bf9a20a3ac3f21aefb36b74d1b9af55e16204376a001bdb27e259b04d4cccc5082f3a737f92ea844aa9c8b4941420282526df8cb627ef0b0eb
7
+ data.tar.gz: c4af486c19311a43f14d328c65094a3a8106e9d82004fb59efc7105c66d5324ea88f3afa90b59db3ce6d61496d120b4b0f7b61b76ed70998592186d5c7849c6c
@@ -1,7 +1,13 @@
1
- ## v0.2.0
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)
@@ -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
- @nested[database.slug] = database
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
- @children[content.slug] = content
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
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentFS
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
 
6
6
  def self.version
7
7
  VERSION
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.0
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-14 00:00:00.000000000 Z
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