Sha256: 7e143c0cbe39a3dd0b6036d8a15084319044bb7a86fb96d4b2f63881adc07796

Contents?: true

Size: 989 Bytes

Versions: 3

Compression:

Stored size: 989 Bytes

Contents

# frozen_string_literal: true

require 'active_support'
require 'active_support/core_ext'
require 'active_support/core_ext/date_and_time/calculations'
require 'date'
require 'yaml'
require 'zeitwerk'

loader = Zeitwerk::Loader.for_gem
loader.inflector.inflect('cli' => 'CLI')
loader.setup

# Expire backup directories
module Expire
  # Exception derived from StandardError
  class Error < StandardError; end
  # Your code goes here...

  def self.create_playground(base)
    Playground.create(base)
  end

  def self.newest(path)
    GenerateBackupListService.call(path).newest
  end

  def self.oldest(path)
    GenerateBackupListService.call(path).oldest
  end

  def self.purge(path, options)
    PurgeService.call(path, options)
  end

  def self.remove(path)
    FileUtils.rm_r(path)
  end

  def self.rule_classes
    Expire::RuleList.class_names
  end

  def self.rule_names
    Expire::RuleList.names
  end

  def self.rule_option_names
    Expire::RuleList.option_names
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
expire-0.2.2 lib/expire.rb
expire-0.2.1 lib/expire.rb
expire-0.2.0 lib/expire.rb