
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
= DocStorage
{http://bitbucket.org/dmajda/doc_storage/}[http://bitbucket.org/dmajda/doc_storage/]
DocStorage is a simple Ruby library for manipulating documents containing text and metadata. These documents can be used to implement a blog, wiki, or similar application without a database.
== Document Formats
The library distinguishes between simple documents and multipart documents.
A simple document is similar to a RFC 822 message and it is suitable for storing text associated with some metadata (e.g. a blog article with a title and a publication date). It looks like this:
Title: My blog article Datetime: 2009-11-01 18:03:27
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vel lorem massa. Sed blandit orci id leo blandit ut fermentum lacus ullamcorper. Suspendisse metus sapien, consectetur vitae imperdiet vel, ornare a metus. In imperdiet euismod mi, nec volutpat lorem porta id.
A multipart document is loosely based on the MIME multipart message format and allows storing multiple simple documents (e.g. blog comments, each with an author and a publication date) in one file. It looks like this:
Boundary: =====
--===== Author: Fan Datetime: 2009-11-01 20:07:15
Your article is really great! --===== Author: Critic Datetime: 2009-11-01 20:10:54
Your article sucks!
See the documentation of DocStorage::SimpleDocument and DocStorage::MultipartDocument classes for more formal format description.
== Installation
sudo gem install doc_storage --source http://gemcutter.org/
== Example Usage
=== Simple Documents
require "lib/doc_storage"
document = DocStorage::SimpleDocument.new( { "Title" => "Finishing the documentation", "Priority" => "urgent" }, "We should finish the documentation ASAP." )
document = DocStorage::SimpleDocument.load_file("examples/simple.txt")
document.headers["Tags"] = "example" document.body += "Nulla mi dui, pellentesque et accumsan vitae, mattis et velit."
document.save_file("examples/simple_modified.txt")
=== Multipart Documents require "lib/doc_storage"
document = DocStorage::MultipartDocument.new([ DocStorage::SimpleDocument.new( { "Title" => "Finishing the documentation", "Priority" => "urgent" }, "We should finish the documentation ASAP." ), DocStorage::SimpleDocument.new( { "Title" => "Finishing the code", "Priority" => "more urgent" }, "But we should finish the code first!" ), ])
document = DocStorage::MultipartDocument.load_file("examples/multipart.txt")
document.parts << DocStorage::SimpleDocument.new( { "Author" => "Middle man", "Datetime" => "2009-11-01 21:15:33", }, "I think your article is neither good nor bad." )
document.save_file("examples/multipart_modified.txt")
== Author
DocStorage was brought to you by David Majda (david@majda.cz[mailto:david@majda.cz], majda.cz[http://majda.cz/]).
FAQs
Unknown package
We found that doc_storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.