PathRules

Generate path as string from rules.

Installation

Add this line to your application's Gemfile:

gem 'path_rules'

And then execute:

$ bundle

Or install it yourself as:

$ gem install path_rules

Usage

require 'path_rules'

path_template = Template.new('/var/log/region_month=%s/region_day=%s/log.gz')
date_infix = DateInfix.new('2015-01-23')

puts t.instance(date_infix.beginning_of_month, date_infix.to_s)
#=> '/var/log/region_month=2015-01-01/region_day=2015-01-23/log.gz'

License

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