Project

textrepo

0.0
The project is in a healthy, maintained state
Textrepo is a repository to store text with timestamp. It can manage text with the attached timestamp (create/read/update/delete).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
 Project Readme

Textrepo

Build Status

Textrepo is a repository to store a note with a timestamp. Each note in the repository operates with the associated timestamp.

Installation

Add this line to your application's Gemfile:

gem 'textrepo'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install textrepo

Usage

Here is a very short sample to use textrepo. It will make ~/textrepo_sample directory and store some text into it.

#!/usr/bin/env ruby

require "textrepo"

conf = {
  :repository_type => :file_system,
  :repository_name => "textrepo_sample",
  :repository_base => File.expand_path("~"),
}

repo = Textrepo.init(conf)

t0 = Time.now

stamps = []
stamps << repo.create(Textrepo::Timestamp.new(t0), ["jan", "feb", "mar"])
stamps << repo.create(Textrepo::Timestamp.new(t0, 1), ["apr", "may", "jun"])
stamps << repo.create(Textrepo::Timestamp.new(t0, 2), ["jul", "aug", "sep"])
stamps << repo.create(Textrepo::Timestamp.new(t0, 3), ["oct", "nov", "dec"])

entries = repo.notes
puts entries

stamps.each { |stamp|
  text = repo.read(stamp)
  puts "----"
  puts stamp
  puts text
}

Also see examples directory. There is a small tool to demonstrate how to use textrepo.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mnbi/textrepo.

License

The gem is available as open source under the terms of the MIT License.