No commit activity in last 3 years
No release in over 3 years
Filesystem storage adapter for the General Object Mapper. Currently just read-only storage.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.2
>= 2

Runtime

>= 0.5.0
 Project Readme

Generic Object Mapper - Filesystem adapter¶ ↑

The filesystem adapter for the Generic Object Mapper (github.com/phifty/gom) provides an easy way to store object data in the filesystem. Currently the adapter is read-only. The object data - stored in YML files - can be mapped to object, but no object data can be written to disk.

Configuration¶ ↑

If the adapter filesystem is chosen in the storage configuration, the following configuration values should specified.

  • directory - specifies to directory where the object data is placed in.

Example¶ ↑

GOM::Storage.configure {
  storage {
    name :storage_name
    adapter :filesystem
    directory "/var/project-name/data"
  }
}

Files¶ ↑

The adapter reads all the *.yml files in the specified directory. The basename of the file defines the class of the containing objects. A file can store multiple object of that class and is structured the following way.

# file Book.yml
book_1:
  properties:
    pages: 1253
  relations:
    author: author_1

# file Author.yml
author_1:
  properties:
    name: "Mr. Storyteller"

A fetch of that book would look like:

book = GOM::Storage.fetch "storage_name:book_1"

The fetched object would have the instance variable @pages set to 1253 and @author would point to an object of the class Author with the id author_1.

Views¶ ↑

This adapter currently supports class views. For documentation see github.com/phifty/gom.

Development¶ ↑

Development has been done test-driven and the code follows at most the Clean Code paradigms. Code smells has been removed by using the reek code smell detector.

This project is still experimental and under development. Any bug report and contribution is welcome!

Support¶ ↑

Apart from contribution, support via Flattr is welcome.