Module: Kozeki
- Defined in:
- lib/kozeki.rb,
lib/kozeki/cli.rb,
lib/kozeki/dsl.rb,
lib/kozeki/item.rb,
lib/kozeki/build.rb,
lib/kozeki/state.rb,
lib/kozeki/client.rb,
lib/kozeki/config.rb,
lib/kozeki/record.rb,
lib/kozeki/source.rb,
lib/kozeki/version.rb,
lib/kozeki/collection.rb,
lib/kozeki/filesystem.rb,
lib/kozeki/loader_chain.rb,
lib/kozeki/collection_list.rb,
lib/kozeki/markdown_loader.rb,
lib/kozeki/local_filesystem.rb,
lib/kozeki/queued_filesystem.rb
Defined Under Namespace
Modules: Filesystem, MarkdownLoader Classes: Build, Cli, Client, Collection, CollectionList, Config, Dsl, Item, LoaderChain, LocalFilesystem, QueuedFilesystem, Source, State
Constant Summary collapse
- Record =
Represents cached metadata of Item and Source in a State
Data.define(:id, :path, :timestamp, :mtime, :meta, :build, :pending_build_action, :id_was) do def self.from_source(s) new( path: s.path, id: s.id, timestamp: s., mtime: s.mtime, meta: s., build: nil, pending_build_action: nil, id_was: nil, ) end def self.from_row(h) new( path: h.fetch('path').split('/'), id: h.fetch('id'), timestamp: Time.at(h.fetch('timestamp')), mtime: Time.at(h.fetch('mtime')/1000.0), meta: JSON.parse(h.fetch('meta'), symbolize_names: true), build: h['build']&.then { JSON.parse(_1, symbolize_names: true) }, pending_build_action: h.fetch('pending_build_action', 'none')&.to_sym&.then { _1 == :none ? nil : _1 }, id_was: h.fetch('id_was', nil), ) end def path_row path.join('/') end def to_row { path: path_row, id:, timestamp: .to_i, mtime: (mtime.floor(4).to_f * 1000).truncate, meta: JSON.generate(), build: build && JSON.generate(build), pending_build_action: pending_build_action&.to_s || 'none', } end end
- VERSION =
"0.1.0"