Sha256: 2376603ca9a43be95a4edc14b0dab37bc6c4f0b31c28289f05413a9b8a8ff592

Contents?: true

Size: 602 Bytes

Versions: 3

Compression:

Stored size: 602 Bytes

Contents

dir = File.dirname(__FILE__)

require "#{dir}/../lib/doc_storage"

# Create a new document with headers and body
document = DocStorage::SimpleDocument.new(
  {
    "Title"    => "Finishing the documentation",
    "Priority" => "urgent"
  },
  "We should finish the documentation ASAP."
)

# Load from a file
document = DocStorage::SimpleDocument.load_file("examples/simple.txt")

# Document manipulation
document.headers["Tags"] = "example"
document.body += "Nulla mi dui, pellentesque et accumsan vitae, mattis et velit."

# Save the modified document
document.save_file("#{dir}/simple_modified.txt")

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
doc_storage-1.0.2 examples/simple.rb
doc_storage-1.0.1 examples/simple.rb
doc_storage-1.0 examples/simple.rb